2 # Copyright (C) 2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
12 echo -ne '\xde\xad\xc0\xde' > $(KDIR)/fs_mark
13 $(call prepare_generic_squashfs,$(KDIR)/fs_mark)
15 # For UBI we want only one extra block
16 rm -f $(KDIR)/ubi_mark
17 echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
21 $(STAGING_DIR_HOST)/bin/lzma e $@ -d16 $(1) $@.new
25 define Build/trx-serial
26 $(STAGING_DIR_HOST)/bin/trx \
29 -f $(word 1,$^) -a 1024 \
30 -f $@ -a 0x10000 -A $(KDIR)/fs_mark
35 # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
36 # if it grows up between releases
37 # root: UBI with one extra block containing UBI mark to trigger erasing
39 $(STAGING_DIR_HOST)/bin/trx \
42 -f $(word 1,$^) -a 0x20000 -b 0x400000 \
44 -A $(KDIR)/ubi_mark -a 0x20000
49 $(STAGING_DIR_HOST)/bin/asustrx \
50 -p $(PRODUCTID) -i $@ -o $@.new
54 define Build/seama-nand
56 $(STAGING_DIR_HOST)/bin/oseama \
58 -m "dev=/dev/mtdblock/7" \
65 $(STAGING_DIR_HOST)/bin/seama \
67 -m "signature=$(SIGNATURE)" \
71 DEVICE_VARS += PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION
74 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
75 # extract the full dtb name based on the device info
76 DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(1).dtb)))
77 KERNEL := kernel-bin | append-dtb | lzma-d16
78 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
79 FILESYSTEMS := squashfs
81 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
86 IMAGE/trx := append-ubi | trx-nand
91 IMAGE/trx := append-ubi | trx-nand | asus-trx
95 define Device/asus-$(1)
99 TARGET_DEVICES += asus-$(1)
103 TARGET_DEVICES += linksys-$(1)
108 IMAGE/bin := append-ubi | seama-nand
112 define Device/dlink-$(1)
116 TARGET_DEVICES += dlink-$(1)
119 define Device/netgear
121 IMAGE/chk := append-ubi | trx-nand | netgear-chk
126 define Device/netgear-$(1)
128 NETGEAR_BOARD_ID := $(2)
130 TARGET_DEVICES += netgear-$(1)
133 define Device/netgear-r6250
135 NETGEAR_BOARD_ID := U12H245T00_NETGEAR
138 define Device/netgear-r6300-v2
140 NETGEAR_BOARD_ID := U12H240T00_NETGEAR
143 define Device/netgear-r8000
145 NETGEAR_BOARD_ID := U12H315T00_NETGEAR
148 define Device/smartrg-sr400ac
150 IMAGE/trx := append-rootfs | trx-serial
154 buffalo-wzr-1750dhp buffalo-wzr-600dhp2 buffalo-wzr-900dhp \
155 buffalo-wxr-1900dhp \
156 netgear-r6250 netgear-r6300-v2 netgear-r8000 \
159 $(eval $(call AsusDevice,rt-ac56u,RT-AC56U))
160 $(eval $(call AsusDevice,rt-ac68u,RT-AC68U))
161 $(eval $(call AsusDevice,rt-ac87u,RT-AC87U))
162 $(eval $(call AsusDevice,rt-n18u,RT-N18U))
163 $(eval $(call DLinkDevice,dir-885l,wrgac42_dlink.2015_dir885l))
164 $(eval $(call LinksysDevice,ea6300-v1))
165 $(eval $(call NetgearDevice,r7000,U12H270T00_NETGEAR))
166 $(eval $(call NetgearDevice,r7900,U12H315T30_NETGEAR))
167 # $(eval $(call NetgearDevice,r8500,U12H334T00_NETGEAR))
169 $(eval $(call BuildImage))