From 4c91a37b2780348d74f134ed42b91079398c2a72 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 2 Mar 2007 19:01:49 +0000 Subject: make find_mtd_part work without devfs git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6466 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/functions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'package/base-files/files/etc') diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 1cb365d47..c29ae772a 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() { # { [] ... } -- cgit v1.2.3