aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/lib/functions.sh')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 1b34b8f50d..e55cad0b20 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -168,6 +168,13 @@ include() {
done
}
+find_mtd_index() {
+ local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
+ local INDEX="${PART##mtd}"
+
+ echo ${INDEX}
+}
+
find_mtd_part() {
local INDEX=$(find_mtd_index "$1")
local PREFIX=/dev/mtdblock