lantiq: fix lzma-loader for Netgear DGN 3500(B)
authorMaik Goette <github@beeit.de>
Sun, 8 Jan 2023 17:35:10 +0000 (18:35 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 2 Apr 2023 21:01:44 +0000 (23:01 +0200)
Fixes Uncompressing Kernel Image ... ERROR: LzmaDecode.c, 561

Fixes: #11701 for both 3500(B)
Signed-off-by: Maik Goette <github@beeit.de>
(cherry picked from commit 4d9c38d654fdfb72ef641573bbf5b0f73f638f2e)

target/linux/lantiq/image/Makefile
target/linux/lantiq/image/ar9.mk

index facc3fbe099f5f9f31a76973d33202774b735de1..9fdb949392a156646699d64fd9e86aebd61ef37f 100644 (file)
@@ -49,22 +49,31 @@ define Build/fullimage
        rm $@.tmp
 endef
 
-define Build/loader-okli-compile
+define Build/loader-common
        rm -rf $@.src
        $(MAKE) -C lzma-loader \
                PKG_BUILD_DIR="$@.src" \
                TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
-               PLATFORM="lantiq" \
+               BOARD="$(BOARDNAME)" PLATFORM="lantiq" \
                LZMA_TEXT_START=0x82000000 \
                LOADADDR=0x80002000 \
-               FLASH_START=0x10000000 \
-               FLASH_OFFS=$(LOADER_FLASH_OFFS) \
-               FLASH_MAX=0x0 \
                $(1) compile loader.bin
        mv "$@.bin" "$@"
        rm -rf $@.src
 endef
 
+define Build/loader-kernel
+       $(call Build/loader-common,LOADER_DATA="$@")
+endef
+
+define Build/loader-okli-compile
+       $(call Build/loader-common, \
+               FLASH_START=0x10000000 \
+               FLASH_OFFS=$(LOADER_FLASH_OFFS) \
+               FLASH_MAX=0x0 \
+       )
+endef
+
 define Build/prepend-loader-okli
        cat "$(KDIR)/loader-$(word 1,$(1)).bin" "$@" >> "$@.new"
        mv "$@.new" "$@"
index 434dacb12159eb93992945b4c2873450578c6abb..a1795b355258af016d8a90e52b3c9efc0298c8fc 100644 (file)
@@ -88,6 +88,8 @@ define Device/netgear_dgn3500
   DEVICE_MODEL := DGN3500
   SOC := ar9
   IMAGE_SIZE := 16000k
+  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
+  KERNEL_INITRAMFS := $$(KERNEL)
   IMAGES := \
        sysupgrade-na.bin sysupgrade.bin \
        factory-na.img factory.img
@@ -119,6 +121,8 @@ define Device/netgear_dgn3500b
   DEVICE_MODEL := DGN3500B
   SOC := ar9
   IMAGE_SIZE := 16000k
+  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
+  KERNEL_INITRAMFS := $$(KERNEL)
   IMAGES += factory.img
   IMAGE/sysupgrade.bin := \
        append-kernel | append-rootfs | dgn3500-sercom-footer 0x0 "DE" | \