1 DEVICE_VARS
+= ENGENIUS_IMGNAME
3 # This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to
4 # sysupgrade, as otherwise it will implant the old configuration from
5 # OEM firmware when writing rootfs from factory.bin
6 define Build
/engenius-tar-gz
9 touch
$@.tmp
/failsafe.bin
&& \
10 echo
'#!/bin/sh' > $@.tmp
/before-upgrade.sh
&& \
11 echo
': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp
/before-upgrade.sh
&& \
12 $(CP
) $(KDIR
)/loader-
$(DEVICE_NAME
).uImage \
13 $@.tmp
/openwrt-
$(word 1,$(1))-uImage-lzma.bin
&& \
14 $(CP
) $@
$@.tmp
/openwrt-
$(word 1,$(1))-root.squashfs
&& \
15 $(TAR
) -cp
--numeric-owner
--owner
=0 --group
=0 --mode
=a-s
--sort=name \
16 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
17 -C
$@.tmp . | gzip
-9n
> $@
&& \
21 define Device
/engenius_loader_okli
22 DEVICE_VENDOR
:= EnGenius
23 KERNEL
:= kernel-bin | append-dtb | lzma | uImage lzma
-M
0x4f4b4c49
25 COMPILE
:= loader-
$(1).bin loader-
$(1).uImage
26 COMPILE
/loader-
$(1).bin
:= loader-okli-compile
27 COMPILE
/loader-
$(1).uImage
:= append-loader-okli
$(1) | pad-to
64k | lzma | \
30 IMAGE
/factory.bin
:= append-squashfs-fakeroot-be | pad-to
$$$$(BLOCKSIZE
) | \
31 append-kernel | pad-to
$$$$(BLOCKSIZE
) | append-rootfs | pad-rootfs | \
32 check-size | engenius-tar-gz
$$$$(ENGENIUS_IMGNAME
)