summaryrefslogtreecommitdiff
path: root/package
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
parent9abdf580d910e13ade68cbb23da9b5d83b839f8d (diff)
downloadmtk-20170518-43468559742afb1b6772f8fa851ee2e4d82e1ae7.zip
mtk-20170518-43468559742afb1b6772f8fa851ee2e4d82e1ae7.tar.gz
mtk-20170518-43468559742afb1b6772f8fa851ee2e4d82e1ae7.tar.bz2
add lookup function for mtd parts
SVN-Revision: 5299
Diffstat (limited to 'package')
-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 2abb6f8..bf87548 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}"
+}
+