base-files: add back missing function for find_mtd_part to /lib/functions.sh (fixes #15496)

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40426 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
Felix Fietkau
2014-04-08 21:17:49 +00:00
parent f379312b9c
commit 991bea678a
2 changed files with 7 additions and 7 deletions

View File

@@ -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

View File

@@ -1,12 +1,5 @@
# Copyright (C) 2006-2013 OpenWrt.org
find_mtd_index() {
local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
local INDEX="${PART##mtd}"
echo ${INDEX}
}
find_mtd_chardev() {
local INDEX=$(find_mtd_index "$1")
local PREFIX=/dev/mtd