ixp4xx: Support sysupgrade on WG302 v1
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 20 Dec 2024 18:50:26 +0000 (19:50 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 2 Jan 2025 01:29:44 +0000 (02:29 +0100)
The WG302 v1 have a separate rootfs partition that we
simply just upgrade with a new rootfs image. The kernel
need to be updated on the TFTP server.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
target/linux/ixp4xx/base-files/lib/upgrade/platform.sh [new file with mode: 0644]
target/linux/ixp4xx/image/Makefile

diff --git a/target/linux/ixp4xx/base-files/lib/upgrade/platform.sh b/target/linux/ixp4xx/base-files/lib/upgrade/platform.sh
new file mode 100644 (file)
index 0000000..869eab3
--- /dev/null
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+       local board=$(board_name)
+
+       case "$board" in
+       netgear,wg302v1)
+               return 0
+               ;;
+       esac
+
+       echo "Sysupgrade is not yet supported on $board."
+       return 1
+}
+
+platform_do_upgrade() {
+       local board=$(board_name)
+
+       case "$board" in
+       netgear,wg302v1)
+               PART_NAME=rootfs
+               default_do_upgrade "$1"
+               ;;
+       esac
+}
index f1172ee1234216e87820dd658187cf33ee700949..d4b2e5b96271e439e9cecc8c8c38e659d354cfd0 100644 (file)
@@ -136,6 +136,7 @@ define Device/netgear_wg302v1
        IMAGES := kernel.bin rootfs.bin
        IMAGE/kernel.bin := append-kernel
        IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
+       IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | append-metadata
 endef
 TARGET_DEVICES += netgear_wg302v1