From: Felix Fietkau Date: Fri, 2 Mar 2007 19:01:49 +0000 (+0000) Subject: make find_mtd_part work without devfs X-Git-Tag: reboot~29805 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0ddaeaf38b22279c64faa6105b0f1417c0c44d9d;p=oweals%2Fopenwrt.git make find_mtd_part work without devfs SVN-Revision: 6466 --- diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 1cb365d478..c29ae772ac 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -151,9 +151,11 @@ include() { find_mtd_part() { local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')" + local PREFIX=/dev/mtdblock PART="${PART##mtd}" - echo "${PART:+/dev/mtdblock/$PART}" + [ -d /dev/mtdblock ] && PREFIX=/dev/mtdblock/ + echo "${PART:+$PREFIX$PART}" } strtok() { # { [] ... }