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 USB2_PACKAGES
:= kmod-usb-ohci kmod-usb2
74 USB3_PACKAGES
:= kmod-usb-ohci kmod-usb2 kmod-usb3
77 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
78 # extract the full dtb name based on the device info
79 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
80 KERNEL
:= kernel-bin | append-dtb | lzma-d16
81 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
82 FILESYSTEMS
:= squashfs
84 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
88 IMAGE
/trx
:= append-ubi | trx-nand
93 IMAGE
/trx
:= append-ubi | trx-nand | asus-trx
96 define Device
/asus-rt-ac56u
97 DEVICE_TITLE
:= Asus RT-AC56U
98 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
100 TARGET_DEVICES
+= asus-rt-ac56u
102 define Device
/asus-rt-ac68u
103 DEVICE_TITLE
:= Asus RT-AC68U
104 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
106 TARGET_DEVICES
+= asus-rt-ac68u
108 define Device
/asus-rt-ac87u
109 DEVICE_TITLE
:= Asus RT-AC87U
110 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
112 TARGET_DEVICES
+= asus-rt-ac87u
114 define Device
/asus-rt-n18u
115 DEVICE_TITLE
:= Asus RT-N18U
116 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
118 TARGET_DEVICES
+= asus-rt-n18u
120 define Device
/buffalo-wxr-1900dhp
121 DEVICE_TITLE
:= Buffalo WXR-1900DHP
122 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
124 TARGET_DEVICES
+= buffalo-wxr-1900dhp
126 define Device
/buffalo-wzr-600dhp2
127 DEVICE_TITLE
:= Buffalo WZR-600DHP2
128 DEVICE_PACKAGES
:= kmod-b43
$(USB2_PACKAGES
)
130 TARGET_DEVICES
+= buffalo-wzr-600dhp2
132 define Device
/buffalo-wzr-900dhp
133 DEVICE_TITLE
:= Buffalo WZR-900DHP
134 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
136 TARGET_DEVICES
+= buffalo-wzr-900dhp
138 define Device
/buffalo-wzr-1750dhp
139 DEVICE_TITLE
:= Buffalo WZR-1750DHP
140 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
142 TARGET_DEVICES
+= buffalo-wzr-1750dhp
146 IMAGE
/bin
:= append-ubi | seama-nand
149 define Device
/dlink-dir-885l
150 DEVICE_TITLE
:= D-Link DIR-885L
151 DEVICE_PACKAGES
:= kmod-brcmfmac
$(USB3_PACKAGES
)
153 SIGNATURE
:= wrgac42_dlink
.2015_dir885l
155 TARGET_DEVICES
+= dlink-dir-885l
157 define Device
/linksys-ea6300-v1
158 DEVICE_TITLE
:= Linksys EA6300 V1
159 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
161 TARGET_DEVICES
+= linksys-ea6300-v1
163 define Device
/netgear
165 IMAGE
/chk
:= append-ubi | trx-nand | netgear-chk
169 define Device
/netgear-r6250
170 DEVICE_TITLE
:= Netgear R6250
171 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
173 NETGEAR_BOARD_ID
:= U12H245T00_NETGEAR
176 define Device
/netgear-r6300-v2
177 DEVICE_TITLE
:= Netgear R6300 V2
178 DEVICE_PACKAGES
:= kmod-b43
$(USB3_PACKAGES
)
180 NETGEAR_BOARD_ID
:= U12H240T00_NETGEAR
183 define Device
/netgear-r7000
184 DEVICE_TITLE
:= Netgear R7000
185 DEVICE_PACKAGES
:= $(USB3_PACKAGES
)
187 NETGEAR_BOARD_ID
:= U12H270T00_NETGEAR
189 TARGET_DEVICES
+= netgear-r7000
191 define Device
/netgear-r7900
192 DEVICE_TITLE
:= Netgear R7900
193 DEVICE_PACKAGES
:= kmod-brcmfmac
$(USB3_PACKAGES
)
195 NETGEAR_BOARD_ID
:= U12H315T30_NETGEAR
197 TARGET_DEVICES
+= netgear-r7900
199 define Device
/netgear-r8000
200 DEVICE_TITLE
:= Netgear R8000
201 DEVICE_PACKAGES
:= kmod-brcmfmac
$(USB3_PACKAGES
)
203 NETGEAR_BOARD_ID
:= U12H315T00_NETGEAR
206 define Device
/netgear-r8500
207 DEVICE_TITLE
:= Netgear R8500
208 DEVICE_PACKAGES
:= kmod-brcmfmac
$(USB3_PACKAGES
)
210 NETGEAR_BOARD_ID
:= U12H334T00_NETGEAR
212 # TARGET_DEVICES += netgear-r8500
214 define Device
/smartrg-sr400ac
215 DEVICE_TITLE
:= SmartRG SR400ac
216 DEVICE_PACKAGES
:= kmod-brcmfmac
$(USB3_PACKAGES
)
218 IMAGE
/trx
:= append-rootfs | trx-serial
221 define Device
/tenda-ac9
222 DEVICE_TITLE
:= Tenda AC9
223 DEVICE_PACKAGES
:= $(USB2_PACKAGES
)
225 IMAGE
/trx
:= append-rootfs | trx-serial
227 TARGET_DEVICES
+= tenda-ac9
230 netgear-r6250 netgear-r6300-v2 netgear-r8000 \
233 $(eval
$(call BuildImage
))