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>
This commit is contained in:
Michael Pratt
2021-01-01 16:48:52 -05:00
committed by Adrian Schmutzler
parent ecded5bf09
commit 0070650df4
9 changed files with 104 additions and 100 deletions

View File

@@ -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

View File

@@ -1,12 +1,12 @@
include ./common-buffalo.mk
include ./common-engenius.mk
include ./common-netgear.mk
include ./common-tp-link.mk
include ./common-yuncore.mk
DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
DEVICE_VARS += KERNEL_INITRAMFS_PREFIX
DEVICE_VARS += DAP_SIGNATURE ENGENIUS_IMGNAME
DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE
DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL
define Build/add-elecom-factory-initramfs
@@ -69,24 +69,6 @@ define Build/edimax-headers
rm -rf $@.uImage $@.rootfs
endef
# 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 Build/mkdapimg2
$(STAGING_DIR_HOST)/bin/mkdapimg2 \
-i $@ -o $@.new \
@@ -974,20 +956,6 @@ define Device/embeddedwireless_dorin
endef
TARGET_DEVICES += embeddedwireless_dorin
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
define Device/engenius_eap300-v2
$(Device/engenius_loader_okli)
SOC := ar9341
@@ -999,17 +967,6 @@ define Device/engenius_eap300-v2
endef
TARGET_DEVICES += engenius_eap300-v2
define Device/engenius_eap350-v1
$(Device/engenius_loader_okli)
SOC := ar7242
DEVICE_MODEL := EAP350
DEVICE_VARIANT := v1
IMAGE_SIZE := 4864k
LOADER_FLASH_OFFS := 0x1b0000
ENGENIUS_IMGNAME := senao-eap350
endef
TARGET_DEVICES += engenius_eap350-v1
define Device/engenius_eap600
$(Device/engenius_loader_okli)
SOC := ar9344
@@ -1046,17 +1003,6 @@ define Device/engenius_ecb1750
endef
TARGET_DEVICES += engenius_ecb1750
define Device/engenius_ecb350-v1
$(Device/engenius_loader_okli)
SOC := ar7242
DEVICE_MODEL := ECB350
DEVICE_VARIANT := v1
IMAGE_SIZE := 4864k
LOADER_FLASH_OFFS := 0x1b0000
ENGENIUS_IMGNAME := senao-ecb350
endef
TARGET_DEVICES += engenius_ecb350-v1
define Device/engenius_ecb600
$(Device/engenius_loader_okli)
SOC := ar9344
@@ -1067,18 +1013,6 @@ define Device/engenius_ecb600
endef
TARGET_DEVICES += engenius_ecb600
define Device/engenius_enh202-v1
$(Device/engenius_loader_okli)
SOC := ar7240
DEVICE_MODEL := ENH202
DEVICE_VARIANT := v1
DEVICE_PACKAGES := rssileds
IMAGE_SIZE := 4864k
LOADER_FLASH_OFFS := 0x1b0000
ENGENIUS_IMGNAME := senao-enh202
endef
TARGET_DEVICES += engenius_enh202-v1
define Device/engenius_ens202ext-v1
$(Device/engenius_loader_okli)
SOC := ar9341

View File

@@ -1,4 +1,5 @@
include ./common-buffalo.mk
include ./common-engenius.mk
define Device/buffalo_whr-g301n
$(Device/buffalo_common)
@@ -30,6 +31,40 @@ define Device/dlink_dir-615-e4
endef
TARGET_DEVICES += dlink_dir-615-e4
define Device/engenius_eap350-v1
$(Device/engenius_loader_okli)
SOC := ar7242
DEVICE_MODEL := EAP350
DEVICE_VARIANT := v1
IMAGE_SIZE := 4864k
LOADER_FLASH_OFFS := 0x1b0000
ENGENIUS_IMGNAME := senao-eap350
endef
TARGET_DEVICES += engenius_eap350-v1
define Device/engenius_ecb350-v1
$(Device/engenius_loader_okli)
SOC := ar7242
DEVICE_MODEL := ECB350
DEVICE_VARIANT := v1
IMAGE_SIZE := 4864k
LOADER_FLASH_OFFS := 0x1b0000
ENGENIUS_IMGNAME := senao-ecb350
endef
TARGET_DEVICES += engenius_ecb350-v1
define Device/engenius_enh202-v1
$(Device/engenius_loader_okli)
SOC := ar7240
DEVICE_MODEL := ENH202
DEVICE_VARIANT := v1
DEVICE_PACKAGES := rssileds
IMAGE_SIZE := 4864k
LOADER_FLASH_OFFS := 0x1b0000
ENGENIUS_IMGNAME := senao-enh202
endef
TARGET_DEVICES += engenius_enh202-v1
define Device/pqi_air-pen
SOC := ar9330
DEVICE_VENDOR := PQI