mirror of https://github.com/hak5/openwrt-owl.git
procd: fix initial nand sysupgrade
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42884owl
parent
41363b1ecb
commit
4c490c79b2
|
@ -10,6 +10,18 @@ CI_KERNPART="kernel"
|
||||||
# 'ubi' partition on NAND contains UBI
|
# 'ubi' partition on NAND contains UBI
|
||||||
CI_UBIPART="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() {
|
nand_find_volume() {
|
||||||
local ubidevdir ubivoldir
|
local ubidevdir ubivoldir
|
||||||
ubidevdir="/sys/devices/virtual/ubi/$1"
|
ubidevdir="/sys/devices/virtual/ubi/$1"
|
||||||
|
@ -18,6 +30,7 @@ nand_find_volume() {
|
||||||
[ ! -d "$ubivoldir" ] && continue
|
[ ! -d "$ubivoldir" ] && continue
|
||||||
if [ "$( cat $ubivoldir/name )" = "$2" ]; then
|
if [ "$( cat $ubivoldir/name )" = "$2" ]; then
|
||||||
basename $ubivoldir
|
basename $ubivoldir
|
||||||
|
ubi_mknod "$ubivoldir"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -33,6 +46,7 @@ nand_find_ubi() {
|
||||||
[ ! "$mtdnum" ] && continue
|
[ ! "$mtdnum" ] && continue
|
||||||
if [ "$mtdnum" = "$cmtdnum" ]; then
|
if [ "$mtdnum" = "$cmtdnum" ]; then
|
||||||
ubidev=$( basename $ubidevdir )
|
ubidev=$( basename $ubidevdir )
|
||||||
|
ubi_mknod "$ubidevdir"
|
||||||
echo $ubidev
|
echo $ubidev
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue