aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/default
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-26 01:35:50 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-26 01:35:50 +0000
commit43468559742afb1b6772f8fa851ee2e4d82e1ae7 (patch)
tree2a7e600fdda172cdca5ab585d531f4a240d1089d /package/base-files/default
parent9abdf580d910e13ade68cbb23da9b5d83b839f8d (diff)
downloadupstream-43468559742afb1b6772f8fa851ee2e4d82e1ae7.tar.gz
upstream-43468559742afb1b6772f8fa851ee2e4d82e1ae7.tar.bz2
upstream-43468559742afb1b6772f8fa851ee2e4d82e1ae7.zip
add lookup function for mtd parts
SVN-Revision: 5299
Diffstat (limited to 'package/base-files/default')
-rwxr-xr-xpackage/base-files/default/etc/functions.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh
index 2abb6f81c9..bf87548ca5 100755
--- a/package/base-files/default/etc/functions.sh
+++ b/package/base-files/default/etc/functions.sh
@@ -110,3 +110,10 @@ include() {
. $file
done
}
+
+find_mtd_part() {
+ local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
+ PART="${PART##mtd}"
+ echo "${PART:+/dev/mtdblock/$PART}"
+}
+