aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/image/common-senao.mk
diff options
context:
space:
mode:
authorMichael Pratt <mcpratt@pm.me>2021-02-12 13:24:32 -0500
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2021-02-24 14:08:30 +0100
commit70bf4a979c24a5db6f29f6dd691e20eb2345b4d0 (patch)
treeb28bbc463d7d511924612d7e76bb386e12f82bf5 /target/linux/ath79/image/common-senao.mk
parent221eefaf6b301043c491aab8815fcfa24e8a5583 (diff)
downloadupstream-70bf4a979c24a5db6f29f6dd691e20eb2345b4d0.tar.gz
upstream-70bf4a979c24a5db6f29f6dd691e20eb2345b4d0.tar.bz2
upstream-70bf4a979c24a5db6f29f6dd691e20eb2345b4d0.zip
ath79: rename 'engenius' Makefile definitions to 'senao'
These recipes and definitions can apply to devices from other vendors with PCB boards or SDK produced by Senao not only the brand Engenius possible examples: Extreme Networks, WatchGuard, OpenMesh, Fortinet, ALLNET, OCEDO, Plasma Cloud, devolo, etc. so rename all of these items and move DEVICE_VENDOR from common to generic/tiny.mk Signed-off-by: Michael Pratt <mcpratt@pm.me>
Diffstat (limited to 'target/linux/ath79/image/common-senao.mk')
-rw-r--r--target/linux/ath79/image/common-senao.mk32
1 files changed, 32 insertions, 0 deletions
diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk
new file mode 100644
index 0000000000..dd1a53c969
--- /dev/null
+++ b/target/linux/ath79/image/common-senao.mk
@@ -0,0 +1,32 @@
+DEVICE_VARS += SENAO_IMGNAME
+
+# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to
+# sysupgrade, as otherwise it will implant the old configuration from
+# OEM firmware when writing rootfs from factory.bin
+define Build/senao-tar-gz
+ -[ -f "$@" ] && \
+ mkdir -p $@.tmp && \
+ touch $@.tmp/failsafe.bin && \
+ echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \
+ echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \
+ $(CP) $(KDIR)/loader-$(DEVICE_NAME).uImage \
+ $@.tmp/openwrt-$(word 1,$(1))-uImage-lzma.bin && \
+ $(CP) $@ $@.tmp/openwrt-$(word 1,$(1))-root.squashfs && \
+ $(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
+ $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ -C $@.tmp . | gzip -9n > $@ && \
+ rm -rf $@.tmp
+endef
+
+define Device/senao_loader_okli
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
+ LOADER_TYPE := bin
+ COMPILE := loader-$(1).bin loader-$(1).uImage
+ COMPILE/loader-$(1).bin := loader-okli-compile
+ COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \
+ uImage lzma
+ IMAGES += factory.bin
+ IMAGE/factory.bin := append-squashfs-fakeroot-be | pad-to $$$$(BLOCKSIZE) | \
+ append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
+ check-size | senao-tar-gz $$$$(SENAO_IMGNAME)
+endef