summaryrefslogtreecommitdiff
path: root/package/system
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-10-12 15:50:15 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-10-12 15:50:15 +0000
commit4c490c79b2e8f43e01d9be35a71469ad5aca3d35 (patch)
tree9e3a7a105cf538ec1902980522b505afe1dbbbf7 /package/system
parent41363b1ecb4dac138b414675246dd85dc7f086d1 (diff)
downloadmtk-20170518-4c490c79b2e8f43e01d9be35a71469ad5aca3d35.zip
mtk-20170518-4c490c79b2e8f43e01d9be35a71469ad5aca3d35.tar.gz
mtk-20170518-4c490c79b2e8f43e01d9be35a71469ad5aca3d35.tar.bz2
procd: fix initial nand sysupgrade
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42884
Diffstat (limited to 'package/system')
-rw-r--r--package/system/procd/files/nand.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh
index 4894b81..fd2f943 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -10,6 +10,18 @@ CI_KERNPART="kernel"
# 'ubi' partition on NAND contains UBI
CI_UBIPART="ubi"
+ubi_mknod() {
+ local dir="$1"
+ local dev="/dev/$(basename $dir)"
+
+ [ -e "$dev" ] && return 0
+
+ local devid="$(cat $dir/dev)"
+ local major="${devid%%:*}"
+ local minor="${devid##*:}"
+ mknod "$dev" c $major $minor
+}
+
nand_find_volume() {
local ubidevdir ubivoldir
ubidevdir="/sys/devices/virtual/ubi/$1"
@@ -18,6 +30,7 @@ nand_find_volume() {
[ ! -d "$ubivoldir" ] && continue
if [ "$( cat $ubivoldir/name )" = "$2" ]; then
basename $ubivoldir
+ ubi_mknod "$ubivoldir"
return 0
fi
done
@@ -33,6 +46,7 @@ nand_find_ubi() {
[ ! "$mtdnum" ] && continue
if [ "$mtdnum" = "$cmtdnum" ]; then
ubidev=$( basename $ubidevdir )
+ ubi_mknod "$ubidevdir"
echo $ubidev
return 0
fi