brcm2708: add Raspberry Pi 3 support
[openwrt/openwrt.git] / target / linux / ramips / image / Makefile
1 #
2 # Copyright (C) 2008-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define imgname
11 $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)
12 endef
13
14 define sysupname
15 $(call imgname,$(1),$(2))-sysupgrade.bin
16 endef
17
18 VMLINUX:=$(IMG_PREFIX)-vmlinux
19 UIMAGE:=$(IMG_PREFIX)-uImage
20
21 define Image/Build/Initramfs
22 $(call Image/Build/Profile/$(PROFILE),initramfs)
23 endef
24
25 DEVICE_VARS += DTS IMAGE_SIZE
26
27 loadaddr-y := 0x80000000
28 loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
29 loadaddr-$(CONFIG_TARGET_ramips_mt7621) := 0x80001000
30
31 KERNEL_LOADADDR := $(loadaddr-y)
32
33 KERNEL_DTB = kernel-bin | patch-dtb | lzma
34 define Device/Default
35 KERNEL_DEPENDS = $$(wildcard ../dts/$$(DTS).dts)
36 KERNEL := $(KERNEL_DTB) | uImage lzma
37 IMAGES := sysupgrade.bin
38 IMAGE_SIZE := $(ralink_default_fw_size_8M)
39 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
40 endef
41
42 define Build/patch-dtb
43 $(call Image/BuildDTB,../dts/$(DTS).dts,$@.dtb)
44 $(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
45 endef
46
47 define Build/trx
48 $(STAGING_DIR_HOST)/bin/trx \
49 -o $@ \
50 -m $(IMAGE_SIZE) \
51 -f $(word 1,$^) \
52 -a 4 -f $(word 2,$^)
53 endef
54
55 define Build/seama
56 $(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
57 mv $@.seama $@
58 endef
59
60 define Build/seama-seal
61 $(call Build/seama,-s $@.seama $(1))
62 endef
63
64 define Build/relocate-kernel
65 ( \
66 dd if=$(KDIR)/loader.bin bs=32 conv=sync && \
67 perl -e '@s = stat("$@"); print pack("V", @s[7])' && \
68 cat $@ \
69 ) > $@.new
70 mv $@.new $@
71 endef
72
73 define Build/ubnt-erx-factory-compat
74 echo '21001:6' > $@.compat
75 $(TAR) -cf $@ --transform='s/^.*/compat/' $@.compat
76 $(RM) $@.compat
77 endef
78
79 define Build/ubnt-erx-factory-kernel
80 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) ]; then \
81 $(TAR) -rf $@ --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
82 \
83 md5sum --binary $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) | awk '{print $$1}'> $@.md5; \
84 $(TAR) -rf $@ --transform='s/^.*/vmlinux.tmp.md5/' $@.md5; \
85 $(RM) $@.md5; \
86 fi
87 endef
88
89 define Build/ubnt-erx-factory-rootfs
90 echo "dummy" > $@.rootfs
91 $(TAR) -rf $@ --transform='s/^.*/squashfs.tmp/' $@.rootfs
92
93 md5sum --binary $@.rootfs | awk '{print $$1}'> $@.md5
94 $(TAR) -rf $@ --transform='s/^.*/squashfs.tmp.md5/' $@.md5
95 $(RM) $@.md5
96 $(RM) $@.rootfs
97 endef
98
99 define Build/ubnt-erx-factory-version
100 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $@.version
101 $(TAR) -rf $@ --transform='s/^.*/version.tmp/' $@.version
102 $(RM) $@.version
103 endef
104
105 #We need kernel+initrams fit into kernel partition
106 define Build/ubnt-erx-factory-check-size
107 @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$($(TAR) -xf $@ vmlinux.tmp -O | wc -c)" ] || { \
108 echo "WARNING: Initramfs kernel for image $@ is too big (kernel size: $$($(TAR) -xf $@ vmlinux.tmp -O | wc -c), max size $(1))" >&2; \
109 $(RM) -f $@; \
110 }
111
112 @[ "$$($(TAR) -xf $@ vmlinux.tmp -O | wc -c)" -gt 0 ] || { \
113 echo "WARNING: Kernel for image $@ not found" >&2; \
114 $(RM) -f $@; \
115 }
116 endef
117
118 define MkCombineduImage
119 $(call PatchKernelLzma,$(2),$(3))
120 if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt `expr $(4) - 64` ]; then \
121 echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big" >&2; \
122 else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
123 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
124 else \
125 ( dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=`expr $(4) - 64` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.lzma.combined ; \
126 fi ; fi
127 $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma.combined,$(call sysupname,$(1),$(2)),$(6))
128 endef
129
130
131 #
132 # The real magic happens inside these templates
133 #
134 # $(1), compression method
135 # $(2), filename of image data
136 # $(3), output filename
137 define MkImage
138 $(eval imagename=$(if $(4),$(4),MIPS OpenWrt Linux-$(LINUX_VERSION)))
139 -mkimage -A mips -O linux -T kernel -C $(1) -a $(loadaddr-y) -e $(loadaddr-y) \
140 -n "$(imagename)" \
141 -d $(2) $(3)
142 endef
143
144 define CompressLzma
145 $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2)
146 endef
147
148 define MkImageSysupgrade/squashfs
149 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
150 cat $(KDIR)/vmlinux-$(2).uImage $(KDIR)/root.$(1) > $(KDIR)/$(output_name)
151 $(call prepare_generic_squashfs,$(KDIR)/$(output_name))
152 if [ `stat -c%s "$(KDIR)/$(output_name)"` -gt $(3) ]; then \
153 echo "Warning: $(KDIR)/$(output_name) is too big" >&2; \
154 else \
155 $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name); \
156 fi
157 endef
158
159 define MkImageTpl/squashfs
160 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
161 -$(STAGING_DIR_HOST)/bin/mktplinkfw2 -V "ver. 2.0" -B "$(2)" -j \
162 -o $(KDIR)/$(output_name) \
163 -k $(KDIR)/vmlinux-$(1)$(4).bin.lzma \
164 -r $(KDIR)/root.$(1) && \
165 $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name)
166 endef
167
168 define MkImageTpl/initramfs
169 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1).bin)
170 -$(STAGING_DIR_HOST)/bin/mktplinkfw2 -V "ver. 2.0" -B "$(2)" -c \
171 -o $(KDIR)/$(output_name) \
172 -k $(KDIR)/vmlinux-$(1).bin.lzma && \
173 $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name)
174 endef
175
176 # $(1), lowercase board name like "mt7620a_v22sg"
177 # $(2), DTS filename without .dts extension
178 # $(3), optional filename suffix, e.g. "-initramfs"
179 define PatchKernelLzmaDtb
180 cp $(KDIR)/vmlinux$(3) $(KDIR)/vmlinux-$(1)$(3)
181 $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(2).dtb ../dts/$(2).dts
182 $(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1)$(3) $(KDIR)/$(2).dtb
183 $(call CompressLzma,$(KDIR)/vmlinux-$(1)$(3),$(KDIR)/vmlinux-$(1)$(3).bin.lzma)
184 endef
185
186 # $(1), lowercase board name
187 # $(2), DTS filename without .dts extension
188 # $(3), ih_name field of uImage header
189 # $(4), optional filename suffix, e.g. "-initramfs"
190 define MkImageLzmaDtb
191 $(call PatchKernelLzmaDtb,$(1),$(2),$(4))
192 $(call MkImage,lzma,$(KDIR)/vmlinux-$(1)$(4).bin.lzma,$(KDIR)/vmlinux-$(1)$(4).uImage,$(3))
193 endef
194
195 # $(1), Rootfs type, e.g. squashfs
196 # $(2), lowercase board name
197 # $(3), DTS filename without .dts extension
198 # $(4), maximum size of sysupgrade image
199 # $(5), uImage header's ih_name field
200 define BuildFirmware/OF
201 $(call MkImageLzmaDtb,$(2),$(3),$(5))
202 $(call MkImageSysupgrade/$(1),$(1),$(2),$(4),$(6))
203 endef
204
205 define BuildFirmware/OF/tplink
206 $(call PatchKernelLzmaDtb,$(1),$(2),$(4))
207 $(call MkImageTpl/$(1),$(1),$(2),$(4),$(5))
208 endef
209
210 define BuildFirmware/OF/tplink/initramfs
211 $(call PatchKernelLzmaDtb,$(2),$(3),-initramfs)
212 $(call MkImageTpl/$(1),$(1),$(2),$(4),$(5))
213 endef
214
215 # $(1), squashfs/initramfs
216 # $(2), lowercase board name
217 # $(3), DTS filename without .dts extension
218 # $(4), ih_name field of uImage header
219 define BuildFirmware/OF/initramfs
220 $(call MkImageLzmaDtb,$(2),$(3),$(4),-initramfs)
221 $(CP) $(KDIR)/vmlinux-$(2)-initramfs.uImage $(call imgname,$(1),$(2))-uImage.bin
222 endef
223
224
225 # Build images for default ralink layout for 4MB flash
226 # kernel + roots = 0x3b0000
227 # $(1) = squashfs/initramfs
228 # $(2) = lowercase board name
229 # $(3) = dts file
230 ralink_default_fw_size_4M=3866624
231 BuildFirmware/Default4M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_4M),$(4))
232 BuildFirmware/Default4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
233
234 # Build images for default ralink layout for 8MB flash
235 # kernel + roots = 0x7b0000
236 # $(1) = squashfs/initramfs
237 # $(2) = lowercase board name
238 # $(3) = dts file
239 # $(4) = uImage header name field
240 ralink_default_fw_size_8M=8060928
241 BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
242 BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
243 BuildFirmware/Tplink/squashfs=$(call BuildFirmware/OF/tplink,$(1),$(2),$(3),$(4))
244 BuildFirmware/Tplink/initramfs=$(call BuildFirmware/OF/tplink/initramfs,$(1),$(2),$(3),$(4))
245
246 ralink_default_fw_size_16M=16121856
247 BuildFirmware/Default16M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_16M),$(4))
248 BuildFirmware/Default16M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
249
250 ralink_default_fw_size_32M=33226752
251 BuildFirmware/Default32M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_32M),$(4))
252 BuildFirmware/Default32M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
253
254 # Build images for a custom sized flash layout
255 # $(1) = squashfs/initramfs
256 # $(2) = lowercase board name
257 # $(3) = dts file
258 # $(4) = kernel + rootfs size
259 BuildFirmware/CustomFlash/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(4),$(5),$(6))
260 BuildFirmware/CustomFlash/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
261
262 # wrappers for boards that have 4MB and 8MB versions
263 define BuildFirmware/DefaultDualSize/squashfs
264 $(call BuildFirmware/Default4M/$(1),$(1),$(2)-4M,$(3)-4M)
265 $(call BuildFirmware/Default8M/$(1),$(1),$(2)-8M,$(3)-8M)
266 endef
267 define BuildFirmware/DefaultDualSize/initramfs
268 $(call BuildFirmware/OF/initramfs,$(1),$(2)-4M,$(3)-4M)
269 $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
270 endef
271
272 # Some boards need a special header inside the uImage to make them bootable
273 define BuildFirmware/CustomFlashFactory/squashfs
274 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4))
275 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4),$(5),$(6))
276 endef
277 BuildFirmware/CustomFlashFactory/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
278
279 # sign an image to make it work with edimax tftp recovery
280 define BuildFirmware/Edimax/squashfs
281 $(call BuildFirmware/OF,$(1),$(2),$(3),$(4))
282 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
283 mkedimaximg -i $(call sysupname,$(1),$(2)) \
284 -o $(call imgname,$(1),$(2))-factory.bin \
285 -s $(5) -m $(6) -f $(7) -S $(8); \
286 fi
287 endef
288 BuildFirmware/Edimax/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
289
290 # build Seama header images
291 define BuildFirmware/Seama/squashfs
292 $(call MkImageLzmaDtb,$(2),$(3),$(5))
293 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.bin)
294 cat $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/root.$(1) > $(KDIR)/img_$(2).$(1).tmp
295 if [ `stat -c%s "$(KDIR)/img_$(2).$(1).tmp"` -gt $$$$(($(5) - 64)) ]; then \
296 echo "Warning: $(KDIR)/img_$(2).$(1).tmp is too big" >&2; \
297 else \
298 dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=64k conv=sync; \
299 ( \
300 dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64`; \
301 dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
302 ) > $(KDIR)/vmlinux-$(2).tmp; \
303 $(STAGING_DIR_HOST)/bin/seama \
304 -i $(KDIR)/vmlinux-$(2).tmp \
305 -m "dev=/dev/mtdblock/2" -m "type=firmware"; \
306 $(STAGING_DIR_HOST)/bin/seama \
307 -s $(call imgname,$(1),$(2))-factory.bin \
308 -m "signature=$(4)" \
309 -i $(KDIR)/vmlinux-$(2).tmp.seama; \
310 dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64` of=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp; \
311 $(STAGING_DIR_HOST)/bin/seama \
312 -i $(KDIR)/vmlinux-$(2)-sysupgrade.tmp \
313 -m "dev=/dev/mtdblock/2" -m "type=firmware"; \
314 ( \
315 dd if=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp.seama; \
316 dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
317 ) > $(BIN_DIR)/$(output_name); \
318 fi
319 endef
320 BuildFirmware/Seama/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
321
322 # sign Buffalo images
323 define BuildFirmware/Buffalo
324 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
325 buffalo-enc -p $(3) -v 1.76 \
326 -i $(KDIR)/vmlinux-$(2).uImage \
327 -o $(KDIR)/vmlinux-$(2).uImage.enc; \
328 buffalo-enc -p $(3) -v 1.76 \
329 -i $(KDIR)/root.$(1) \
330 -o $(KDIR)/root.$(2).enc; \
331 buffalo-tag -b $(3) -p $(3) -a ram -v 1.76 -m 1.01 \
332 -l mlang8 -f 1 -r EU \
333 -i $(KDIR)/vmlinux-$(2).uImage.enc \
334 -i $(KDIR)/root.$(2).enc \
335 -o $(call imgname,$(1),$(2))-factory-EU.bin; \
336 fi
337 endef
338
339 # sign trednet / UMedia images
340 define BuildFirmware/UMedia/squashfs
341 $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3))
342 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
343 fix-u-media-header -T 0x46 -B $(4) \
344 -i $(call sysupname,$(1),$(2)) \
345 -o $(call imgname,$(1),$(2))-factory.bin; \
346 fi
347 endef
348 BuildFirmware/UMedia/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
349
350 # sign dap 1350 based images
351 dap1350_mtd_size=7667712
352 define BuildFirmware/dap1350/squashfs
353 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(dap1350_mtd_size))
354 -mkdapimg -s $(4) \
355 -i $(call sysupname,$(1),$(2)) \
356 -o $(call imgname,$(1),$(2))-factory.bin
357 endef
358 BuildFirmware/dap1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
359
360 # Sign Poray images
361 define BuildFirmware/Poray4M/squashfs
362 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
363 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
364 mkporayfw -B $(3) -F 4M \
365 -f $(call sysupname,$(1),$(2)) \
366 -o $(call imgname,$(1),$(2))-factory.bin; \
367 fi
368 endef
369 BuildFirmware/Poray4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
370
371 define BuildFirmware/Poray8M/squashfs
372 $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3))
373 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
374 mkporayfw -B $(3) -F 8M \
375 -f $(call sysupname,$(1),$(2)) \
376 -o $(call imgname,$(1),$(2))-factory.bin; \
377 fi
378 endef
379 BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
380
381 define BuildFirmware/PorayDualSize/squashfs
382 $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3))
383 if [ -e "$(call sysupname,$(1),$(2)-4M)" ]; then \
384 mkporayfw -B $(3) -F 4M \
385 -f $(call sysupname,$(1),$(2)-4M) \
386 -o $(call imgname,$(1),$(2)-4M)-factory.bin; \
387 fi
388 if [ -e "$(call sysupname,$(1),$(2)-8M)" ]; then \
389 mkporayfw -B $(3) -F 8M \
390 -f $(call sysupname,$(1),$(2)-8M) \
391 -o $(call imgname,$(1),$(2)-8M)-factory.bin; \
392 fi
393 endef
394 BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3))
395
396 define BuildFirmware/Gemtek/squashfs
397 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
398 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
399 mkheader_gemtek "$(call sysupname,$(1),$(2))" \
400 "$(call imgname,$(1),$(2))-factory.bin" $(2) || \
401 rm -f "$(call imgname,$(1),$(2))-factory.bin"; \
402 fi
403 endef
404 BuildFirmware/Gemtek/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
405
406 # Airlink101 AR670W -- LZMA without uImage header
407 define BuildFirmware/AR670W/squashfs
408 $(call PatchKernelLzmaDtb,$(2),$(3),$(5))
409
410 $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
411 $(eval factory_name=$(IMG_PREFIX)-$(2)-$(1)-factory.bin)
412
413 ( dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=65536 \
414 conv=sync; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/$(output_name)
415
416 $(call prepare_generic_squashfs,$(KDIR)/$(output_name))
417
418 if [ `stat -c%s "$(KDIR)/$(output_name)"` \
419 -gt $(ralink_default_fw_size_4M) ]; then \
420 echo "Warning: $(KDIR)/$(output_name) is too big" >&2; \
421 else \
422 mkwrgimg -i $(KDIR)/$(output_name) \
423 -d "/dev/mtdblock/2" \
424 -s "wrgn16a_airlink_ar670w" \
425 -o $(BIN_DIR)/$(factory_name); \
426 $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name); \
427 fi
428 endef
429
430 #
431 # RT288X Profiles
432 #
433
434 Image/Build/Profile/AR670W=$(call BuildFirmware/AR670W/$(1),$(1),ar670w,AR670W)
435
436 Image/Build/Profile/AR725W=$(call BuildFirmware/Gemtek/$(1),$(1),ar725w,AR725W)
437
438 # 0x790000
439 belkin_f5d8235v1_mtd_size=7929856
440 Image/Build/Profile/F5D8235V1=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v1,F5D8235_V1,$(belkin_f5d8235v1_mtd_size))
441
442 Image/Build/Profile/RTN15=$(call BuildFirmware/Default4M/$(1),$(1),rt-n15,RT-N15)
443
444 Image/Build/Profile/V11STFE=$(call BuildFirmware/Default4M/$(1),$(1),v11st-fe,V11STFE)
445
446 Image/Build/Profile/WLITX4AG300N=$(call BuildFirmware/Default4M/$(1),$(1),wli-tx4-ag300n,WLI-TX4-AG300N)
447
448 Image/Build/Profile/WZRAGL300NH=$(call BuildFirmware/Default4M/$(1),$(1),wzr-agl300nh,WZR-AGL300NH)
449
450 ifeq ($(SUBTARGET),rt288x)
451 define Image/Build/Profile/Default
452 $(call Image/Build/Profile/AR670W,$(1))
453 $(call Image/Build/Profile/AR725W,$(1))
454 $(call Image/Build/Profile/F5D8235V1,$(1))
455 $(call Image/Build/Profile/RTN15,$(1))
456 $(call Image/Build/Profile/V11STFE,$(1))
457 $(call Image/Build/Profile/WLITX4AG300N,$(1))
458 $(call Image/Build/Profile/WZRAGL300NH,$(1))
459 endef
460 endif
461
462
463
464 #
465 # RT305X Profiles
466 #
467
468 Image/Build/Profile/DIR610A1=$(call BuildFirmware/Seama/$(1),$(1),dir-610-a1,DIR-610-A1,wrgn59_dlob.hans_dir610,$(ralink_default_fw_size_4M))
469
470 edimax_3g6200n_mtd_size=3735552
471 Image/Build/Profile/3G6200N=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
472
473 Image/Build/Profile/3G6200NL=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200nl,3G-6200NL,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
474
475 Image/Build/Profile/3G300M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),3g300m,3G300M,$(ralink_default_fw_size_4M),3G150M_SPI Kernel Image,factory)
476
477 Image/Build/Profile/A5-V11=$(call BuildFirmware/Poray4M/$(1),$(1),a5-v11,A5-V11)
478
479 Image/Build/Profile/AIR3GII=$(call BuildFirmware/Default4M/$(1),$(1),air3gii,AIR3GII)
480
481 define BuildFirmware/UIMAGE_8M
482 $(call MkCombineduImage,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M),$(7))
483 endef
484 define Image/Build/Profile/ALL02393G
485 $(call Image/Build/Template/$(image_type)/$(1),UIMAGE_8M,all0239-3g,ALL0239-3G,ttyS1,57600,phys)
486 endef
487
488 Image/Build/Profile/ALL0256N=$(call BuildFirmware/DefaultDualSize/$(1),$(1),all0256n,ALL0256N)
489
490 allnet_all5002_mtd_size=33226752
491 Image/Build/Profile/ALL5002=$(call BuildFirmware/CustomFlash/$(1),$(1),all5002,ALL5002,$(allnet_all5002_mtd_size))
492 Image/Build/Profile/ALL5003=$(call BuildFirmware/CustomFlash/$(1),$(1),all5003,ALL5003,$(allnet_all5002_mtd_size))
493
494 argus_atp52b_mtd_size=7995392
495 Image/Build/Profile/ATP-52B=$(call BuildFirmware/CustomFlash/$(1),$(1),atp-52b,ATP-52B,$(argus_atp52b_mtd_size))
496
497 asl26555_8mb_mtd_size=7929856
498 asl26555_16mb_mtd_size=16252928
499 define BuildFirmware/ASL26555/squashfs
500 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-8M,$(3)-8M,$(asl26555_8mb_mtd_size))
501 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-16M,$(3)-16M,$(asl26555_16mb_mtd_size))
502 endef
503 define BuildFirmware/ASL26555/initramfs
504 $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
505 $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
506 endef
507 Image/Build/Profile/ASL26555=$(call BuildFirmware/ASL26555/$(1),$(1),asl26555,ASL26555)
508
509 Image/Build/Profile/AWM002EVB=$(call BuildFirmware/DefaultDualSize/$(1),$(1),awm002-evb,AWM002-EVB)
510 Image/Build/Profile/AWM003EVB=$(call BuildFirmware/Default8M/$(1),$(1),awm003-evb,AWM003-EVB)
511 Image/Build/Profile/AWAPN2403=$(call BuildFirmware/Default4M/$(1),$(1),awmapn2403,AWAPN2403)
512
513 Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2)
514
515 broadway_mtd_size=7929856
516 Image/Build/Profile/BROADWAY=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),broadway,BROADWAY,$(broadway_mtd_size),Broadway Kernel Image,factory)
517
518 Image/Build/Profile/CARAMBOLA=$(call BuildFirmware/Default8M/$(1),$(1),carambola,CARAMBOLA)
519
520 Image/Build/Profile/D105=$(call BuildFirmware/Default4M/$(1),$(1),d105,D105)
521
522 define BuildFirmware/JCG/squashfs
523 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
524 -jcgimage -o $(call imgname,$(1),$(2))-factory.bin \
525 -u $(call sysupname,$(1),$(2)) -v $(4)
526 endef
527 Image/Build/Profile/JHR-N805R=$(call BuildFirmware/JCG/$(1),$(1),jhr-n805r,JHR-N805R,29.24)
528 Image/Build/Profile/JHR-N825R=$(call BuildFirmware/JCG/$(1),$(1),jhr-n825r,JHR-N825R,23.24)
529 Image/Build/Profile/JHR-N926R=$(call BuildFirmware/JCG/$(1),$(1),jhr-n926r,JHR-N926R,25.24)
530 define Image/Build/Profile/JCG
531 $(call Image/Build/Profile/JHR-N805R,$(1))
532 $(call Image/Build/Profile/JHR-N825R,$(1))
533 $(call Image/Build/Profile/JHR-N926R,$(1))
534 endef
535
536 define BuildFirmware/DIR300B1/squashfs
537 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
538 -mkwrgimg -s $(4) -d /dev/mtdblock/2 \
539 -i $(call sysupname,$(1),$(2)) \
540 -o $(call imgname,$(1),$(2))-factory.bin
541 endef
542 BuildFirmware/DIR300B1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
543 Image/Build/Profile/DIR-300-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-300-b1,DIR-300-B1,wrgn23_dlwbr_dir300b)
544 Image/Build/Profile/DIR-600-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b1,DIR-600-B1,wrgn23_dlwbr_dir600b)
545 Image/Build/Profile/DIR-600-B2=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b2,DIR-600-B2,wrgn23_dlwbr_dir600b)
546 Image/Build/Profile/DIR-615-D=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-615-d,DIR-615-D,wrgn23_dlwbr_dir615d)
547
548 Image/Build/Profile/DIR-620-A1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-a1,DIR-620-A1)
549 Image/Build/Profile/DIR-620-D1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-d1,DIR-620-D1)
550
551 define BuildFirmware/DIR615H1/squashfs
552 $(call BuildFirmware/Default4M/$(1),$(1),dir-615-h1,DIR-615-H1)
553 -mksenaofw -e $(call sysupname,$(1),dir-615-h1) \
554 -o $(call imgname,$(1),dir-615-h1)-factory.bin \
555 -r 0x218 -p 0x30 -t 3
556 endef
557 BuildFirmware/DIR615H1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dir-615-h1,DIR-615-H1)
558 Image/Build/Profile/DIR615H1=$(call BuildFirmware/DIR615H1/$(1),$(1))
559
560 Image/Build/Profile/DAP1350=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350,DAP-1350,RT3052-AP-DAP1350-3)
561
562 Image/Build/Profile/DAP1350WW=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350WW,DAP-1350,RT3052-AP-DAP1350WW-3)
563
564 define BuildFirmware/DCS930/squashfs
565 $(call BuildFirmware/Default4M/squashfs,squashfs,$(2),$(3))
566 dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/image.$(2).combined bs=1048512 count=1 conv=sync
567 cat $(KDIR)/root.squashfs >> $(KDIR)/image.$(2).combined
568 $(call MkImage,lzma,$(KDIR)/image.$(2).combined,$(KDIR)/image.$(2))
569 $(call prepare_generic_squashfs,$(KDIR)/image.$(2))
570 if [ `stat -c%s "$(KDIR)/image.$(2)"` -gt $(ralink_default_fw_size_4M) ]; then \
571 echo "Warning: $(KDIR)/image.$(2) is too big" >&2; \
572 else \
573 dd if=$(KDIR)/image.$(2) of=$(KDIR)/dcs.tmp bs=64K count=5 conv=sync ;\
574 cat $(KDIR)/image.$(2) >> $(KDIR)/dcs.tmp ; \
575 dd if=$(KDIR)/dcs.tmp of=$(call imgname,$(1),$(2))-factory.bin bs=4096k count=1 conv=sync ;\
576 $(STAGING_DIR_HOST)/bin/mkdcs932 $(call imgname,$(1),$(2))-factory.bin ; \
577 fi
578 endef
579 BuildFirmware/DCS930/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
580 Image/Build/Profile/DCS930=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930,DCS-930)
581 Image/Build/Profile/DCS930LB1=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930l-b1,DCS-930L-B1)
582
583 Image/Build/Profile/ESR-9753=$(call BuildFirmware/Default4M/$(1),$(1),esr-9753,ESR-9753)
584
585 Image/Build/Profile/HW550-3G=$(call BuildFirmware/Default8M/$(1),$(1),hw550-3g,HW550-3G)
586
587 belkin_f5d8235v2_mtd_size=7929856
588 Image/Build/Profile/F5D8235V2=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v2,F5D8235_V2,$(belkin_f5d8235v2_mtd_size))
589
590 # 0x770000
591 belkin_f7c027_mtd_size=7798784
592 Image/Build/Profile/F7C027=$(call BuildFirmware/CustomFlash/$(1),$(1),f7c027,F7C027,$(belkin_f7c027_mtd_size))
593
594 Image/Build/Profile/FONERA20N=$(call BuildFirmware/Edimax/$(1),$(1),fonera20n,FONERA20N,$(ralink_default_fw_size_8M),RSDK,NL1T,0x50000,0xc0000)
595
596 Image/Build/Profile/RT-N13U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n13u,RT-N13U)
597
598 #Image/Build/Profile/HG255D=$(call BuildFirmware/Default16M/$(1),$(1),hg255d,HG255D)
599
600 Image/Build/Profile/FREESTATION5=$(call BuildFirmware/Default8M/$(1),$(1),freestation5,FREESTATION5)
601
602 Image/Build/Profile/IP2202=$(call BuildFirmware/Default8M/$(1),$(1),ip2202,IP2202)
603
604 BuildFirmware/HLKRM04/squashfs=$(call BuildFirmware/Default4M/squashfs,$(1),$(2),$(3),$(4))
605 define BuildFirmware/HLKRM04/initramfs
606 $(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
607 mkhilinkfw -e -i$(call imgname,$(1),$(2))-uImage.bin -o $(call imgname,$(1),$(2))-factory.bin;
608 endef
609 Image/Build/Profile/HLKRM04=$(call BuildFirmware/HLKRM04/$(1),$(1),hlk-rm04,HLKRM04,HLK-RM04)
610
611 Image/Build/Profile/HT-TM02=$(call BuildFirmware/Default8M/$(1),$(1),ht-tm02,HT-TM02)
612
613 Image/Build/Profile/M3=$(call BuildFirmware/Poray4M/$(1),$(1),m3,M3)
614
615 Image/Build/Profile/M4=$(call BuildFirmware/PorayDualSize/$(1),$(1),m4,M4)
616
617 Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi3500-3gn,MOFI3500-3GN)
618
619 # Kernel name should be "Linux Kernel Image" to make the OpenWrt image installable from factory Web UI
620 Image/Build/Profile/3G150B=$(call BuildFirmware/Default4M/$(1),$(1),3g150b,3G150B,Linux Kernel Image)
621
622 Image/Build/Profile/MR102N=$(call BuildFirmware/Default8M/$(1),$(1),mr-102n,MR-102N)
623
624 Image/Build/Profile/MPRA1=$(call BuildFirmware/Default4M/$(1),$(1),mpr-a1,MPRA1,Linux Kernel Image)
625 Image/Build/Profile/MPRA2=$(call BuildFirmware/Default8M/$(1),$(1),mpr-a2,MPRA2,Linux Kernel Image)
626
627 Image/Build/Profile/DIR-300-B7=$(call BuildFirmware/Default4M/$(1),$(1),dir-300-b7,DIR-300-B7)
628 Image/Build/Profile/DIR-320-B1=$(call BuildFirmware/Default8M/$(1),$(1),dir-320-b1,DIR-320-B1)
629
630 Image/Build/Profile/NBG-419N=$(call BuildFirmware/Default4M/$(1),$(1),nbg-419n,NBG-419N)
631
632 Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2,MZK-W300NH2,$(mzkw300nh2_mtd_size),CSYS,RN52,0x50000,0xc0000)
633
634 Image/Build/Profile/NCS601W=$(call BuildFirmware/Default8M/$(1),$(1),ncs601W,NCS601W)
635
636 nw718_mtd_size=3801088
637 Image/Build/Profile/NW718=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),nw718m,NW718,$(nw718_mtd_size),ARA1B4NCRNW718;1,factory)
638
639 Image/Build/Profile/M2M=$(call BuildFirmware/Default8M/$(1),$(1),m2m,M2M,Linux Kernel Image)
640
641 Image/Build/Profile/MINIEMBPLUG=$(call BuildFirmware/Default8M/$(1),$(1),miniembplug,MINIEMBPLUG)
642
643 Image/Build/Profile/MINIEMBWIFI=$(call BuildFirmware/Default8M/$(1),$(1),miniembwifi,MINIEMBWIFI)
644
645 Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,PSR-680W)
646
647 Image/Build/Profile/PWH2004=$(call BuildFirmware/Default8M/$(1),$(1),pwh2004,PWH2004)
648
649 Image/Build/Profile/PX-4885=$(call BuildFirmware/DefaultDualSize/$(1),$(1),px-4885,PX-4885)
650
651 Image/Build/Profile/RT5350F-OLINUXINO=$(call BuildFirmware/Default8M/$(1),$(1),rt5350f-olinuxino,RT5350F-OLINUXINO)
652
653 Image/Build/Profile/RT5350F-OLINUXINO-EVB=$(call BuildFirmware/Default8M/$(1),$(1),rt5350f-olinuxino-evb,RT5350F-OLINUXINO-EVB)
654
655 Image/Build/Profile/RTG32B1=$(call BuildFirmware/Default4M/$(1),$(1),rt-g32-b1,RT-G32-B1)
656
657 Image/Build/Profile/RTN10PLUS=$(call BuildFirmware/Default4M/$(1),$(1),rt-n10-plus,RT-N10-PLUS)
658
659 Image/Build/Profile/RUT5XX=$(call BuildFirmware/Default8M/$(1),$(1),rut5xx,RUT5XX)
660
661 Image/Build/Profile/SL-R7205=$(call BuildFirmware/Default4M/$(1),$(1),sl-r7205,SL-R7205)
662
663 Image/Build/Profile/V22RW-2X2=$(call BuildFirmware/Default4M/$(1),$(1),v22rw-2x2,V22RW-2X2)
664
665 vocore_8mb_mtd_size=8060928
666 vocore_16mb_mtd_size=16449536
667 define BuildFirmware/VOCORE/squashfs
668 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-8M,$(3)-8M,$(vocore_8mb_mtd_size))
669 $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-16M,$(3)-16M,$(vocore_16mb_mtd_size))
670 endef
671 define BuildFirmware/VOCORE/initramfs
672 $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
673 $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
674 endef
675 Image/Build/Profile/VOCORE=$(call BuildFirmware/VOCORE/$(1),$(1),vocore,VOCORE)
676
677 Image/Build/Profile/W150M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w150m,W150M,$(ralink_default_fw_size_4M),W150M Kernel Image,factory)
678
679 Image/Build/Profile/W306R_V20=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w306r-v20,W306R_V20,$(ralink_default_fw_size_4M),linkn Kernel Image,factory)
680
681 Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
682
683 Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
684
685 Image/Build/Profile/MZK-DP150N=$(call BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
686
687 buffalo_whrg300n_mtd_size=3801088
688 define BuildFirmware/WHRG300N/squashfs
689 $(call BuildFirmware/Default4M/$(1),$(1),whr-g300n,WHR-G300N)
690 # the following line has a bad argument 3 ... the old Makefile was already broken
691 $(call BuildFirmware/Buffalo,$(1),whr-g300n,whr-g300n)
692 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
693 ( \
694 echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \
695 dd bs=512 count=1 conv=sync; \
696 dd if=$(call sysupname,$(1),whr-g300n); \
697 ) > $(KDIR)/whr-g300n-tftp.tmp && \
698 buffalo-tftp -i $(KDIR)/whr-g300n-tftp.tmp \
699 -o $(call imgname,$(1),whr-g300n)-tftp.bin; \
700 fi
701 endef
702 BuildFirmware/WHRG300N/initramfs=$(call BuildFirmware/OF/initramfs,$(1),whr-g300n,WHR-G300N)
703 Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1))
704
705 Image/Build/Profile/WIZARD8800=$(call BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
706
707 Image/Build/Profile/WIZFI630A=$(call BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
708
709 Image/Build/Profile/WL-330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
710
711 Image/Build/Profile/WL-330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
712
713 kernel_size_wl341v3=917504
714 rootfs_size_wl341v3=2949120
715 define BuildFirmware/WL-341V3/squashfs
716 $(call BuildFirmware/Default4M/$(1),$(1),wl-341v3,WL-341V3)
717 # This code looks broken and really needs to be converted to C
718 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
719 ( \
720 dd if=/dev/zero bs=195936 count=1; \
721 echo "1.01"; \
722 dd if=/dev/zero bs=581 count=1; \
723 echo -n -e "\x73\x45\x72\x43\x6F\x4D\x6D\x00\x01\x00\x00\x59\x4E\x37\x95\x58\x10\x00\x20\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x03\x00\x00\x80\x00\x00\x00\x00\x03\x00\x00\x10\x12\x00\x00\x00\x10\x73\x45\x72\x43\x6F\x4D\x6D"; \
724 dd if=/dev/zero bs=65552 count=1; \
725 dd if=$(KDIR)/vmlinux-$(2).uImage bs=$(kernel_size_wl341v3) conv=sync; \
726 dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
727 dd if=/dev/zero bs=`expr 4194304 - 262144 - 16 - $(kernel_size_wl341v3) - \( \( \( \`stat -c%s $(KDIR)/root.$(1)\` / 65536 \) + 1 \) \* 65536 \)` count=1; \
728 echo -n -e "\x11\x03\x80\x00\x10\x12\x90\xF7\x65\x52\x63\x4F\x6D\x4D\x00\x00"; \
729 ) > $(call imgname,$(1),$(2))-factory.bin; \
730 fi
731 endef
732 BuildFirmware/WL-341V3/initramfs=$(call BuildFirmware/OF/initramfs,$(1),wl-341v3,WL-341V3)
733 Image/Build/Profile/WL-341V3=$(call BuildFirmware/WL-341V3/$(1),$(1))
734
735 Image/Build/Profile/WL-351=$(call BuildFirmware/Default4M/$(1),$(1),wl-351,WL-351)
736
737 define BuildFirmware/WNCE2001/squashfs
738 $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
739 -mkdapimg -s RT3052-AP-WNCE2001-3 -r WW -v 1.0.0.99 \
740 -i $(call sysupname,$(1),$(2)) \
741 -o $(call imgname,$(1),$(2))-factory-worldwide.bin
742 -mkdapimg -s RT3052-AP-WNCE2001-3 -r NA -v 1.0.0.99 \
743 -i $(call sysupname,$(1),$(2)) \
744 -o $(call imgname,$(1),$(2))-factory-northamerica.bin
745 endef
746 BuildFirmware/WNCE2001/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
747 Image/Build/Profile/WNCE2001=$(call BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WNCE2001)
748
749 Image/Build/Profile/WR512-3GN=$(call BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)
750
751 Image/Build/Profile/WT1520=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)
752
753 Image/Build/Profile/UR-326N4G=$(call BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
754
755 Image/Build/Profile/UR-336UN=$(call BuildFirmware/Default8M/$(1),$(1),ur-336un,UR-336UN)
756
757 Image/Build/Profile/WR6202=$(call BuildFirmware/Default8M/$(1),$(1),wr6202,WR6202)
758
759 Image/Build/Profile/X5=$(call BuildFirmware/Poray8M/$(1),$(1),x5,X5)
760
761 Image/Build/Profile/X8=$(call BuildFirmware/Poray8M/$(1),$(1),x8,X8)
762
763 Image/Build/Profile/XDXRN502J=$(call BuildFirmware/Default4M/$(1),$(1),xdxrn502j,XDXRN502J)
764
765 ifeq ($(SUBTARGET),rt305x)
766 define Image/Build/Profile/Default
767 $(call Image/Build/Profile/3G6200N,$(1))
768 $(call Image/Build/Profile/3G6200NL,$(1))
769 $(call Image/Build/Profile/3G150B,$(1))
770 $(call Image/Build/Profile/3G300M,$(1))
771 $(call Image/Build/Profile/A5-V11,$(1))
772 $(call Image/Build/Profile/AIR3GII,$(1))
773 $(call Image/Build/Profile/ALL02393G,$(1))
774 $(call Image/Build/Profile/ALL0256N,$(1))
775 $(call Image/Build/Profile/ALL5002,$(1))
776 $(call Image/Build/Profile/ALL5003,$(1))
777 $(call Image/Build/Profile/ASL26555,$(1))
778 $(call Image/Build/Profile/ATP-52B,$(1))
779 $(call Image/Build/Profile/AWM002EVB,$(1))
780 $(call Image/Build/Profile/AWAPN2403,$(1))
781 $(call Image/Build/Profile/BC2,$(1))
782 $(call Image/Build/Profile/BROADWAY,$(1))
783 $(call Image/Build/Profile/CARAMBOLA,$(1))
784 $(call Image/Build/Profile/D105,$(1))
785 $(call Image/Build/Profile/DIR-300-B1,$(1))
786 $(call Image/Build/Profile/DIR-600-B1,$(1))
787 $(call Image/Build/Profile/DIR-300-B7,$(1))
788 $(call Image/Build/Profile/DIR-320-B1,$(1))
789 $(call Image/Build/Profile/DIR-600-B2,$(1))
790 $(call Image/Build/Profile/DIR610A1,$(1))
791 $(call Image/Build/Profile/DIR-615-D,$(1))
792 $(call Image/Build/Profile/DIR-620-A1,$(1))
793 $(call Image/Build/Profile/DIR-620-D1,$(1))
794 $(call Image/Build/Profile/DIR615H1,$(1))
795 $(call Image/Build/Profile/DAP1350,$(1))
796 $(call Image/Build/Profile/DAP1350WW,$(1))
797 $(call Image/Build/Profile/DCS930,$(1))
798 $(call Image/Build/Profile/DCS930LB1,$(1))
799 $(call Image/Build/Profile/ESR-9753,$(1))
800 $(call Image/Build/Profile/F7C027,$(1))
801 $(call Image/Build/Profile/F5D8235V2,$(1))
802 $(call Image/Build/Profile/FONERA20N,$(1))
803 $(call Image/Build/Profile/FREESTATION5,$(1))
804 # $(call Image/Build/Profile/HG255D,$(1))
805 $(call Image/Build/Profile/HLKRM04,$(1))
806 $(call Image/Build/Profile/HT-TM02,$(1))
807 $(call Image/Build/Profile/HW550-3G,$(1))
808 $(call Image/Build/Profile/IP2202,$(1))
809 $(call Image/Build/Profile/JHR-N805R,$(1))
810 $(call Image/Build/Profile/JHR-N825R,$(1))
811 $(call Image/Build/Profile/JHR-N926R,$(1))
812 $(call Image/Build/Profile/M2M,$(1))
813 $(call Image/Build/Profile/M3,$(1))
814 $(call Image/Build/Profile/M4,$(1))
815 $(call Image/Build/Profile/MOFI3500-3GN,$(1))
816 $(call Image/Build/Profile/MR102N,$(1))
817 $(call Image/Build/Profile/MPRA1,$(1))
818 $(call Image/Build/Profile/MPRA2,$(1))
819 $(call Image/Build/Profile/MZKW300NH2,$(1))
820 $(call Image/Build/Profile/NBG-419N,$(1))
821 $(call Image/Build/Profile/NCS601W,$(1))
822 $(call Image/Build/Profile/NW718,$(1))
823 $(call Image/Build/Profile/MINIEMBWIFI,$(1))
824 $(call Image/Build/Profile/MINIEMBPLUG,$(1))
825 $(call Image/Build/Profile/PSR-680W,$(1))
826 $(call Image/Build/Profile/PWH2004,$(1))
827 $(call Image/Build/Profile/PX-4885,$(1))
828 $(call Image/Build/Profile/RT5350F-OLINUXINO,$(1))
829 $(call Image/Build/Profile/RT5350F-OLINUXINO-EVB,$(1))
830 $(call Image/Build/Profile/RTG32B1,$(1))
831 $(call Image/Build/Profile/RTN10PLUS,$(1))
832 $(call Image/Build/Profile/RT-N13U,$(1))
833 $(call Image/Build/Profile/RUT5XX,$(1))
834 $(call Image/Build/Profile/SL-R7205,$(1))
835 $(call Image/Build/Profile/UR-326N4G,$(1))
836 $(call Image/Build/Profile/V22RW-2X2,$(1))
837 $(call Image/Build/Profile/VOCORE,$(1))
838 $(call Image/Build/Profile/W150M,$(1))
839 $(call Image/Build/Profile/W306R_V20,$(1))
840 $(call Image/Build/Profile/W502U,$(1))
841 $(call Image/Build/Profile/WCR150GN,$(1))
842 $(call Image/Build/Profile/WHRG300N,$(1))
843 $(call Image/Build/Profile/WIZARD8800,$(1))
844 $(call Image/Build/Profile/WIZFI630A,$(1))
845 $(call Image/Build/Profile/WL-330N,$(1))
846 $(call Image/Build/Profile/WL-330N3G,$(1))
847 $(call Image/Build/Profile/WL-341V3,$(1))
848 $(call Image/Build/Profile/WL-351,$(1))
849 $(call Image/Build/Profile/WNCE2001,$(1))
850 $(call Image/Build/Profile/WR512-3GN,$(1))
851 $(call Image/Build/Profile/WR6202,$(1))
852 $(call Image/Build/Profile/WT1520,$(1))
853 $(call Image/Build/Profile/X5,$(1))
854 $(call Image/Build/Profile/X8,$(1))
855 $(call Image/Build/Profile/XDXRN502J,$(1))
856 $(call Image/Build/Profile/MZK-DP150N,$(1))
857
858 endef
859 endif
860
861
862
863 #
864 # RT3662/RT3883 Profiles
865 #
866
867 # $(1) = squashfs/initramfs
868 # $(2) = lowercase board name
869 # $(3) = dts file
870 # $(4) = kernel size
871 # $(5) = rootfs size
872 # $(6) = signature
873 # $(7) = model
874 # $(8) = flash address
875 # $(9) = start address
876 define BuildFirmware/EdimaxCombined/squashfs
877 $(call PatchKernelLzmaDtb,$(2),$(3))
878 $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).bin.uImage)
879 if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.uImage"` -gt `expr $(4) - 20` ]; then \
880 echo "Warning: $(KDIR)/vmlinux-$(2).bin.uImage is too big" >&2; \
881 exit 1; \
882 else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
883 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
884 exit 1; \
885 else \
886 ( dd if=$(KDIR)/vmlinux-$(2).bin.uImage bs=`expr $(4) - 20` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.uImage.combined ; \
887 fi ; fi
888 mkedimaximg -i "$(KDIR)/vmlinux-$(2).bin.uImage.combined" \
889 -o $(call imgname,$(1),$(2)).bin \
890 -s $(6) -m $(7) -f $(8) -S $(9)
891 endef
892
893 Image/Build/Profile/CYSWR1100=$(call BuildFirmware/Seama/$(1),$(1),cy-swr1100,CY-SWR1100,wrgnd10_samsung_ss815,$(ralink_default_fw_size_8M))
894
895 Image/Build/Profile/DIR645=$(call BuildFirmware/Seama/$(1),$(1),dir-645,DIR-645,wrgn39_dlob.hans_dir645,$(ralink_default_fw_size_8M))
896
897 hpm_mtd_size=16449536
898 Image/Build/Profile/HPM=$(call BuildFirmware/CustomFlash/$(1),$(1),hpm,HPM,$(hpm_mtd_size))
899
900 define BuildFirmware/RTN56U/squashfs
901 $(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RT-N56U)
902 -mkrtn56uimg -s $(call sysupname,$(1),rt-n56u)
903 -cp $(call sysupname,$(1),rt-n56u) $(call imgname,$(1),rt-n56u)-factory.bin
904 -mkrtn56uimg -f $(call imgname,$(1),rt-n56u)-factory.bin
905 endef
906 Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RT-N56U)
907
908 Image/Build/Profile/TEW691GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-691gr,TEW-691GR,0x026910)
909
910 Image/Build/Profile/TEW692GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-692gr,TEW-692GR,0x026920)
911
912 kernel_size_BR6475ND:=2097152
913 rootfs_size_BR6475ND:=5832704
914 Image/Build/Profile/BR6475ND=$(call BuildFirmware/EdimaxCombined/$(1),$(1),br-6475nd,BR-6475ND,$(kernel_size_BR6475ND),$(rootfs_size_BR6475ND),CSYS,RN54,0x70000,0x01100000)
915
916 ifeq ($(SUBTARGET),rt3883)
917 define Image/Build/Profile/Default
918 $(call Image/Build/Profile/CYSWR1100,$(1))
919 $(call Image/Build/Profile/DIR645,$(1))
920 $(call Image/Build/Profile/HPM,$(1))
921 $(call Image/Build/Profile/RTN56U,$(1))
922 $(call Image/Build/Profile/BR6475ND,$(1))
923 $(call Image/Build/Profile/TEW691GR,$(1))
924 $(call Image/Build/Profile/TEW692GR,$(1))
925 endef
926 endif
927
928 #
929 # MT7620A Profiles
930 #
931
932 # $(1): (ignored)
933 # $(2): lowercase board name
934 # $(3): uppercase board name (must match DTS filename w/o extension)
935 # $(4): erase block size
936 # $(5): hardware id for mkdniimg
937 # $(6): maximum image size
938 define BuildFirmware/Netgear/squashfs
939 $(call PatchKernelLzmaDtb,$(2),$(3))
940 # Pad kernel to eraseblock boundary, minus 2 uImage headers (=128 bytes):
941 # bs = (eraseblock * (1 + (128 + kernelsize)/eraseblock)) - 128
942 dd if=$(KDIR)/vmlinux-$(2).bin.lzma \
943 of=$(KDIR)/vmlinux-$(2).bin.lzma.tmp \
944 bs=`expr \( $(4) \* \( 1 + \( 128 + \`wc -c < $(KDIR)/vmlinux-$(2).bin.lzma\` \) / $(4) \) \) - 128` \
945 count=1 conv=sync
946
947 $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma.tmp,$(KDIR)/vmlinux-$(2).uImage)
948 cat ex2700-fakeroot.uImage >> $(KDIR)/vmlinux-$(2).uImage
949 $(call MkImageSysupgrade/squashfs,squashfs,$(2),$(6))
950
951 $(STAGING_DIR_HOST)/bin/mkdniimg \
952 -B $(3) -H $(5) -v OpenWrt \
953 -i $(call imgname,squashfs,$(2))-sysupgrade.bin \
954 -o $(call imgname,squashfs,$(2))-factory.bin
955 endef
956
957 Image/Build/Profile/E1700=$(call BuildFirmware/UMedia/$(1),$(1),e1700,E1700,0x013326)
958 ex2700_mtd_size=3866624
959 Image/Build/Profile/EX2700=$(call BuildFirmware/Netgear/$(1),$(1),ex2700,EX2700,65536,29764623+4+0+32+2x2+0,$(ex2700_mtd_size))
960 Image/Build/Profile/MT7620a=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a,MT7620a)
961 Image/Build/Profile/MT7620a_MT7610e=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7610e,MT7620a_MT7610e)
962 Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7530,MT7620a_MT7530)
963 Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
964 br100_mtd_size=8126464
965 Image/Build/Profile/AI-BR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AI-BR100,$(br100_mtd_size),Ai-BR)
966 Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp-n53,RP-N53)
967 whr_300hp2_mtd_size=7012352
968 Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
969 Image/Build/Profile/WHR600D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-600d,WHR-600D,$(whr_300hp2_mtd_size))
970 whr_1166d_mtd_size=15400960
971 Image/Build/Profile/WHR1166D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166d_mtd_size))
972 dlink810l_mtd_size=6881280
973 Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n,CF-WR800N)
974 Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
975 na930_mtd_size=20971520
976 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
977 Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
978 Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
979 Image/Build/Profile/HC5661=$(call BuildFirmware/Default16M/$(1),$(1),hc5661,HC5661)
980 Image/Build/Profile/HC5761=$(call BuildFirmware/Default16M/$(1),$(1),hc5761,HC5761)
981 Image/Build/Profile/HC5861=$(call BuildFirmware/Default16M/$(1),$(1),hc5861,HC5861)
982 Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
983 Image/Build/Profile/PSG1208=$(call BuildFirmware/Default8M/$(1),$(1),psg1208,PSG1208)
984 Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
985 Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),y1s,Y1S)
986 Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
987 Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2)
988 Image/Build/Profile/WMR-300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR-300)
989 Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
990 Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
991 Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020)
992 Image/Build/Profile/MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),miwifi-mini,MIWIFI-MINI)
993 Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7)
994 Image/Build/Profile/YOUKU-YK1=$(call BuildFirmware/Default16M/$(1),$(1),youku-yk1,YOUKU-YK1)
995 Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
996 Image/Build/Profile/ZBT-WE826=$(call BuildFirmware/Default16M/$(1),$(1),zbt-we826,ZBT-WE826)
997 Image/Build/Profile/ZBT-WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wr8305rt,ZBT-WR8305RT)
998 Image/Build/Profile/ArcherC20i=$(call BuildFirmware/Tplink/$(1),$(1),ArcherC20i,ArcherC20i)
999 microwrt_mtd_size=16515072
1000 Image/Build/Profile/MicroWRT=$(call BuildFirmware/CustomFlash/$(1),$(1),microwrt,MicroWRT,$(microwrt_mtd_size))
1001 Image/Build/Profile/TINY-AC=$(call BuildFirmware/Default8M/$(1),$(1),tiny-ac,TINY-AC)
1002
1003
1004 ifeq ($(SUBTARGET),mt7620)
1005 define Image/Build/Profile/Default
1006 $(call Image/Build/Profile/E1700,$(1))
1007 $(call Image/Build/Profile/EX2700,$(1))
1008 $(call Image/Build/Profile/MT7620a,$(1))
1009 $(call Image/Build/Profile/MT7620a_MT7610e,$(1))
1010 $(call Image/Build/Profile/MT7620a_MT7530,$(1))
1011 $(call Image/Build/Profile/MT7620a_V22SG,$(1))
1012 $(call Image/Build/Profile/AI-BR100,$(1))
1013 $(call Image/Build/Profile/CF-WR800N,$(1))
1014 $(call Image/Build/Profile/RP-N53,$(1))
1015 $(call Image/Build/Profile/DIR-810L,$(1))
1016 $(call Image/Build/Profile/WHR300HP2,$(1))
1017 $(call Image/Build/Profile/WHR600D,$(1))
1018 $(call Image/Build/Profile/WHR1166D,$(1))
1019 $(call Image/Build/Profile/DB-WRT01,$(1))
1020 $(call Image/Build/Profile/MZK-750DHP,$(1))
1021 $(call Image/Build/Profile/NA930,$(1))
1022 $(call Image/Build/Profile/HC5661,$(1))
1023 $(call Image/Build/Profile/HC5761,$(1))
1024 $(call Image/Build/Profile/HC5861,$(1))
1025 $(call Image/Build/Profile/OY-0001,$(1))
1026 $(call Image/Build/Profile/PSG1208,$(1))
1027 $(call Image/Build/Profile/Y1,$(1))
1028 $(call Image/Build/Profile/Y1S,$(1))
1029 $(call Image/Build/Profile/MLW221,$(1))
1030 $(call Image/Build/Profile/MLWG2,$(1))
1031 $(call Image/Build/Profile/WMR-300,$(1))
1032 $(call Image/Build/Profile/RT-N14U,$(1))
1033 $(call Image/Build/Profile/WRTNODE,$(1))
1034 $(call Image/Build/Profile/WT3020,$(1))
1035 $(call Image/Build/Profile/MIWIFI-MINI,$(1))
1036 $(call Image/Build/Profile/ZTE-Q7,$(1))
1037 $(call Image/Build/Profile/YOUKU-YK1,$(1))
1038 $(call Image/Build/Profile/ZBT-WA05,$(1))
1039 $(call Image/Build/Profile/ZBT-WE826,$(1))
1040 $(call Image/Build/Profile/ZBT-WR8305RT,$(1))
1041 $(call Image/Build/Profile/ArcherC20i,$(1))
1042 $(call Image/Build/Profile/MicroWRT,$(1))
1043 $(call Image/Build/Profile/TINY-AC,$(1))
1044 endef
1045 endif
1046
1047 #
1048 # MT7621 Profiles
1049 #
1050
1051 ifeq ($(SUBTARGET),mt7621)
1052 TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt pbr-m1 re6500 sap-g3200u3 ubnt-erx witi wf-2881 zbt-wg2626
1053 endif
1054
1055 define Device/mt7621
1056 DTS := MT7621
1057 IMAGE_SIZE := $(ralink_default_fw_size_4M)
1058 endef
1059
1060 define Device/wsr-600
1061 DTS := WSR-600
1062 IMAGE_SIZE := $(ralink_default_fw_size_16M)
1063 endef
1064
1065 define Device/re6500
1066 DTS := RE6500
1067 endef
1068
1069 define Device/wsr-1166
1070 DTS := WSR-1166
1071 IMAGE/sysupgrade.bin := trx | pad-rootfs
1072 IMAGE_SIZE := $(ralink_default_fw_size_16M)
1073 endef
1074
1075 define Device/dir-860l-b1
1076 DTS := DIR-860L-B1
1077 IMAGES += factory.bin
1078 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
1079 IMAGE/sysupgrade.bin := \
1080 append-kernel | pad-offset 65536 64 | append-rootfs | \
1081 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
1082 pad-rootfs | check-size $$$$(IMAGE_SIZE)
1083 IMAGE/factory.bin := \
1084 append-kernel | pad-offset 65536 64 | append-rootfs | pad-rootfs -x 64 | \
1085 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
1086 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
1087 check-size $$$$(IMAGE_SIZE)
1088 endef
1089
1090 define Device/firewrt
1091 DTS := FIREWRT
1092 IMAGE_SIZE := $(ralink_default_fw_size_16M)
1093 endef
1094
1095 define Device/pbr-m1
1096 DTS := PBR-M1
1097 IMAGE_SIZE := $(ralink_default_fw_size_16M)
1098 endef
1099
1100 define Device/sap-g3200u3
1101 DTS := SAP-G3200U3
1102 endef
1103
1104 define Device/witi
1105 DTS := WITI
1106 IMAGE_SIZE := $(ralink_default_fw_size_16M)
1107 endef
1108
1109 define Device/zbt-wg2626
1110 DTS := ZBT-WG2626
1111 IMAGE_SIZE := $(ralink_default_fw_size_16M)
1112 endef
1113
1114 define Device/wf-2881
1115 DTS := WF-2881
1116 BLOCKSIZE := 128KiB
1117 PAGESIZE := 2048
1118 FILESYSTEMS := squashfs
1119 IMAGE_SIZE := 132382720
1120 KERNEL := $(KERNEL_DTB) | pad-offset 131072 64 | uImage lzma
1121 IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
1122 endef
1123
1124 define Device/ubnt-erx
1125 DTS := UBNT-ERX
1126 FILESYSTEMS := squashfs
1127 KERNEL_SIZE := 3145728
1128 KERNEL := $(KERNEL_DTB) | uImage lzma
1129 IMAGES := sysupgrade.tar $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),factory-initramfs.tar)
1130 IMAGE/factory-initramfs.tar := ubnt-erx-factory-compat | \
1131 ubnt-erx-factory-kernel | \
1132 ubnt-erx-factory-rootfs | \
1133 ubnt-erx-factory-version | \
1134 ubnt-erx-factory-check-size $$(KERNEL_SIZE)
1135 IMAGE/sysupgrade.tar := sysupgrade-nand
1136 endef
1137
1138 #
1139 # MT7628 Profiles
1140 #
1141
1142 Image/Build/Profile/MT7628=$(call BuildFirmware/Default4M/$(1),$(1),mt7628,MT7628)
1143 Image/Build/Profile/WRTNODE2P=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode2p,WRTNODE2P)
1144
1145 ifeq ($(SUBTARGET),mt7628)
1146 define Image/Build/Profile/Default
1147 $(call Image/Build/Profile/MT7628,$(1))
1148 $(call Image/Build/Profile/WRTNODE2P,$(1))
1149 endef
1150 endif
1151
1152
1153 #
1154 # MT7688 Profiles
1155 #
1156
1157 Image/Build/Profile/LinkIt7688=$(call BuildFirmware/Default32M/$(1),$(1),LinkIt7688,LINKIT7688)
1158 Image/Build/Profile/WRTNODE2R=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode2r,WRTNODE2R)
1159
1160 ifeq ($(SUBTARGET),mt7688)
1161 define Image/Build/Profile/Default
1162 $(call Image/Build/Profile/LinkIt7688,$(1))
1163 $(call Image/Build/Profile/WRTNODE2R,$(1))
1164 endef
1165 endif
1166
1167
1168 ifndef TARGET_DEVICES
1169 #
1170 # Generic Targets - only needed for legacy image building code
1171 #
1172 define Image/BuildKernel
1173 cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf
1174 cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin
1175 $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
1176 $(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
1177 cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin
1178 endef
1179
1180 define Image/BuildKernel/Initramfs
1181 cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(VMLINUX)-initramfs.elf
1182 cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(VMLINUX)-initramfs.bin
1183 $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
1184 $(call MkImage,lzma,$(KDIR)/vmlinux-initramfs.bin.lzma,$(KDIR)/uImage-initramfs.lzma)
1185 cp $(KDIR)/uImage-initramfs.lzma $(BIN_DIR)/$(UIMAGE)-initramfs.bin
1186 $(call Image/Build/Initramfs)
1187 endef
1188
1189 define Image/Build
1190 $(call Image/Build/$(1))
1191 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
1192 $(call Image/Build/Profile/$(PROFILE),$(1))
1193 endef
1194 endif
1195
1196 ifeq ($(SUBTARGET),mt7621)
1197 define Image/Prepare
1198 #define Build/Compile
1199 rm -rf $(KDIR)/relocate
1200 $(CP) ../../generic/image/relocate $(KDIR)
1201 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
1202 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
1203 endef
1204 endif
1205
1206 $(eval $(call BuildImage))