add lookup function for mtd parts

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5299 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2006-10-26 01:35:50 +00:00
parent d60a55ea0e
commit 4cdea535e0
1 changed files with 7 additions and 0 deletions

View File

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