base-files: add back missing function for find_mtd_part to /lib/functions.sh (fixes...
[openwrt/openwrt.git] / package / base-files / files / lib / functions.sh
index 1b34b8f50dcb12782e0f63105e814f1b72d50503..e55cad0b200275cdbbe4d08bad13fad24d45c6a4 100755 (executable)
@@ -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