ath79: add support for Netgear EX6400 and EX7300
[openwrt/openwrt.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-rootfs
23 mkimage \
24 -A mips -O linux -T filesystem -C none \
25 -M $(NETGEAR_KERNEL_MAGIC) \
26 -n '$(VERSION_DIST) filesystem' \
27 -d $(IMAGE_ROOTFS) $@.fs
28 cat $@.fs >> $@
29 rm -rf $@.fs
30 endef
31
32 define Build/netgear-uImage
33 $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
34 endef
35
36 define Device/netgear_ath79
37 KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
38 IMAGES += factory.img
39 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
40 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
41 endef