f1a13ac1dd335b51cf7b22efc96a9f17a791aa85
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / 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)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
12 endef
13
14 define rootfs_align
15 $(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs-%,0x4,$(1))))
16 endef
17
18 define sysupname
19 $(call imgname,$(1),$(2))-sysupgrade.bin
20 endef
21
22 define factoryname
23 $(call imgname,$(1),$(2))-factory.bin
24 endef
25
26 COMMA:=,
27
28 define mkcmdline
29 $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
30 endef
31
32 SINGLE_PROFILES:=
33
34 define SingleProfile
35 define Image/Build/Profile/$(3)
36 $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12))
37 endef
38 SINGLE_PROFILES += $(3)
39 endef
40
41 define MultiProfile
42 define Image/Build/Profile/$(1)
43 $(foreach p,$(2),
44 $$(call Image/Build/Profile/$p,$$(1))
45 )
46 endef
47 endef
48
49 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
50
51 KDIR_TMP:=$(KDIR)/tmp
52 VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
53 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
54 fs_squash:=squashfs-only
55 fs_64k:=64k
56 fs_64kraw:=64kraw
57 fs_128k:=128k
58 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
59 fs_squash:=initramfs
60 fs_64k:=initramfs
61 fs_64kraw:=initramfs
62 fs_128k:=initramfs
63 VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
64 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs
65 endif
66
67 define CompressLzma
68 $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2)
69 endef
70
71 define PatchKernelLzma
72 cp $(KDIR)/vmlinux $(KDIR_TMP)/vmlinux-$(1)
73 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux-$(1) "$(strip $(2))"
74 $(call CompressLzma,$(KDIR_TMP)/vmlinux-$(1),$(KDIR_TMP)/vmlinux-$(1).bin.lzma)
75 endef
76
77 define PatchKernelGzip
78 cp $(KDIR)/vmlinux $(KDIR_TMP)/vmlinux-$(1)
79 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux-$(1) "$(strip $(2))"
80 gzip -9 -c $(KDIR_TMP)/vmlinux-$(1) > $(KDIR_TMP)/vmlinux-$(1).bin.gz
81 endef
82
83 define MkuImage
84 mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
85 -e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
86 -d $(3) $(4)
87 endef
88
89 define MkuImageLzma
90 $(call PatchKernelLzma,$(1),$(2))
91 $(call MkuImage,lzma,,$(KDIR_TMP)/vmlinux-$(1).bin.lzma,$(KDIR_TMP)/vmlinux-$(1).uImage)
92 endef
93
94 define MkuImageLzma/initramfs
95 $(call PatchKernelLzma,$(1),$(2))
96 $(call MkuImage,lzma,,$(KDIR_TMP)/vmlinux-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin)
97 endef
98
99 define MkuImageGzip
100 $(call PatchKernelGzip,$(1),$(2))
101 $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage)
102 endef
103
104 define MkuImageGzip/initramfs
105 $(call PatchKernelGzip,$(1),$(2))
106 $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin)
107 endef
108
109 define MkuImageOKLI
110 $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli)
111 endef
112
113 define CatFiles
114 if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
115 echo "Warning: $(1) is too big"; \
116 else if [ `stat -c%s $(3)` -gt $(4) ]; then \
117 echo "Warning: $(3) is too big"; \
118 else \
119 ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
120 fi; fi
121 endef
122
123 define Sysupgrade/KR
124 $(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5)))
125 endef
126
127 define Sysupgrade/KRuImage
128 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)))
129 endef
130
131 define Sysupgrade/RKuImage
132 $(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2)))
133 endef
134
135 define Image/BuildLoader
136 -rm -rf $(KDIR)/lzma-loader
137 $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
138 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
139 LOADER_DATA="$(KDIR)/vmlinux.bin.lzma" BOARD="$(1)" \
140 compile loader.$(2)
141 endef
142
143 define Image/BuildLoaderAlone
144 -rm -rf $(KDIR)/lzma-loader
145 $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
146 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
147 BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
148 compile loader.$(2)
149 endef
150
151 define Build/Clean
152 $(LOADER_MAKE) clean
153 endef
154
155 alfa_ap96_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13312k(rootfs),2048k(kernel),512k(caldata)ro,15360k@0x80000(firmware)
156 alfa_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
157 all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),1024k(kernel),5248k(rootfs),1536k(failsafe),64k(art),6272k@0x50000(firmware)
158 ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k@0x40000(firmware)
159 ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k@0x10000(firmware)
160 ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware)
161 ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
162 ap136_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(mib0),64k(art)ro,7744k@0x50000(firmware)
163 cameo7240_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,960k(kernel),2752k(rootfs),64k(mac)ro,64k(art)ro,3712k@0x40000(firmware)
164 cameo913x_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,960k(kernel),2880k(rootfs),64k(art)ro,3840k@0x30000(firmware)
165 cameo933x_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,896k(kernel),2752k(rootfs),3648k@0x70000(firmware)
166 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
167 dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware)
168 ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1024k(kernel),2688k(rootfs),64k(art),3712k@0x50000(firmware)
169 pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
170 planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,960k(kernel),6784k(rootfs),128k(art)ro,7744k@0x50000(firmware)
171 ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1024k(kernel),6528k(rootfs),256k(cfg)ro,64k(EEPROM)ro,7552k@0x50000(firmware)
172 whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,960k(kernel),2816k(rootfs),64k(art)ro,3712k@0x40000(firmware)
173 wndr3700_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kernel),6656k(rootfs),64k(art)ro,7680k@0x70000(firmware)
174 wndr3700v2_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kernel),14848k(rootfs),64k(art)ro,15872k@0x70000(firmware)
175 zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware)
176
177 define Image/BuildKernel
178 cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
179 cp $(KDIR)/vmlinux $(VMLINUX).bin
180 dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
181 dd if=$(KDIR)/vmlinux.bin.gz of=$(VMLINUX).gz bs=65536 conv=sync
182 $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
183 $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
184 -mkdir -p $(KDIR_TMP)
185 $(call Image/Build/Initramfs)
186 endef
187
188 define Image/Build/WRT400N
189 $(call MkuImageLzma,$(2),$(3))
190 $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
191 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
192 wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
193 fi
194 endef
195
196 define Image/Build/DIR825B1
197 $(call MkuImageLzma,$(2),$(3) $(dir825b1_mtdlayout))
198 $(call Sysupgrade/KRuImage,$(1),$(2),1048576,5308416)
199 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
200 ( \
201 dd if=$(call sysupname,$(1),$(2)); \
202 echo -n "$(4)"; \
203 ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
204 if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
205 echo "Warning: $(call sysupname,$(1),$(2)) is too big"; \
206 else \
207 ( \
208 dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
209 echo -n "$(5)"; \
210 ) > $(call factoryname,$(1),$(2)); \
211 fi; \
212 fi
213 endef
214
215 define Image/Build/WZRHPG30XNH
216 $(call MkuImageLzma,$(2),$(3))
217 $(call Sysupgrade/KRuImage,$(1),$(2),1048576,31850496)
218 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
219 ( \
220 echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
221 dd if=$(call sysupname,$(1),$(2)); \
222 ) > $(call imgname,$(1),$(2))-tftp.bin; \
223 buffalo-enc -p $(4) -v 1.99 \
224 -i $(call sysupname,$(1),$(2)) \
225 -o $(KDIR_TMP)/$(2).enc; \
226 buffalo-tag -b $(4) -p $(4) -a ath -v 1.99 -m 1.01 -l mlang8 \
227 -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
228 -i $(KDIR_TMP)/$(2).enc \
229 -o $(call factoryname,$(1),$(2)); \
230 fi
231 endef
232
233 define Image/Build/WHRHPG300N
234 $(call MkuImageLzma,$(2),$(3) $(4))
235 $(call Sysupgrade/KRuImage,$(1),$(2),983040,2883584)
236 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
237 ( \
238 echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
239 dd if=$(call sysupname,$(1),$(2)); \
240 ) > $(call imgname,$(1),$(2))-tftp.bin; \
241 buffalo-enc -p $(5) -v 1.99 \
242 -i $(call sysupname,$(1),$(2)) \
243 -o $(KDIR_TMP)/$(2).enc; \
244 buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
245 -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
246 -i $(KDIR_TMP)/$(2).enc \
247 -o $(call factoryname,$(1),$(2)); \
248 fi
249 endef
250
251 define Image/Build/WHRHPG300N/initramfs
252 $(call MkuImageLzma/initramfs,$(2),$(3) $(4))
253 endef
254
255 define Image/Build/Cameo
256 $(call MkuImageLzma,$(2),$(3) $(4))
257 $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
258 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
259 ( \
260 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage bs=$(5) conv=sync; \
261 dd if=$(KDIR)/root.$(1) bs=$(6) conv=sync; \
262 echo -n $(7); \
263 ) > $(call factoryname,$(1),$(2)); \
264 fi
265 endef
266
267 define Image/Build/CameoHornet
268 $(call MkuImageLzma,$(2),$(3) $(4))
269 $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
270 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
271 mkcameofw -M HORNET -R "DEF" -S $(7) -V "1.99" \
272 -K $(5) -I $$$$(($(5)+$(6))) \
273 -k $(KDIR_TMP)/vmlinux-$(2).uImage \
274 -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
275 -o $(call factoryname,$(1),$(2)); \
276 fi
277 endef
278
279 define Image/Build/Cameo913x
280 $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo913x_mtdlayout),983040,2949120,$(4))
281 endef
282
283 define Image/Build/Cameo913x/initramfs
284 $(call MkuImageLzma/initramfs,$(2),$(3) $(cameo913x_mtdlayout))
285 endef
286
287 define Image/Build/Cameo7240
288 $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo7240_mtdlayout),983040,2818048,$(4))
289 endef
290
291 define Image/Build/Cameo7240/initramfs
292 $(call MkuImageLzma/initramfs,$(2),$(3) $(cameo7240_mtdlayout))
293 endef
294
295 define Image/Build/Cameo933x
296 $(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo933x_mtdlayout),917504,2818048,$(4))
297 endef
298
299 define Image/Build/Cameo933x/initramfs
300 $(call MkuImageLzma/initramfs,$(2),$(3) $(cameo933x_mtdlayout))
301 endef
302
303 define Image/Build/Ath
304 $(call Sysupgrade/$(7),$(1),$(2),$(5),$(6))
305 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
306 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
307 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
308 dd if=$(KDIR)/root.$(1) \
309 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
310 fi
311 endef
312
313 define Image/Build/AthGzip
314 $(call MkuImageGzip,$(2),$(3) $(4))
315 $(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
316 endef
317
318 define Image/Build/AthGzip/initramfs
319 $(call MkuImageGzip/initramfs,$(2),$(3) $(4))
320 endef
321
322 define Image/Build/AthLzma
323 $(call MkuImageLzma,$(2),$(3) $(4))
324 $(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
325 endef
326
327 define Image/Build/AthLzma/initramfs
328 $(call MkuImageLzma/initramfs,$(2),$(3) $(4))
329 endef
330
331 define Image/Build/PB4X
332 $(call PatchKernelLzma,$(2),$(3))
333 dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
334 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
335 dd if=$(KDIR)/root.$(1) \
336 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
337 -sh $(TOPDIR)/scripts/combined-image.sh \
338 "$(call imgname,kernel,$(2)).bin" \
339 "$(call imgname,$(1),$(2)-rootfs).bin" \
340 $(call sysupname,$(1),$(2))
341 endef
342
343
344 define Image/Build/MyLoader
345 $(call PatchKernelLzma,$(2),$(3))
346 -$(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) \
347 -p0x030000:0xe0000:al:0x80060000:kernel:$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
348 -p0x110000:0:::rootfs:$(KDIR)/root.$(1) \
349 $(call imgname,$(1),$(2))-$(5)-factory.img
350 endef
351
352 define Image/Build/UBNTXM
353 $(call MkuImageLzma,$(2),$(3) $(ubntxm_mtdlayout))
354 $(call Sysupgrade/KRuImage,$(1),$(2),1048576,6684672)
355 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage of=$(KDIR_TMP)/vmlinux-$(2).uImage.bin bs=1024k conv=sync
356 -$(STAGING_DIR_HOST)/bin/mkfwimage \
357 -B $(4) -v $(5).$(6).v6.0.0-OpenWrt-$(REVISION) \
358 -k $(KDIR_TMP)/vmlinux-$(2).uImage.bin \
359 -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
360 -o $(call factoryname,$(1),$(2))
361 endef
362
363 define Image/Build/UBNT
364 $(call PatchKernelLzma,$(2),$(3))
365 dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma of=$(KDIR_TMP)/vmlinux-$(2).lzma bs=64k conv=sync
366 -$(STAGING_DIR_HOST)/bin/mkfwimage \
367 -B $(4) -v $(5).$(6).OpenWrt.$(REVISION) \
368 -k $(KDIR_TMP)/vmlinux-$(2).lzma \
369 -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
370 -o $(call factoryname,$(1),$(2))
371 -sh $(TOPDIR)/scripts/combined-image.sh \
372 "$(KDIR_TMP)/vmlinux-$(2).lzma" \
373 "$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)" \
374 $(call sysupname,$(1),$(2))
375 endef
376
377 define Image/Build/Planex/loader
378 $(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
379 endef
380
381 define Image/Build/Planex
382 [ -e "$(KDIR)/loader-$(2).gz" ]
383 $(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
384 $(call MkuImageOKLI,$(2))
385 ( \
386 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage bs=8k count=1 conv=sync; \
387 dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
388 ) > $(KDIR_TMP)/kernel-$(2).bin
389 $(call Sysupgrade/KR,$(1),$(KDIR_TMP)/kernel-$(2).bin,983040,6815744,$(2))
390 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
391 $(STAGING_DIR_HOST)/bin/mkplanexfw \
392 -B $(2) \
393 -v 2.00.00 \
394 -i $(call sysupname,$(1),$(2)) \
395 -o $(call factoryname,$(1),$(2)); \
396 fi
397 endef
398
399 define Image/Build/ALFA
400 $(call MkuImageLzma,$(2),$(3) $(4))
401 $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
402 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
403 rm -rf $(KDIR)/$(1); \
404 mkdir -p $(KDIR)/$(1); \
405 cd $(KDIR)/$(1); \
406 cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
407 cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
408 $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) $(7) $(8); \
409 ( \
410 echo WRM7222C | dd bs=32 count=1 conv=sync; \
411 echo -ne '\xfe'; \
412 ) >> $(call factoryname,$(1),$(2)); \
413 fi
414 endef
415
416 define Image/Build/ALFA/initramfs
417 $(call MkuImageLzma/initramfs,$(2),$(3) $(4))
418 endef
419
420 define Image/Build/TPLINKOLD/loader
421 $(call Image/BuildLoaderAlone,$(1),gz,$(2),0x22000,0)
422 endef
423
424 define Image/Build/TPLINKOLD
425 [ -e "$(KDIR)/loader-$(2).gz" ]
426 $(call MkuImageOKLI,$(2))
427 ( \
428 dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
429 dd if=$(KDIR_TMP)/vmlinux-$(2).okli conv=sync; \
430 ) > $(KDIR_TMP)/kernel-$(2).bin
431 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
432 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
433 -k $(KDIR_TMP)/kernel-$(2).bin \
434 -r $(KDIR)/root.$(1) \
435 -o $(call factoryname,$(1),$(2))
436 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
437 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
438 -k $(KDIR_TMP)/kernel-$(2).bin \
439 -r $(KDIR)/root.$(1) \
440 -o $(call sysupname,$(1),$(2))
441 endef
442
443 define Image/Build/TPLINKOLD/initramfs
444 $(call Image/BuildLoader,$(2),gz,$(3),0x80060000)
445 -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
446 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
447 -k $(KDIR)/loader-$(2).gz \
448 -o $(call imgname,$(1),$(2))-uImage.bin
449 endef
450
451 define Image/Build/TPLINK/loader
452 $(call Image/BuildLoaderAlone,$(1),gz,$(2),0x22000,0)
453 endef
454
455 define Image/Build/TPLINK
456 [ -e "$(KDIR)/loader-$(2).gz" ]
457 $(call MkuImageOKLI,$(2))
458 ( \
459 dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
460 dd if=$(KDIR_TMP)/vmlinux-$(2).okli conv=sync; \
461 ) > $(KDIR_TMP)/kernel-$(2).bin
462 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
463 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
464 -k $(KDIR_TMP)/kernel-$(2).bin \
465 -r $(KDIR)/root.$(1) \
466 -a $(call rootfs_align,$(1)) -j \
467 -o $(call factoryname,$(1),$(2))
468 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
469 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
470 -k $(KDIR_TMP)/kernel-$(2).bin \
471 -r $(KDIR)/root.$(1) \
472 -a $(call rootfs_align,$(1)) -j \
473 -o $(call sysupname,$(1),$(2))
474 endef
475
476 define Image/Build/TPLINK/initramfs
477 $(call Image/BuildLoader,$(2),gz,$(3),0x80060000)
478 -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
479 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
480 -k $(KDIR)/loader-$(2).gz \
481 -o $(call imgname,$(1),$(2))-uImage.bin
482 endef
483
484 define Image/Build/TPLINK-LZMA
485 $(call PatchKernelLzma,$(2),$(3))
486 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
487 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \
488 -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
489 -r $(KDIR)/root.$(1) \
490 -a $(call rootfs_align,$(1)) -j \
491 -o $(call factoryname,$(1),$(2))
492 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
493 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
494 -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
495 -r $(KDIR)/root.$(1) \
496 -a $(call rootfs_align,$(1)) -j \
497 -o $(call sysupname,$(1),$(2))
498 endef
499
500 define Image/Build/TPLINK-LZMA/initramfs
501 $(call PatchKernelLzma,$(2),$(3))
502 -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
503 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
504 -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
505 -o $(call imgname,$(1),$(2))-uImage.bin
506 endef
507
508 define Image/Build/CyberTAN
509 $(call MkuImageGzip,$(2),$(3))
510 $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
511 -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
512 -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(4) \
513 -i $(KDIR)/image.tmp \
514 -o $(call sysupname,$(1),$(2))
515 -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(4) -g \
516 -i $(KDIR)/image.tmp \
517 -o $(call factoryname,$(1),$(2))
518 rm $(KDIR)/image.tmp
519 endef
520
521 define Image/Build/Netgear/Build_uImage
522 $(call MkuImageLzma,$(1),$(2) $(3))
523 -rm -rf $(KDIR)/$(1)
524 mkdir -p $(KDIR)/$(1)/image
525 $(STAGING_DIR_HOST)/bin/wndr3700 \
526 $(KDIR_TMP)/vmlinux-$(1).uImage \
527 $(KDIR)/$(1)/image/uImage \
528 $(4)
529 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
530 $(KDIR)/$(1) $(KDIR_TMP)/vmlinux-$(1).uImage.squashfs.tmp \
531 -nopad -noappend -root-owned -be
532 -rm -rf $(KDIR)/$(1)
533 mkimage -A mips -O linux -T filesystem -C none \
534 -a 0xbf070000 -e 0xbf070000 \
535 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
536 -d $(KDIR_TMP)/vmlinux-$(1).uImage.squashfs.tmp \
537 $(KDIR_TMP)/vmlinux-$(1).uImage.squashfs.tmp2
538 $(STAGING_DIR_HOST)/bin/wndr3700 \
539 $(KDIR_TMP)/vmlinux-$(1).uImage.squashfs.tmp2 \
540 $(KDIR_TMP)/vmlinux-$(1).uImage.squashfs \
541 $(4)
542 -rm -f $(KDIR_TMP)/vmlinux-$(1).uImage.squashfs.tmp*
543 endef
544
545 define Image/Build/Netgear/Estimate_uImage
546 $(call Image/Build/Netgear/Build_uImage,$(1)_est,$(2),$(3),$(4))
547 ( \
548 set -e; \
549 kk=`echo '$(3)' | sed -e 's/.*[:,]\([0-9]*\)k(kernel).*/\1/'`; \
550 rk=`echo '$(3)' | sed -e 's/.*[:,]\([0-9]*\)k(rootfs).*/\1/'`; \
551 let 'tk = kk + rk'; \
552 s=`stat -c'%s' '$(KDIR_TMP)/vmlinux-$(1)_est.uImage.squashfs'`; \
553 c=`echo '$(3)' | wc -c`; \
554 let 'kk = (((s + c) / (64 * 1024) + 1) * 64)'; \
555 let 'rk = tk - kk'; \
556 echo '$(3)' | sed -e "s/[0-9]*k(kernel)/$$$${kk}k(kernel)/" \
557 -e "s/[0-9]*k(rootfs)/$$$${rk}k(rootfs)/" > \
558 '$(KDIR_TMP)/$(1)_mtdparts'; \
559 let 'k = kk * 1024'; \
560 echo "$$$${k}" > '$(KDIR_TMP)/$(1)_kernel_maxsize'; \
561 let 'r = rk * 1024'; \
562 echo "$$$${r}" > '$(KDIR_TMP)/$(1)_rootfs_maxsize'; \
563 )
564 -rm -f $(KDIR_TMP)/vmlinux-$(1)_est \
565 $(KDIR_TMP)/vmlinux-$(1)_est.bin.lzma \
566 $(KDIR_TMP)/vmlinux-$(1)_est.uImage \
567 $(KDIR_TMP)/vmlinux-$(1)_est.uImage.squashfs
568 endef
569
570 define Image/Build/Netgear
571 $(call Image/Build/Netgear/Estimate_uImage,$(2),$(3),$(4),$(5))
572 $(call Image/Build/Netgear/Build_uImage,$(2),$(3),`cat $(KDIR_TMP)/$(2)_mtdparts`,$(5))
573 if [ `stat -c%s '$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs'` -gt \
574 `cat '$(KDIR_TMP)/$(2)_kernel_maxsize'` ]; then \
575 echo "$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs is too big" >& 2; \
576 else if [ `stat -c%s '$(KDIR)/root.$(1)'` -gt \
577 `cat '$(KDIR_TMP)/$(2)_rootfs_maxsize'` ]; then \
578 echo "$(KDIR)/root.$(1) is too big" >& 2; \
579 else \
580 ( \
581 set -e; \
582 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs \
583 bs=`cat '$(KDIR_TMP)/$(2)_kernel_maxsize'` conv=sync; \
584 dd if=$(KDIR)/root.$(1) bs=64k; \
585 ) > $(call sysupname,$(1),$(2)); \
586 for r in $(7) ; do \
587 [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \
588 $(STAGING_DIR_HOST)/bin/mkdniimg \
589 -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
590 -i $(call sysupname,$(1),$(2)) \
591 -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \
592 done; \
593 fi; fi
594 endef
595
596 define Image/Build/Netgear/initramfs
597 $(call MkuImageLzma,$(2),$(3) $(4))
598 $(STAGING_DIR_HOST)/bin/wndr3700 \
599 $(KDIR_TMP)/vmlinux-$(2).uImage \
600 $(call imgname,$(1),$(2))-uImage.bin \
601 $(5)
602 endef
603
604 ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh
605 define Image/Build/ZyXEL
606 $(call MkuImageLzma,$(2),$(3))
607 $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
608 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
609 if [ ! -f $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin ]; then \
610 echo "Warning: $(IMG_PREFIX)-$(2)-u-boot.bin not found"; \
611 else \
612 $(STAGING_DIR_HOST)/bin/mkzynfw \
613 -B $(4) \
614 -b $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin \
615 -r $(call sysupname,$(1),$(2)):0x10000 \
616 -o $(call factoryname,$(1),$(2)); \
617 fi; fi
618 endef
619 endif
620
621 define Image/Build/OpenMesh
622 $(call MkuImageLzma,$(2))
623 -sh $(TOPDIR)/scripts/om2p-fwupgradecfg-gen.sh \
624 "$(BUILD_DIR)/om2p-fwupgrade.cfg" \
625 "$(KDIR_TMP)/vmlinux-$(2).uImage" \
626 "$(KDIR)/root.$(1)"
627 -sh $(TOPDIR)/scripts/combined-ext-image.sh \
628 "$(3)" "$(call factoryname,$(1),$(2))" \
629 "$(BUILD_DIR)/om2p-fwupgrade.cfg" "fwupgrade.cfg" \
630 "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
631 "$(KDIR)/root.$(1)" "rootfs"
632 endef
633
634 define Image/Build/Zcomax
635 $(call MkuImageLzma,$(2),$(3))
636 $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
637 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
638 $(STAGING_DIR_HOST)/bin/mkzcfw \
639 -B $(2) \
640 -k $(KDIR_TMP)/vmlinux-$(2).uImage \
641 -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
642 -o $(call imgname,$(1),$(2))-factory.img; \
643 fi
644 endef
645
646 define Image/Build/Zcomax/initramfs
647 $(call MkuImageLzma/initramfs,$(2),$(3))
648 endef
649
650 define Image/Build/Template/initramfs/initramfs
651 $(call Image/Build/$(1)/initramfs,initramfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
652 endef
653
654 define Image/Build/Template/all/squashfs
655 $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
656 endef
657
658 define Image/Build/Template/all/jffs2-64k
659 $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
660 endef
661
662 define Image/Build/Template/all/jffs2-128k
663 $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
664 endef
665
666 define Image/Build/Template/squashfs-only/loader
667 $(call Image/Build/$(1)/loader,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
668 endef
669
670 define Image/Build/Template/squashfs-only/squashfs
671 $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
672 endef
673
674 define Image/Build/Template/64k/loader
675 $(call Image/Build/$(1)/loader,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
676 endef
677
678 define Image/Build/Template/64k/squashfs
679 $(call Image/Build/$(1),squashfs-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
680 endef
681
682 define Image/Build/Template/64k/jffs2-64k
683 $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
684 endef
685
686 define Image/Build/Template/64kraw/loader
687 $(call Image/Build/$(1)/loader,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
688 endef
689
690 define Image/Build/Template/64kraw/squashfs
691 $(call Image/Build/$(1),squashfs-raw,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
692 endef
693
694 define Image/Build/Template/64kraw/jffs2-64k
695 $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
696 endef
697
698 define Image/Build/Template/128k/squashfs
699 $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
700 endef
701
702 define Image/Build/Template/128k/jffs2-128k
703 $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
704 endef
705
706 $(eval $(call SingleProfile,ALFA,$(fs_64k),ALFANX,alfa-nx,ALFA-NX,ttyS0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,vmlinux.gz.uImage,pb9x-2.6.31-jffs2))
707 $(eval $(call SingleProfile,ALFA,$(fs_64k),HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
708
709 $(eval $(call SingleProfile,AthGzip,$(fs_64k),AP81,ap81,AP81,ttyS0,115200,,1310720,6619136,KRuImage))
710 $(eval $(call SingleProfile,AthGzip,$(fs_64k),AP83,ap83,AP83,ttyS0,115200,,1310720,6619136,KRuImage))
711 $(eval $(call SingleProfile,AthGzip,$(fs_64k),AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),1769472,6291456,RKuImage))
712
713 $(eval $(call SingleProfile,AthLzma,$(fs_64k),ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),2097152,13631488,RKuImage))
714 $(eval $(call SingleProfile,AthLzma,$(fs_64k),ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),1048576,5373952,KRuImage))
715 $(eval $(call SingleProfile,AthLzma,$(fs_64k),AP113,ap113,AP113,ttyS0,115200,$$(ap113_mtd_layout),917504,3080192,RK))
716 $(eval $(call SingleProfile,AthLzma,$(fs_64k),AP121_2M,ap121-2M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_2M),720896,1245184,RKuImage))
717 $(eval $(call SingleProfile,AthLzma,$(fs_64k),AP121_4M,ap121-4M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_4M),917504,2818048,RKuImage))
718 $(eval $(call SingleProfile,AthLzma,$(fs_64k),AP121MINI,ap121-mini,AP121-MINI,ttyATH0,115200,$$(ap121_mtdlayout_4M),917504,2818048,RKuImage))
719 $(eval $(call SingleProfile,AthLzma,$(fs_64k),AP136,ap136,AP136,ttyS0,115200,$$(ap136_mtdlayout),1441792,6488064,RKuImage))
720 $(eval $(call SingleProfile,AthLzma,$(fs_64k),DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),1441792,6488064,RKuImage))
721 $(eval $(call SingleProfile,AthLzma,$(fs_64k),EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),1048576,2752512,KRuImage))
722 $(eval $(call SingleProfile,AthLzma,$(fs_64k),EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),1048576,2752512,KRuImage))
723 $(eval $(call SingleProfile,AthLzma,$(fs_64k),PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),917504,2818048,KRuImage))
724
725 $(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
726 $(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
727 $(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
728 $(eval $(call SingleProfile,Cameo7240,$(fs_64k),FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
729
730 $(eval $(call SingleProfile,Cameo913x,$(fs_squash),A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
731 $(eval $(call SingleProfile,Cameo913x,$(fs_squash),DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
732 $(eval $(call SingleProfile,Cameo913x,$(fs_squash),TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
733 $(eval $(call SingleProfile,Cameo913x,$(fs_squash),TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
734 $(eval $(call SingleProfile,Cameo913x,$(fs_squash),TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
735
736 $(eval $(call SingleProfile,Cameo933x,$(fs_squash),TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3"))
737
738 $(eval $(call SingleProfile,CyberTAN,$(fs_64k),WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,1.00.01))
739
740 $(eval $(call SingleProfile,DIR825B1,$(fs_64k),DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
741 $(eval $(call SingleProfile,DIR825B1,$(fs_64k),TEW673GRU,tew-637gru,TEW-673GRU,ttyS0,115200,01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
742
743 $(eval $(call SingleProfile,MyLoader,$(fs_64k),WP543_2M,wp543,,ttyS0,115200,0x200000,2M))
744 $(eval $(call SingleProfile,MyLoader,$(fs_64k),WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
745 $(eval $(call SingleProfile,MyLoader,$(fs_64k),WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
746 $(eval $(call SingleProfile,MyLoader,$(fs_64k),WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
747 $(eval $(call SingleProfile,MyLoader,$(fs_64k),WPE72,wpe72,,ttyS0,115200,0x800000,8M))
748
749 $(eval $(call SingleProfile,Netgear,$(fs_64k),WNDR3700V1,wndr3700,WNDR3700,ttyS0,115200,$$(wndr3700_mtdlayout),3700,WNDR3700,"" NA,))
750 $(eval $(call SingleProfile,Netgear,$(fs_64k),WNDR3700V2,wndr3700v2,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDR3700v2,"",-H 29763654+16+64))
751 $(eval $(call SingleProfile,Netgear,$(fs_64k),WNDR3800,wndr3800,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDR3800,"",-H 29763654+16+128))
752 $(eval $(call SingleProfile,Netgear,$(fs_64k),WNDRMAC,wndrmac,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDRMAC,"",-H 29763654+16+64))
753 $(eval $(call SingleProfile,Netgear,$(fs_64k),WNDRMACV2,wndrmacv2,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDRMACv2,"",-H 29763654+16+128))
754
755 $(eval $(call SingleProfile,OpenMesh,$(fs_squash),OM2P,om2p,OM2P))
756
757 $(eval $(call SingleProfile,PB4X,$(fs_128k),ALL0305,all0305,ALL0305,ttyS0,115200))
758 $(eval $(call SingleProfile,PB4X,$(fs_128k),EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
759 $(eval $(call SingleProfile,PB4X,$(fs_64k),JA76PF,ja76pf,JA76PF,ttyS0,115200))
760 $(eval $(call SingleProfile,PB4X,$(fs_64k),JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
761 $(eval $(call SingleProfile,PB4X,$(fs_64k),JWAP003,jwap003,JWAP003,ttyS0,115200))
762 $(eval $(call SingleProfile,PB4X,$(fs_64k),PB42,pb42,PB42,ttyS0,115200))
763 $(eval $(call SingleProfile,PB4X,$(fs_64k),PB44,pb44,PB44,ttyS0,115200))
764
765 $(eval $(call SingleProfile,Planex,$(fs_64k),MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
766 $(eval $(call SingleProfile,Planex,$(fs_64k),MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
767
768 $(eval $(call SingleProfile,TPLINKOLD,$(fs_squash),TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5,ttyS0,115200,0x08410002,2,4M))
769
770 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3220,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M))
771 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M))
772 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA701NV1,tl-wa701n-v1,TL-WA901ND,ttyS0,115200,0x07010001,1,4M))
773 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV1,tl-wa901nd-v1,TL-WA901ND,ttyS0,115200,0x09010001,1,4M))
774 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV2,tl-wa901nd-v2,TL-WA901ND-v2,ttyS0,115200,0x09010002,1,4M))
775 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR740NV1,tl-wr740n-v1,TL-WR741ND,ttyS0,115200,0x07400001,1,4M))
776 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR740NV3,tl-wr740n-v3,TL-WR741ND,ttyS0,115200,0x07400003,1,4M))
777 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR741NV1,tl-wr741nd-v1,TL-WR741ND,ttyS0,115200,0x07410001,1,4M))
778 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR741NV2,tl-wr741nd-v2,TL-WR741ND,ttyS0,115200,0x07410001,1,4M))
779 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR743,tl-wr743nd-v1,TL-WR741ND,ttyS0,115200,0x07430001,1,4M))
780 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR841NV3,tl-wr841nd-v3,TL-WR941ND,ttyS0,115200,0x08410003,3,4M))
781 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR841NV5,tl-wr841nd-v5,TL-WR741ND,ttyS0,115200,0x08410005,1,4M))
782 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR841NV7,tl-wr841nd-v7,TL-WR841N-v7,ttyS0,115200,0x08410007,1,4M))
783 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR842,tl-wr842n-v1,TL-MR3420,ttyS0,115200,0x08420001,1,8M))
784 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV2,tl-wr941nd-v2,TL-WR941ND,ttyS0,115200,0x09410002,2,4M))
785 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV3,tl-wr941nd-v3,TL-WR941ND,ttyS0,115200,0x09410002,2,4M))
786 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,ttyS0,115200,0x09410004,1,4M))
787 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR1043,tl-wr1043nd-v1,TL-WR1043,ttyS0,115200,0x10430001,1,8M))
788
789 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11U,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma))
790 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma))
791 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3040,tl-mr3040-v1,TL-MR11U,ttyATH0,115200,0x30400001,1,4Mlzma))
792 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR703,tl-wr703n-v1,TL-WR703N,ttyATH0,115200,0x07030101,1,4Mlzma))
793 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR740NV4,tl-wr740n-v4,TL-WR741ND-v4,ttyATH0,115200,0x07400004,1,4Mlzma))
794 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR741NV4,tl-wr741nd-v4,TL-WR741ND-v4,ttyATH0,115200,0x07410004,1,4Mlzma))
795 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR1041,tl-wr1041n-v1,TL-WR1041,ttyS0,115200,0x10410002,1,4Mlzma))
796 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR2543,tl-wr2543-v1,TL-WR2543,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
797 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3600V1,tl-wdr3600-v1,TL-WDR4300,ttyS0,115200,0x36000001,1,8Mlzma))
798 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4300V1,tl-wdr4300-v1,TL-WDR4300,ttyS0,115200,0x43000001,1,8Mlzma))
799 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4310V1,tl-wdr4310-v1,TL-WDR4300,ttyS0,115200,0x43100001,1,8Mlzma))
800
801 $(eval $(call SingleProfile,UBNT,$(fs_64k),UBNTRS,ubnt-rs,UBNT-RS,ttyS0,115200,RS,RSx,ar7100))
802 $(eval $(call SingleProfile,UBNT,$(fs_64k),UBNTRSPRO,ubnt-rspro,UBNT-RSPRO,ttyS0,115200,RSPRO,RSPRO,ar7100pro))
803 $(eval $(call SingleProfile,UBNT,$(fs_64k),UBNTLSSR71,ubnt-ls-sr71,UBNT-LS-SR71,ttyS0,115200,LS-SR71,LS-SR71,ar7100))
804
805 $(eval $(call SingleProfile,UBNTXM,$(fs_64k),RW2458N,rw2458n,RW2458N,ttyS0,115200,XM,XM,ar7240))
806 $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTAIRROUTER,ubnt-airrouter,UBNT-AR,ttyS0,115200,XM,XM,ar7240))
807 $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTBULLETM,ubnt-bullet-m,UBNT-BM,ttyS0,115200,XM,XM,ar7240))
808 $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTROCKETM,ubnt-rocket-m,UBNT-RM,ttyS0,115200,XM,XM,ar7240))
809 $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTNANOM,ubnt-nano-m,UBNT-NM,ttyS0,115200,XM,XM,ar7240))
810 $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
811
812 $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
813 $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
814 $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
815 $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
816
817 $(eval $(call SingleProfile,WRT400N,$(fs_64k),WRT400N,wrt400n,WRT400N,ttyS0,115200))
818
819 $(eval $(call SingleProfile,WZRHPG30XNH,$(fs_128k),WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
820 $(eval $(call SingleProfile,WZRHPG30XNH,$(fs_64k),WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
821 $(eval $(call SingleProfile,WZRHPG30XNH,$(fs_64k),WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
822 $(eval $(call SingleProfile,WZRHPG30XNH,$(fs_64k),WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
823
824 $(eval $(call SingleProfile,Zcomax,$(fs_64k),ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
825 $(eval $(call SingleProfile,Zcomax,$(fs_64k),ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
826
827 $(eval $(call SingleProfile,ZyXEL,$(fs_64k),NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
828
829
830 $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M))
831 $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT))
832 $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
833 $(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
834 $(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3 TLWR740NV4))
835 $(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2 TLWR741NV4))
836 $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7))
837 $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
838 $(eval $(call MultiProfile,TLWDR4300,TLWDR3600V1 TLWDR4300V1 TLWDR4310V1))
839 $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTUNIFI))
840 $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDRMAC WNDRMACV2))
841 $(eval $(call MultiProfile,WPE543,WPE543_2M WPE543_4M WPE543_8M WPE543_16M))
842
843 $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
844 $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
845 $(eval $(call MultiProfile,Madwifi,EAP7660D UBNTRS UBNTRSPRO UBNTLSSR71 WP543))
846
847 define Image/Build/squashfs
848 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
849 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
850 $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
851 cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k
852 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
853 endef
854
855 define Image/Build/Initramfs
856 $(call Image/Build/Profile/$(PROFILE),initramfs)
857 endef
858
859 define Image/Prepare
860 gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
861 $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
862 $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(PROFILE)),loader)
863 endef
864
865 define Image/Build
866 $(call Image/Build/$(1))
867 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
868 $(call Image/Build/Profile/$(PROFILE),$(1))
869 endef
870
871 $(eval $(call BuildImage))