aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-10-12 15:51:35 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-10-12 15:51:35 +0000
commit5a3814ada5c5e3c739725f7aeb3cf781299823c6 (patch)
treed95f0581235531cbdb48e55aa9fa2672d50ce67c /package/system/procd
parentf5cba7f226087ebd62104ac9b507d9478aa15756 (diff)
downloadupstream-5a3814ada5c5e3c739725f7aeb3cf781299823c6.tar.gz
upstream-5a3814ada5c5e3c739725f7aeb3cf781299823c6.tar.bz2
upstream-5a3814ada5c5e3c739725f7aeb3cf781299823c6.zip
procd: fix initial nand sysupgrade
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Backport of r42884 git-svn-id: svn://svn.openwrt.org/openwrt/branches/barrier_breaker@42887 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/system/procd')
-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 4894b81f79..fd2f943ba3 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