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 # Similar to Build/tplink-safeloader but uses TRX instead of clean kernel
26 define Build
/bcm53xx-tplink-safeloader
27 $(STAGING_DIR_HOST
)/bin
/trx \
30 -f
$(IMAGE_KERNEL
) -a
1024
31 $(STAGING_DIR_HOST
)/bin
/tplink-safeloader \
41 define Build
/trx-serial
42 $(STAGING_DIR_HOST
)/bin
/trx \
45 -f
$(IMAGE_KERNEL
) -a
1024 \
46 -f
$@
-a
0x10000 -A
$(KDIR
)/fs_mark
51 # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
52 # if it grows up between releases
53 # root: UBI with one extra block containing UBI mark to trigger erasing
55 $(STAGING_DIR_HOST
)/bin
/trx \
58 -f
$(IMAGE_KERNEL
) -a
0x20000 -b
0x400000 \
60 -A
$(KDIR
)/ubi_mark
-a
0x20000
65 $(STAGING_DIR_HOST
)/bin
/asustrx \
66 -p
$(PRODUCTID
) -i
$@
-o
$@.new
70 define Build
/seama-nand
72 $(STAGING_DIR_HOST
)/bin
/oseama \
74 -m
"dev=/dev/mtdblock/7" \
81 $(STAGING_DIR_HOST
)/bin
/seama \
83 -m
"signature=$(SIGNATURE)" \
87 DEVICE_VARS
+= PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION TPLINK_BOARD
89 IEEE8021X
:= wpad-mini
90 B43
:= $(IEEE8021X
) kmod-b43
91 BRCMFMAC_43602A1
:= $(IEEE8021X
) kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
92 BRCMFMAC_4366B1
:= $(IEEE8021X
) kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
93 BRCMFMAC_4366C0
:= $(IEEE8021X
) kmod-brcmfmac
94 USB2_PACKAGES
:= kmod-usb-ohci kmod-usb2 kmod-phy-bcm-ns-usb2
95 USB2_PACKAGES
+= kmod-usb-ledtrig-usbport
96 USB3_PACKAGES
:= $(USB2_PACKAGES
) kmod-usb3 kmod-phy-bcm-ns-usb3
99 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
100 # extract the full dtb name based on the device info
101 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
102 KERNEL
:= kernel-bin | append-dtb | lzma-d16
103 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
104 FILESYSTEMS
:= squashfs
105 KERNEL_NAME
:= zImage
106 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
110 IMAGE
/trx
:= append-ubi | trx-nand
115 IMAGE
/trx
:= append-ubi | trx-nand | asus-trx
118 define Device
/asus-rt-ac56u
119 DEVICE_TITLE
:= Asus RT-AC56U
120 DEVICE_PACKAGES
:= $(B43
) $(USB3_PACKAGES
)
122 TARGET_DEVICES
+= asus-rt-ac56u
124 define Device
/asus-rt-ac68u
125 DEVICE_TITLE
:= Asus RT-AC68U
126 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
128 TARGET_DEVICES
+= asus-rt-ac68u
130 define Device
/asus-rt-ac87u
131 DEVICE_TITLE
:= Asus RT-AC87U
132 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
134 TARGET_DEVICES
+= asus-rt-ac87u
136 define Device
/asus-rt-n18u
137 DEVICE_TITLE
:= Asus RT-N18U
138 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
140 TARGET_DEVICES
+= asus-rt-n18u
142 define Device
/buffalo-wxr-1900dhp
143 DEVICE_TITLE
:= Buffalo WXR-1900DHP
144 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
146 TARGET_DEVICES
+= buffalo-wxr-1900dhp
148 define Device
/buffalo-wzr-600dhp2
149 DEVICE_TITLE
:= Buffalo WZR-600DHP2
150 DEVICE_PACKAGES
:= $(B43
) $(USB2_PACKAGES
)
152 TARGET_DEVICES
+= buffalo-wzr-600dhp2
154 define Device
/buffalo-wzr-900dhp
155 DEVICE_TITLE
:= Buffalo WZR-900DHP
156 DEVICE_PACKAGES
:= $(B43
) $(USB3_PACKAGES
)
158 TARGET_DEVICES
+= buffalo-wzr-900dhp
160 define Device
/buffalo-wzr-1750dhp
161 DEVICE_TITLE
:= Buffalo WZR-1750DHP
162 DEVICE_PACKAGES
:= $(B43
) $(USB3_PACKAGES
)
164 TARGET_DEVICES
+= buffalo-wzr-1750dhp
168 IMAGE
/bin
:= append-ubi | seama-nand
171 define Device
/dlink-dir-885l
172 DEVICE_TITLE
:= D-Link DIR-885L
173 DEVICE_PACKAGES
:= $(BRCMFMAC_4366B1
) $(USB3_PACKAGES
)
175 SIGNATURE
:= wrgac42_dlink
.2015_dir885l
177 TARGET_DEVICES
+= dlink-dir-885l
179 # Linksys devices are disabled due to problem with 2 TRX partitions
181 define Device
/linksys-ea6300-v1
182 DEVICE_TITLE
:= Linksys EA6300 V1
183 DEVICE_PACKAGES
:= $(B43
) $(USB3_PACKAGES
)
185 # TARGET_DEVICES += linksys-ea6300-v1
187 define Device
/linksys-ea9200
188 DEVICE_TITLE
:= Linksys EA9200 V1
189 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
191 # TARGET_DEVICES += linksys-ea9200
193 define Device
/linksys-ea9500
194 DEVICE_TITLE
:= Linksys EA9500
195 DEVICE_PACKAGES
:= $(BRCMFMAC_4366C0
) $(USB3_PACKAGES
)
196 DEVICE_DTS
:= bcm47094-linksys-panamera
198 # TARGET_DEVICES += linksys-ea9500
200 define Device
/netgear
202 IMAGE
/chk
:= append-ubi | trx-nand | netgear-chk
206 define Device
/netgear-r6250
207 DEVICE_TITLE
:= Netgear R6250
208 DEVICE_PACKAGES
:= $(B43
) $(USB3_PACKAGES
)
210 NETGEAR_BOARD_ID
:= U12H245T00_NETGEAR
212 TARGET_DEVICES
+= netgear-r6250
214 define Device
/netgear-r6300-v2
215 DEVICE_TITLE
:= Netgear R6300 V2
216 DEVICE_PACKAGES
:= $(B43
) $(USB3_PACKAGES
)
218 NETGEAR_BOARD_ID
:= U12H240T00_NETGEAR
220 TARGET_DEVICES
+= netgear-r6300-v2
222 define Device
/netgear-r7000
223 DEVICE_TITLE
:= Netgear R7000
224 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
226 NETGEAR_BOARD_ID
:= U12H270T00_NETGEAR
228 TARGET_DEVICES
+= netgear-r7000
230 define Device
/netgear-r7900
231 DEVICE_TITLE
:= Netgear R7900
232 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
234 NETGEAR_BOARD_ID
:= U12H315T30_NETGEAR
236 TARGET_DEVICES
+= netgear-r7900
238 define Device
/netgear-r8000
239 DEVICE_TITLE
:= Netgear R8000
240 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
242 NETGEAR_BOARD_ID
:= U12H315T00_NETGEAR
244 TARGET_DEVICES
+= netgear-r8000
246 define Device
/netgear-r8500
247 DEVICE_TITLE
:= Netgear R8500
248 DEVICE_PACKAGES
:= $(BRCMFMAC_4366B1
) $(USB3_PACKAGES
)
250 NETGEAR_BOARD_ID
:= U12H334T00_NETGEAR
252 # TARGET_DEVICES += netgear-r8500
254 define Device
/smartrg-sr400ac
255 DEVICE_TITLE
:= SmartRG SR400ac
256 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
258 IMAGE
/trx
:= append-rootfs | trx-serial
260 TARGET_DEVICES
+= smartrg-sr400ac
262 define Device
/tenda-ac9
263 DEVICE_TITLE
:= Tenda AC9
264 DEVICE_PACKAGES
:= $(B43
) $(USB2_PACKAGES
)
266 IMAGE
/trx
:= append-rootfs | trx-serial
268 TARGET_DEVICES
+= tenda-ac9
270 define Device
/tplink-archer-c5-v2
271 DEVICE_TITLE
:= TP-LINK Archer C5 V2
272 DEVICE_PACKAGES
:= $(B43
) $(USB2_PACKAGES
)
274 IMAGE
/bin
:= append-rootfs | bcm53xx-tplink-safeloader
275 TPLINK_BOARD
:= ARCHER-C5-V2
277 TARGET_DEVICES
+= tplink-archer-c5-v2
279 define Device
/tplink-archer-c9-v1
280 DEVICE_TITLE
:= TP-LINK Archer C9 V1
281 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
283 IMAGE
/bin
:= append-rootfs | bcm53xx-tplink-safeloader
284 TPLINK_BOARD
:= ARCHERC9
286 TARGET_DEVICES
+= tplink-archer-c9-v1
288 $(eval
$(call BuildImage
))