[openwrt/openwrt] ath79: Ubiquiti Airmax M: add relocate-kernel to invalidate cache

LEDE Commits lede-commits at lists.infradead.org
Tue May 8 12:15:03 PDT 2018


neoraider pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/db34cdf6c537304f41a097d9b9b085efa31d1146

commit db34cdf6c537304f41a097d9b9b085efa31d1146
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Thu Apr 26 20:04:48 2018 +0200

    ath79: Ubiquiti Airmax M: add relocate-kernel to invalidate cache
    
    Apply ar71xx fix for broken Ubiquiti bootloader to ath79 as well.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ath79/image/Makefile        | 13 +++++++++++++
 target/linux/ath79/image/generic-ubnt.mk |  1 +
 2 files changed, 14 insertions(+)

diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index 5f1edcb..cc71c31 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -36,6 +36,19 @@ define Build/loader-okli
 	mv "$@.new" "$@"
 endef
 
+define Build/relocate-kernel
+	rm -rf $@.relocate
+	$(CP) ../../generic/image/relocate $@.relocate
+	$(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
+	( \
+		dd if=$@.relocate/loader.bin bs=32 conv=sync && \
+		perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
+		cat "$@" \
+	) > "$@.new"
+	mv "$@.new" "$@"
+	rm -rf $@.relocate
+endef
+
 define Build/copy-file
 	cat "$(1)" > "$@"
 endef
diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
index c0370ad..17c89fc 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -52,6 +52,7 @@ define Device/ubnt-xm
   UBNT_TYPE := XM
   UBNT_CHIP := ar7240
   ATH_SOC := ar7241
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
 endef
 
 define Device/ubnt-xw



More information about the lede-commits mailing list