aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/image/Makefile
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-04-26 20:04:48 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-05-08 21:14:24 +0200
commitdb34cdf6c537304f41a097d9b9b085efa31d1146 (patch)
tree24e74b32019ae2f3fc273691b943da529cbf9f6e /target/linux/ath79/image/Makefile
parent6069bdd0871a20b5adce8d2f677946e05a2da609 (diff)
downloadupstream-db34cdf6c537304f41a097d9b9b085efa31d1146.tar.gz
upstream-db34cdf6c537304f41a097d9b9b085efa31d1146.tar.bz2
upstream-db34cdf6c537304f41a097d9b9b085efa31d1146.zip
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@universe-factory.net>
Diffstat (limited to 'target/linux/ath79/image/Makefile')
-rw-r--r--target/linux/ath79/image/Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index 5f1edcbdb2..cc71c31997 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