gluon/patches/lede/0095-ar71xx-make-loader-okli-build-step-more-generic.patch
Matthias Schiffer 0563473abb
ar71xx: fix boot with increased kernel size on CPE/WBS 210/510
Fixes: d139a13563 ("Add various patches to deal with bigger kernels")
Fixes #1417
2018-06-06 22:29:01 +02:00

37 lines
1.6 KiB
Diff

From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 6 Jun 2018 00:34:25 +0200
Subject: ar71xx: make loader-okli build step more generic
Add support for different loader types.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8eac5fc997cab0203718fb0558e6f5aaaeec9c38..de27f5d7c5ce6dbd31305c139afc128edaed15ee 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -73,8 +73,9 @@ define Build/loader-kernel-cmdline
$(call Build/loader-common,LOADER_DATA="$@" KERNEL_CMDLINE="$(CMDLINE)")
endef
+# Arguments: <output name> <kernel offset>
define Build/loader-okli
- dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
+ dd if=$(KDIR)/loader-$(word 1,$(1)).$(LOADER_TYPE) bs=$(word 2,$(1)) conv=sync of="$@.new"
cat "$@" >> "$@.new"
mv "$@.new" "$@"
endef
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 1e40d943ac2aa43aea670fd86268708aea39a46c..18e2c73737f477f4d00020893878cbdfb81a735b 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -69,7 +69,7 @@ $(Device/tplink)
LOADER_FLASH_OFFS := 0x22000
COMPILE := loader-$(1).gz
COMPILE/loader-$(1).gz := loader-okli-compile
- KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1)
+ KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 7680
KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | mktplinkfw-combined
endef