diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-03-02 19:01:49 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-03-02 19:01:49 +0000 |
commit | 4c91a37b2780348d74f134ed42b91079398c2a72 (patch) | |
tree | 8c79489651a7c7cf0efee6498520895477c422b1 /package/base-files/files/etc | |
parent | f5ab57b33522609d1465f937b69f158be90b177f (diff) |
make find_mtd_part work without devfs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6466 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-x | package/base-files/files/etc/functions.sh | 4 |
1 files changed, 3 insertions, 1 deletions
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() { # <string> { <variable> [<separator>] ... } |