aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-03-02 19:01:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-03-02 19:01:49 +0000
commit36dacf1038d1678508e78de016c3657c2e29661a (patch)
tree8c79489651a7c7cf0efee6498520895477c422b1
parent3249931be4d02d83a1fb9225d4355e1fa2509da8 (diff)
downloadupstream-36dacf1038d1678508e78de016c3657c2e29661a.tar.gz
upstream-36dacf1038d1678508e78de016c3657c2e29661a.tar.bz2
upstream-36dacf1038d1678508e78de016c3657c2e29661a.zip
make find_mtd_part work without devfs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6466 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/etc/functions.sh4
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>] ... }