ath79: rename 'engenius' Makefile definitions to 'senao'
[openwrt/staging/wigyori.git] / target / linux / ath79 / image / common-senao.mk
1 DEVICE_VARS += SENAO_IMGNAME
2
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/senao-tar-gz
7 -[ -f "$@" ] && \
8 mkdir -p $@.tmp && \
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 > $@ && \
18 rm -rf $@.tmp
19 endef
20
21 define Device/senao_loader_okli
22 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
23 LOADER_TYPE := bin
24 COMPILE := loader-$(1).bin loader-$(1).uImage
25 COMPILE/loader-$(1).bin := loader-okli-compile
26 COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \
27 uImage lzma
28 IMAGES += factory.bin
29 IMAGE/factory.bin := append-squashfs-fakeroot-be | pad-to $$$$(BLOCKSIZE) | \
30 append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
31 check-size | senao-tar-gz $$$$(SENAO_IMGNAME)
32 endef