mirror of
https://github.com/openwrt/openwrt.git
synced 2025-04-15 06:57:08 +00:00
base-files: emit diagnostics on sysupgrade abort
Emit diagnostics if nand sysupgrade is aborted because UBI partition cannot be attached. Also avoid redudndant checks. Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
This commit is contained in:
parent
3f2d0703b6
commit
f5ed603d0c
@ -136,18 +136,23 @@ nand_upgrade_prepare_ubi() {
|
||||
ubiattach -m "$mtdnum"
|
||||
sync
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
fi
|
||||
|
||||
if [ ! "$ubidev" ]; then
|
||||
ubiformat /dev/mtd$mtdnum -y
|
||||
ubiattach -m "$mtdnum"
|
||||
sync
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
[ ! "$ubidev" ] && return 1
|
||||
[ "$has_env" -gt 0 ] && {
|
||||
ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB
|
||||
ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB
|
||||
}
|
||||
if [ ! "$ubidev" ]; then
|
||||
ubiformat /dev/mtd$mtdnum -y
|
||||
ubiattach -m "$mtdnum"
|
||||
sync
|
||||
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
|
||||
if [ ! "$ubidev" ]; then
|
||||
echo "cannot attach ubi mtd partition $CI_UBIPART"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$has_env" -gt 0 ]; then
|
||||
ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB
|
||||
ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )"
|
||||
|
Loading…
x
Reference in New Issue
Block a user