]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: D-Link M30/M60: include initramfs in recovery 18878/head
authorMateusz Krzak <kszaquitto+github@gmail.com>
Thu, 22 May 2025 16:36:38 +0000 (18:36 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 13 Jul 2025 15:35:39 +0000 (17:35 +0200)
Currently, if OEM recovery flashes OpenWrt to second ubi1,
OpenWrt cannot boot. With this commit, recovery image is built
with initramfs kernel, so that it can boot from either ubi or ubi1.

This adds an extra step to OpenWrt installation from OEM:
user needs to sysupgrade from initramfs to full system.

Signed-off-by: Mateusz Krzak <kszaquitto+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18878
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/image/filogic.mk

index d3e94592793e36182fd80ec36b66a3b55bda6978..78d7e2d249c1c5ab1096a3ec6bc2db5fed80d723 100644 (file)
@@ -902,7 +902,10 @@ define Device/dlink_aquila-pro-ai-m30-a1
   IMAGES += recovery.bin
   IMAGE_SIZE := 51200k
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  IMAGE/recovery.bin := sysupgrade-tar | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6110001 \x6A\x28\xEE\x0B \x00\x00\x2C\x00 \x00\x00\x20\x03 \x61\x6E
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+  IMAGE/recovery.bin := append-image-stage initramfs-kernel.bin | sysupgrade-tar kernel=$$$$@ |\
+    pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6110001 \x6A\x28\xEE\x0B \x00\x00\x2C\x00 \x00\x00\x20\x03 \x61\x6E
+endif
 endef
 TARGET_DEVICES += dlink_aquila-pro-ai-m30-a1
 
@@ -916,7 +919,10 @@ define Device/dlink_aquila-pro-ai-m60-a1
   IMAGES += recovery.bin
   IMAGE_SIZE := 51200k
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  IMAGE/recovery.bin := sysupgrade-tar | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E8202001 \x30\x6C\x19\x0C \x00\x00\x2C\x00 \x00\x00\x20\x03 \x82\x6E
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+  IMAGE/recovery.bin := append-image-stage initramfs-kernel.bin | sysupgrade-tar kernel=$$$$@ |\
+    pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E8202001 \x30\x6C\x19\x0C \x00\x00\x2C\x00 \x00\x00\x20\x03 \x82\x6E
+endif
 endef
 TARGET_DEVICES += dlink_aquila-pro-ai-m60-a1