From 9b0c41bc68b2c575b029be6aa9730ea9617fea3a Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 1 Dec 2020 18:30:27 +0100 Subject: [PATCH] ath79: restore sysupgrade support for ja76pf2 and routerstations 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 [move Build block, remove check-size argument, wrap sysupgrade line, make commit message easier to read] Signed-off-by: Adrian Schmutzler --- .../ath79/generic/base-files/lib/upgrade/platform.sh | 4 ++-- target/linux/ath79/image/Makefile | 8 ++++++++ target/linux/ath79/image/generic-ubnt.mk | 4 +++- target/linux/ath79/image/generic.mk | 8 +++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 598f301e5b..14e64a3f1b 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -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" diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 4b4a67fd4d..9bec159cf0 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -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 \ diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 1c76e0e294..83668668d3 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -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 diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 3da44e43c2..65d1014c9e 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1110,7 +1110,7 @@ define Device/iodata_etg3-r DEVICE_VENDOR := I-O DATA DEVICE_MODEL := ETG3-R IMAGE_SIZE := 7680k - DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-openssl + DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic-wolfssl endef TARGET_DEVICES += iodata_etg3-r @@ -1170,10 +1170,12 @@ define Device/jjplus_ja76pf2 SOC := ar7161 DEVICE_VENDOR := jjPlus DEVICE_MODEL := JA76PF2 - DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-openssl -uboot-envtools fconfig - IMAGES := kernel.bin rootfs.bin + DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig + 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