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
/buffalo-wzr-header
42 $(eval product
=$(word 1,$(1)))
43 $(eval region
=$(word 2,$(1)))
45 echo
$(product
)_
$(BUFFALO_TAG_VERSION
)_
$(BUFFALO_TAG_MINOR
)_
$(region
)_
$(BUFFALO_TAG_PLATFORM
); \
46 echo filelen
=$$(stat
-c
%s
$@
); \
52 define Build
/trx-serial
53 $(STAGING_DIR_HOST
)/bin
/trx \
56 -f
$(IMAGE_KERNEL
) -a
1024 \
57 -f
$@
-a
0x10000 -A
$(KDIR
)/fs_mark
62 # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
63 # if it grows up between releases
64 # root: UBI with one extra block containing UBI mark to trigger erasing
66 $(STAGING_DIR_HOST
)/bin
/trx \
69 -f
$(IMAGE_KERNEL
) -a
0x20000 -b
0x400000 \
71 -A
$(KDIR
)/ubi_mark
-a
0x20000
76 $(STAGING_DIR_HOST
)/bin
/asustrx \
77 -p
$(PRODUCTID
) -i
$@
-o
$@.new
81 define Build
/seama-nand
83 $(STAGING_DIR_HOST
)/bin
/oseama \
85 -m
"dev=/dev/mtdblock/7" \
92 $(STAGING_DIR_HOST
)/bin
/seama \
94 -m
"signature=$(SIGNATURE)" \
98 DEVICE_VARS
+= PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION TPLINK_BOARD
99 DEVICE_VARS
+= BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR
101 BRCMFMAC_43602A1
:= kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
102 BRCMFMAC_4366B1
:= kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
103 USB2_PACKAGES
:= kmod-usb-ohci kmod-usb2 kmod-phy-bcm-ns-usb2
104 USB2_PACKAGES
+= kmod-usb-ledtrig-usbport
105 USB3_PACKAGES
:= $(USB2_PACKAGES
) kmod-usb3 kmod-phy-bcm-ns-usb3
107 define Device
/Default
108 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
109 # extract the full dtb name based on the device info
110 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
111 KERNEL
:= kernel-bin | append-dtb | lzma-d16
112 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
113 FILESYSTEMS
:= squashfs
114 KERNEL_NAME
:= zImage
115 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
119 IMAGE
/trx
:= append-ubi | trx-nand
124 IMAGE
/trx
:= append-ubi | trx-nand | asus-trx
127 define Device
/asus-rt-ac56u
128 DEVICE_TITLE
:= Asus RT-AC56U
129 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
131 TARGET_DEVICES
+= asus-rt-ac56u
133 define Device
/asus-rt-ac68u
134 DEVICE_TITLE
:= Asus RT-AC68U
135 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
137 TARGET_DEVICES
+= asus-rt-ac68u
139 define Device
/asus-rt-ac87u
140 DEVICE_TITLE
:= Asus RT-AC87U
141 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
143 TARGET_DEVICES
+= asus-rt-ac87u
145 define Device
/asus-rt-n18u
146 DEVICE_TITLE
:= Asus RT-N18U
147 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
149 TARGET_DEVICES
+= asus-rt-n18u
151 define Device
/buffalo-wxr-1900dhp
152 DEVICE_TITLE
:= Buffalo WXR-1900DHP
153 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
155 TARGET_DEVICES
+= buffalo-wxr-1900dhp
157 define Device
/buffalo-wzr-600dhp2
158 DEVICE_TITLE
:= Buffalo WZR-600DHP2
159 DEVICE_PACKAGES
:= kmod-b43
$(USB2_PACKAGES
)
161 TARGET_DEVICES
+= buffalo-wzr-600dhp2
163 define Device
/buffalo-wzr-900dhp
164 DEVICE_TITLE
:= Buffalo WZR-900DHP
165 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
166 BUFFALO_TAG_PLATFORM
:= bcm
167 BUFFALO_TAG_VERSION
:= 9.99
168 BUFFALO_TAG_MINOR
:= 9.99
169 IMAGES
+= factory-DHP-EU.bin factory-DHP2-JP.bin
170 IMAGE
/factory-DHP-EU.bin
:= \
171 append-ubi | trx-nand | buffalo-wzr-header WZR-900DHP EU | \
172 buffalo-enc WZR-900DHP
$$(BUFFALO_TAG_VERSION
) | \
173 buffalo-tag-dhp WZR-900DHP EU mlang20 | buffalo-enc-tag | \
175 IMAGE
/factory-DHP2-JP.bin
:= \
176 append-ubi | trx-nand | buffalo-wzr-header WZR-900DHP2 JP | \
177 buffalo-enc WZR-900DHP2
$$(BUFFALO_TAG_VERSION
) | \
178 buffalo-tag-dhp WZR-900DHP2 JP jp | buffalo-enc-tag | \
181 TARGET_DEVICES
+= buffalo-wzr-900dhp
183 define Device
/buffalo-wzr-1750dhp
184 DEVICE_TITLE
:= Buffalo WZR-1750DHP
185 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
187 TARGET_DEVICES
+= buffalo-wzr-1750dhp
191 IMAGE
/bin
:= append-ubi | seama-nand
194 define Device
/dlink-dir-885l
195 DEVICE_TITLE
:= D-Link DIR-885L
196 DEVICE_PACKAGES
:= $(BRCMFMAC_4366B1
) $(USB3_PACKAGES
)
198 SIGNATURE
:= wrgac42_dlink
.2015_dir885l
200 TARGET_DEVICES
+= dlink-dir-885l
202 define Device
/linksys-ea6300-v1
203 DEVICE_TITLE
:= Linksys EA6300 V1
204 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
206 # Disabled due to problems with 2 TRX partitions
207 # TARGET_DEVICES += linksys-ea6300-v1
209 define Device
/netgear
211 IMAGE
/chk
:= append-ubi | trx-nand | netgear-chk
215 define Device
/netgear-r6250
216 DEVICE_TITLE
:= Netgear R6250
217 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
219 NETGEAR_BOARD_ID
:= U12H245T00_NETGEAR
221 TARGET_DEVICES
+= netgear-r6250
223 define Device
/netgear-r6300-v2
224 DEVICE_TITLE
:= Netgear R6300 V2
225 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
227 NETGEAR_BOARD_ID
:= U12H240T00_NETGEAR
229 TARGET_DEVICES
+= netgear-r6300-v2
231 define Device
/netgear-r7000
232 DEVICE_TITLE
:= Netgear R7000
233 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
235 NETGEAR_BOARD_ID
:= U12H270T00_NETGEAR
237 TARGET_DEVICES
+= netgear-r7000
239 define Device
/netgear-r7900
240 DEVICE_TITLE
:= Netgear R7900
241 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
243 NETGEAR_BOARD_ID
:= U12H315T30_NETGEAR
245 TARGET_DEVICES
+= netgear-r7900
247 define Device
/netgear-r8000
248 DEVICE_TITLE
:= Netgear R8000
249 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
251 NETGEAR_BOARD_ID
:= U12H315T00_NETGEAR
253 TARGET_DEVICES
+= netgear-r8000
255 define Device
/netgear-r8500
256 DEVICE_TITLE
:= Netgear R8500
257 DEVICE_PACKAGES
:= $(BRCMFMAC_4366B1
) $(USB3_PACKAGES
)
259 NETGEAR_BOARD_ID
:= U12H334T00_NETGEAR
261 # TARGET_DEVICES += netgear-r8500
263 define Device
/smartrg-sr400ac
264 DEVICE_TITLE
:= SmartRG SR400ac
265 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
267 IMAGE
/trx
:= append-rootfs | trx-serial
269 TARGET_DEVICES
+= smartrg-sr400ac
271 define Device
/tenda-ac9
272 DEVICE_TITLE
:= Tenda AC9
273 DEVICE_PACKAGES
:= kmod-b43
$(USB2_PACKAGES
)
275 IMAGE
/trx
:= append-rootfs | trx-serial
277 TARGET_DEVICES
+= tenda-ac9
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
))