aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
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
commit4cdea535e055d310610bbb2a5033b1c65354cd2e (patch)
treecea2c3d165008151febba8d42f38112cbe3ecf0d /package/base-files
parentd60a55ea0ea3d8697ca799a7629458ee1214679f (diff)
downloadupstream-4cdea535e055d310610bbb2a5033b1c65354cd2e.tar.gz
upstream-4cdea535e055d310610bbb2a5033b1c65354cd2e.tar.bz2
upstream-4cdea535e055d310610bbb2a5033b1c65354cd2e.zip
add lookup function for mtd parts
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5299 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-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}"
+}
+