956266ab2c4a34e8ed2052ecef96a6b6c7371651
[openwrt/staging/mkresin.git] / target / linux / ath79 / image / common-netgear.mk
1 DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID
2
3 define Build/netgear-squashfs
4 rm -rf $@.fs $@.squashfs
5 mkdir -p $@.fs/image
6 cp $@ $@.fs/image/uImage
7 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
8 $@.fs $@.squashfs -be \
9 -noappend -root-owned -b 65536 \
10 $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
11
12 dd if=/dev/zero bs=1k count=1 >> $@.squashfs
13 mkimage \
14 -A mips -O linux -T filesystem -C none \
15 -M $(NETGEAR_KERNEL_MAGIC) \
16 -a 0xbf070000 -e 0xbf070000 \
17 -n 'MIPS $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
18 -d $@.squashfs $@
19 rm -rf $@.squashfs $@.fs
20 endef
21
22 define Build/netgear-uImage
23 $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
24 endef
25
26 define Device/netgear_ath79
27 KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
28 IMAGES += factory.img
29 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
30 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
31 endef