From 45cbd5d93aef7622d040a38a82ad941c6e82dd92 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 28 Aug 2023 12:17:17 +0200 Subject: [PATCH] ipq95xx: fix sysupgrade on reference kit Signed-off-by: John Crispin --- .../ipq95xx/base-files/lib/upgrade/platform.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/feeds/ipq95xx/ipq95xx/base-files/lib/upgrade/platform.sh b/feeds/ipq95xx/ipq95xx/base-files/lib/upgrade/platform.sh index fd4f17877..efbb70551 100644 --- a/feeds/ipq95xx/ipq95xx/base-files/lib/upgrade/platform.sh +++ b/feeds/ipq95xx/ipq95xx/base-files/lib/upgrade/platform.sh @@ -3,6 +3,22 @@ RAMFS_COPY_BIN='fw_printenv fw_setenv' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' +qca_do_upgrade() { + local tar_file="$1" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + local dev=$(find_mtd_chardev "0:HLOS") + + tar Oxf $tar_file ${board_dir}/kernel | mtd write - ${dev} + + if [ -n "$UPGRADE_BACKUP" ]; then + tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs + else + tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs + fi +} + platform_check_image() { local magic_long="$(get_magic_long "$1")" board=$(board_name) @@ -22,7 +38,7 @@ platform_do_upgrade() { board=$(board_name) case $board in qcom,ipq9574-ap-al02-c4) - nand_upgrade_tar "$1" + qca_do_upgrade "$1" ;; esac }