From: Felix Fietkau Date: Thu, 26 Oct 2006 01:35:50 +0000 (+0000) Subject: add lookup function for mtd parts X-Git-Tag: reboot~30558 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=43468559742afb1b6772f8fa851ee2e4d82e1ae7;p=openwrt%2Fstaging%2Fblogic.git add lookup function for mtd parts SVN-Revision: 5299 --- diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh index 2abb6f81c907..bf87548ca53c 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}" +} +