aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/image/common-engenius.mk
diff options
context:
space:
mode:
authorMichael Pratt <mcpratt@pm.me>2021-01-01 16:48:52 -0500
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2021-01-07 19:51:50 +0100
commit0070650df45da29a55a89922544dba6859c18f2b (patch)
tree8d39fecdb7add794f134e586b85427a059f3265f /target/linux/ath79/image/common-engenius.mk
parentecded5bf0908953c47933967c0046cceb3ce0ec1 (diff)
downloadupstream-0070650df45da29a55a89922544dba6859c18f2b.tar.gz
upstream-0070650df45da29a55a89922544dba6859c18f2b.tar.bz2
upstream-0070650df45da29a55a89922544dba6859c18f2b.zip
ath79: move small-flash Engenius boards to tiny
This moves some of the Engenius boards from generic to tiny: - EAP350 v1 - ECB350 v1 - ENH202 v1 For these, factory.bin builds are already failing on master branch because of the unique situation for these boards: - 8 MB flash - an extra "failsafe" image for recovery - TFTP does not work (barely possible with 600 MTU) - bootloader loads image from a longer flash offset - 1 eraseblock each needed for OKLI kernel loader and fake rootfs - using mtd-concat to make use of remaining space... The manual alternative would be removing the failsafe partition. However this comes with the risk of extremely difficult recovery if a flash ever fails because TFTP on the bootloader is bugged. Signed-off-by: Michael Pratt <mcpratt@pm.me> [improve commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ath79/image/common-engenius.mk')
-rw-r--r--target/linux/ath79/image/common-engenius.mk33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/ath79/image/common-engenius.mk b/target/linux/ath79/image/common-engenius.mk
new file mode 100644
index 0000000000..56e8f8cf67
--- /dev/null
+++ b/target/linux/ath79/image/common-engenius.mk
@@ -0,0 +1,33 @@
+DEVICE_VARS += ENGENIUS_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/engenius-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/engenius_loader_okli
+ DEVICE_VENDOR := EnGenius
+ 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 | engenius-tar-gz $$$$(ENGENIUS_IMGNAME)
+endef