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
$(IMAGE_KERNEL
) -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
$(IMAGE_KERNEL
) -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
73 BRCMFMAC_43602A1
:= kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
74 BRCMFMAC_4366B1
:= kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
75 USB2_PACKAGES
:= kmod-usb-ohci kmod-usb2 kmod-phy-bcm-ns-usb2
76 USB3_PACKAGES
:= $(USB2_PACKAGES
) kmod-usb3 kmod-phy-bcm-ns-usb3
79 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
80 # extract the full dtb name based on the device info
81 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
82 KERNEL
:= kernel-bin | append-dtb | lzma-d16
83 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
84 FILESYSTEMS
:= squashfs
86 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
90 IMAGE
/trx
:= append-ubi | trx-nand
95 IMAGE
/trx
:= append-ubi | trx-nand | asus-trx
98 define Device
/asus-rt-ac56u
99 DEVICE_TITLE
:= Asus RT-AC56U
100 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
102 TARGET_DEVICES
+= asus-rt-ac56u
104 define Device
/asus-rt-ac68u
105 DEVICE_TITLE
:= Asus RT-AC68U
106 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
108 TARGET_DEVICES
+= asus-rt-ac68u
110 define Device
/asus-rt-ac87u
111 DEVICE_TITLE
:= Asus RT-AC87U
112 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
114 TARGET_DEVICES
+= asus-rt-ac87u
116 define Device
/asus-rt-n18u
117 DEVICE_TITLE
:= Asus RT-N18U
118 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
120 TARGET_DEVICES
+= asus-rt-n18u
122 define Device
/buffalo-wxr-1900dhp
123 DEVICE_TITLE
:= Buffalo WXR-1900DHP
124 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
126 TARGET_DEVICES
+= buffalo-wxr-1900dhp
128 define Device
/buffalo-wzr-600dhp2
129 DEVICE_TITLE
:= Buffalo WZR-600DHP2
130 DEVICE_PACKAGES
:= kmod-b43
$(USB2_PACKAGES
)
132 TARGET_DEVICES
+= buffalo-wzr-600dhp2
134 define Device
/buffalo-wzr-900dhp
135 DEVICE_TITLE
:= Buffalo WZR-900DHP
136 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
138 TARGET_DEVICES
+= buffalo-wzr-900dhp
140 define Device
/buffalo-wzr-1750dhp
141 DEVICE_TITLE
:= Buffalo WZR-1750DHP
142 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
144 TARGET_DEVICES
+= buffalo-wzr-1750dhp
148 IMAGE
/bin
:= append-ubi | seama-nand
151 define Device
/dlink-dir-885l
152 DEVICE_TITLE
:= D-Link DIR-885L
153 DEVICE_PACKAGES
:= $(BRCMFMAC_4366B1
) $(USB3_PACKAGES
)
155 SIGNATURE
:= wrgac42_dlink
.2015_dir885l
157 TARGET_DEVICES
+= dlink-dir-885l
159 define Device
/linksys-ea6300-v1
160 DEVICE_TITLE
:= Linksys EA6300 V1
161 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
163 TARGET_DEVICES
+= linksys-ea6300-v1
165 define Device
/netgear
167 IMAGE
/chk
:= append-ubi | trx-nand | netgear-chk
171 define Device
/netgear-r6250
172 DEVICE_TITLE
:= Netgear R6250
173 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
175 NETGEAR_BOARD_ID
:= U12H245T00_NETGEAR
178 define Device
/netgear-r6300-v2
179 DEVICE_TITLE
:= Netgear R6300 V2
180 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
182 NETGEAR_BOARD_ID
:= U12H240T00_NETGEAR
185 define Device
/netgear-r7000
186 DEVICE_TITLE
:= Netgear R7000
187 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
189 NETGEAR_BOARD_ID
:= U12H270T00_NETGEAR
191 TARGET_DEVICES
+= netgear-r7000
193 define Device
/netgear-r7900
194 DEVICE_TITLE
:= Netgear R7900
195 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
197 NETGEAR_BOARD_ID
:= U12H315T30_NETGEAR
199 TARGET_DEVICES
+= netgear-r7900
201 define Device
/netgear-r8000
202 DEVICE_TITLE
:= Netgear R8000
203 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
205 NETGEAR_BOARD_ID
:= U12H315T00_NETGEAR
208 define Device
/netgear-r8500
209 DEVICE_TITLE
:= Netgear R8500
210 DEVICE_PACKAGES
:= $(BRCMFMAC_4366B1
) $(USB3_PACKAGES
)
212 NETGEAR_BOARD_ID
:= U12H334T00_NETGEAR
214 # TARGET_DEVICES += netgear-r8500
216 define Device
/smartrg-sr400ac
217 DEVICE_TITLE
:= SmartRG SR400ac
218 DEVICE_PACKAGES
:= $(BRCMFMAC_43602A1
) $(USB3_PACKAGES
)
220 IMAGE
/trx
:= append-rootfs | trx-serial
223 define Device
/tenda-ac9
224 DEVICE_TITLE
:= Tenda AC9
225 DEVICE_PACKAGES
:= $(USB2_PACKAGES
)
227 IMAGE
/trx
:= append-rootfs | trx-serial
229 TARGET_DEVICES
+= tenda-ac9
232 netgear-r6250 netgear-r6300-v2 netgear-r8000 \
235 $(eval
$(call BuildImage
))