ath79: restore sysupgrade support for ja76pf2 and routerstations
authorTomasz Maciej Nowak <tmn505@gmail.com>
Tue, 1 Dec 2020 17:30:27 +0000 (18:30 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 1 Dec 2020 19:03:15 +0000 (20:03 +0100)
Because the bug described in FS#2428 has been fixed with bf2870c1d9e1
("kernel: fix mtd partition erase < parent_erasesize writes") these
devices can now safely do sysupgrade.

Restore sysupgrade support disabled in:

0cc87b3bacee ("ath79: image: disable sysupgrade images for routerstations
and ja76pf2")

cc5256a8bfa0 ("ath79: base-files: disable sysupgrade for routerstations
and ja76pf2")

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
[move Build block, remove check-size argument, wrap sysupgrade line,
make commit message easier to read]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
target/linux/ath79/image/Makefile
target/linux/ath79/image/generic-ubnt.mk
target/linux/ath79/image/generic.mk

index 10756abbafd50cd8a248d1c31d6416690a7c41a5..f4fca06384b1f02d2cc45a4992e019f5a7808db7 100644 (file)
@@ -45,11 +45,11 @@ platform_do_upgrade() {
                redboot_fis_do_upgrade "$1" vmlinux_2
                ;;
        jjplus,ja76pf2)
-               echo "Sysupgrade disabled due bug FS#2428"
+               redboot_fis_do_upgrade "$1" linux
                ;;
        ubnt,routerstation|\
        ubnt,routerstation-pro)
-               echo "Sysupgrade disabled due bug FS#2428"
+               redboot_fis_do_upgrade "$1" kernel
                ;;
        *)
                default_do_upgrade "$1"
index 4b4a67fd4d54d0f345477b4d3d221ebb8ff198e2..9bec159cf0ca6ce09f244bbf30202c0c6de4594d 100644 (file)
@@ -5,6 +5,14 @@ KERNEL_LOADADDR = 0x80060000
 
 DEVICE_VARS += LOADER_FLASH_OFFS LOADER_TYPE
 
+define Build/combined-image
+       sh $(TOPDIR)/scripts/combined-image.sh \
+               "$(IMAGE_KERNEL)" \
+               "$@" \
+               "$@.new"
+       @mv $@.new $@
+endef
+
 define Build/loader-common
        rm -rf $@.src
        $(MAKE) -C lzma-loader \
index 6e12c34d850994e09173c2fcf3bb5bf041adefcc..c347bd1cf13002b2260fce0e36b29e84a9a6625c 100644 (file)
@@ -310,9 +310,11 @@ define Device/ubnt_routerstation_common
   DEVICE_VENDOR := Ubiquiti
   SOC := ar7161
   IMAGE_SIZE := 16128k
-  IMAGES := factory.bin
+  IMAGES += factory.bin
   IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
        check-size
+  IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | \
+       append-metadata | check-size
   KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
   KERNEL_INITRAMFS := kernel-bin | append-dtb
 endef
index 6ac8691f19eec88da021627f2af70ef5a5039bd1..614f9ff0b240805cbf9e624a0bf1471b7f6920f5 100644 (file)
@@ -1144,9 +1144,11 @@ define Device/jjplus_ja76pf2
   DEVICE_VENDOR := jjPlus
   DEVICE_MODEL := JA76PF2
   DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig
-  IMAGES := kernel.bin rootfs.bin
+  IMAGES += kernel.bin rootfs.bin
   IMAGE/kernel.bin := append-kernel
   IMAGE/rootfs.bin := append-rootfs | pad-rootfs
+  IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | \
+       append-metadata | check-size
   KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
   KERNEL_INITRAMFS := kernel-bin | append-dtb
   IMAGE_SIZE := 16000k