ath79: netgear: trim down uImage customisations
[openwrt/openwrt.git] / target / linux / ath79 / image / common-netgear.mk
1 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
2
3 define Build/netgear-rootfs
4 mkimage \
5 -A mips -O linux -T filesystem -C none \
6 $(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \
7 -n '$(VERSION_DIST) filesystem' \
8 -d $(IMAGE_ROOTFS) $@.fs
9 cat $@.fs >> $@
10 rm -rf $@.fs
11 endef
12
13 define Build/netgear-squashfs
14 rm -rf $@.fs $@.squashfs
15 mkdir -p $@.fs/image
16 cp $@ $@.fs/image/uImage
17 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
18 $@.fs $@.squashfs -be \
19 -noappend -root-owned -b 65536 \
20 $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
21
22 dd if=/dev/zero bs=1k count=1 >> $@.squashfs
23 mkimage \
24 -A mips -O linux -T filesystem -C none \
25 $(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \
26 -a 0xbf070000 -e 0xbf070000 \
27 -n 'MIPS $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
28 -d $@.squashfs $@
29 rm -rf $@.squashfs $@.fs
30 endef
31
32 define Device/netgear_generic
33 DEVICE_VENDOR := NETGEAR
34 KERNEL := kernel-bin | append-dtb | lzma -d20 | uImage lzma
35 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | uImage lzma
36 IMAGES += factory.img
37 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \
38 append-rootfs | pad-rootfs
39 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
40 check-size
41 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | \
42 check-size
43 endef