openwrtv3/target/linux/rb532/base-files/lib/upgrade/platform.sh
Mathias Kresin 188328111b treewide: move nand_do_upgrade call to platform_do_upgrade
Calling nand_do_upgrade() from platform_pre_upgrade() was deprecated
with 30f61a34b4 ("base-files: always use staged sysupgrade").

Update the platform upgrade code to use platform_do_upgrade() for NAND
images as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-02-16 14:44:02 +01:00

20 lines
338 B
Bash

REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='nandwrite'
CI_KERNPART=none
platform_check_image() {
[ -e /dev/ubi0 ] || {
ubiattach -m 1
sleep 1
}
return 0;
}
platform_nand_pre_upgrade() {
mtd erase kernel
tar xf "$1" "sysupgrade-$(board_name)/kernel" -O | nandwrite -o /dev/mtd0 -
}
platform_do_upgrade() {
nand_do_upgrade "$1"
}