diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-03-02 19:01:49 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-03-02 19:01:49 +0000 |
commit | 0ddaeaf38b22279c64faa6105b0f1417c0c44d9d (patch) | |
tree | 7970d41c4a3643de4c391aaa4c817b8bf87ded0c /package/base-files | |
parent | 484609eeb06618dd2581f93ba57d0023a1f3adee (diff) | |
download | mtk-20170518-0ddaeaf38b22279c64faa6105b0f1417c0c44d9d.zip mtk-20170518-0ddaeaf38b22279c64faa6105b0f1417c0c44d9d.tar.gz mtk-20170518-0ddaeaf38b22279c64faa6105b0f1417c0c44d9d.tar.bz2 |
make find_mtd_part work without devfs
SVN-Revision: 6466
Diffstat (limited to 'package/base-files')
-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 1cb365d..c29ae77 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>] ... } |