Jelajahi Sumber

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 <[email protected]>
Matthias Schiffer 7 tahun lalu
induk
melakukan
db34cdf6c5

+ 13 - 0
target/linux/ath79/image/Makefile

@@ -36,6 +36,19 @@ define Build/loader-okli
 	mv "[email protected]" "$@"
 endef
 
+define Build/relocate-kernel
+	rm -rf [email protected]
+	$(CP) ../../generic/image/relocate [email protected]
+	$(MAKE) -j1 -C [email protected] KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
+	( \
+		dd [email protected]/loader.bin bs=32 conv=sync && \
+		perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
+		cat "$@" \
+	) > "[email protected]"
+	mv "[email protected]" "$@"
+	rm -rf [email protected]
+endef
+
 define Build/copy-file
 	cat "$(1)" > "$@"
 endef

+ 1 - 0
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