cpmac: fix race condition (closes #3019)
[openwrt.git] / target / linux / adm5120 / image / router_le.mk
1 #
2 # Copyright (C) 2007,2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define trxedimax/jffs2-128k
9 -a 0x20000 -f $(KDIR)/root.jffs2-128k
10 endef
11
12 define trxedimax/jffs2-64k
13 -a 0x10000 -f $(KDIR)/root.jffs2-64k
14 endef
15
16 define trxedimax/squashfs
17 -a 1024 -f $(KDIR)/root.squashfs
18 endef
19
20 define Image/Build/TRXEdimax
21 $(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(KDIR)/vmlinux.lzma \
22 $(call trxedimax/$(2))
23 endef
24
25 define Image/Build/Compex
26 $(call Image/Build/Loader,$(2),gz,0x80500000,0,y,$(2))
27 $(call Image/Build/TRX,$(call imgname,$(1),$(2)).trx,$(1),$(KDIR)/loader-$(2).gz)
28 endef
29
30 define Image/Build/Edimax
31 $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
32 $(call Image/Build/TRXEdimax,$(call imgname,$(1),$(2)).trx,$(1))
33 $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d -w \
34 -r $(KDIR)/loader-$(2).gz::0x1000 \
35 -x $(call imgname,$(1),$(2)).trx:0x10000 \
36 -x $(JFFS2MARK):0x10000 \
37 $(call imgname,$(1),$(2))-webui.bin
38 $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d \
39 -r $(KDIR)/loader-$(2).gz::0x1000 \
40 -x $(call imgname,$(1),$(2)).trx:0x10000 \
41 -x $(JFFS2MARK):0x10000 \
42 $(call imgname,$(1),$(2))-xmodem.bin
43 rm -f $(call imgname,$(1),$(2)).trx
44 endef
45
46 define Image/Build/Infineon
47 $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
48 $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
49 dd if=$(KDIR)/loader-$(2).gz of=$(call imgname,$(1),$(2)).img bs=64k conv=sync
50 cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2)).img
51 endef
52
53 define Image/Build/Cellvision
54 $(call Image/Build/Loader,$(2),bin,0x80500000,0x6D8,y,$(3))
55 mkdir -p $(BIN_DIR)/tmp
56 cp $(KDIR)/loader-$(2).bin $(BIN_DIR)/tmp/vmlinux.bin
57 gzip -9 $(BIN_DIR)/tmp/vmlinux.bin
58 dd if=$(BIN_DIR)/tmp/vmlinux.bin.gz of=$(call imgname,$(1),$(2))-xmodem.bin bs=64k conv=sync
59 rm -rf $(BIN_DIR)/tmp
60 $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
61 cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2))-xmodem.bin
62 $(STAGING_DIR_HOST)/bin/mkcasfw -B $(2) -d \
63 -K $(call imgname,$(1),$(2))-xmodem.bin \
64 $(call imgname,$(1),$(2))-webui.bin
65 endef
66
67 define Image/Build/Cellvision2
68 # only for CAS-700/771/790/861
69 $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(3))
70 $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
71 dd if=$(KDIR)/loader-$(2).gz of=$(call imgname,$(1),$(2)).bin bs=64k conv=sync
72 cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2)).bin
73 echo -ne '\x14\x07\x24\x06$(2)' | dd bs=14 count=1 conv=sync >> $(call imgname,$(1),$(2)).bin
74 echo -ne 'OpenWrt\x00\x00\x00' >> $(call imgname,$(1),$(2)).bin
75 endef
76
77 define Image/Build/MyLoader
78 $(call Image/Build/Loader,$(2),gz,0x80500000,0)
79 $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
80 $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) \
81 -p0x20000:0x10000:ahp:0x80001000 \
82 -p0x30000:0 \
83 -b0x20000:0x10000:h:$(KDIR)/loader-$(2).gz \
84 -b0x30000:0::$(call imgname,$(1),$(2)).trx \
85 $(call imgname,$(1),$(2)).bin
86 endef
87
88 #
89 # Cellvision CAS-630/630W, CAS-670/670W, NFS-101U/101WU, NFS-202U/202WU
90 #
91 define Image/Build/Template/Cellvision
92 $(call Image/Build/Cellvision,$(1),$(2),$(3))
93 endef
94
95 define Image/Build/Template/Cellvision/squashfs
96 $(call Image/Build/Template/Cellvision,squashfs,$(1),$(2))
97 endef
98
99 define Image/Build/Template/Cellvision/jffs2-64k
100 $(call Image/Build/Template/Cellvision,jffs2-64k,$(1),$(2))
101 endef
102
103 #
104 # Cellvision CAS-700/700W, CAS-771/771W, CAS-790, CAS-861/861W
105 #
106 define Image/Build/Template/Cellvision2
107 $(call Image/Build/Cellvision2,$(1),$(2),$(3))
108 endef
109
110 define Image/Build/Template/Cellvision2/squashfs
111 $(call Image/Build/Template/Cellvision2,squashfs,$(1),$(2))
112 endef
113
114 define Image/Build/Template/Cellvision2/jffs2-64k
115 $(call Image/Build/Template/Cellvision2,jffs2-64k,$(1),$(2))
116 endef
117
118 define Image/Build/Template/Cellvision2/Initramfs
119 $(call Image/Build/LZMAKernel/Cellvision,$(1),$(2),gz)
120 endef
121
122 #
123 # Compex NP27G, NP28G, WP54G, WP54AG, WPP54G, WPP54AG
124 #
125 define Image/Build/Template/Compex
126 $(call Image/Build/MyLoader,$(1),$(2))
127 endef
128
129 define Image/Build/Template/Compex/squashfs
130 $(call Image/Build/Template/Compex,squashfs,$(1))
131 endef
132
133 define Image/Build/Template/Compex/jffs2-64k
134 $(call Image/Build/Template/Compex,jffs2-64k,$(1))
135 endef
136
137 define Image/Build/Template/Compex/Initramfs
138 $(call Image/Build/LZMAKernel/Generic,$(1),bin)
139 endef
140
141 #
142 # Compex WP54G-WRT
143 #
144 define Image/Build/Template/WP54GWRT
145 $(call Image/Build/Compex,$(1),wp54g-wrt)
146 endef
147
148 define Image/Build/Template/WP54GWRT/squashfs
149 $(call Image/Build/Template/WP54GWRT,squashfs)
150 endef
151
152 define Image/Build/Template/WP54GWRT/jffs2-64k
153 $(call Image/Build/Template/WP54GWRT,jffs2-64k)
154 endef
155
156 define Image/Build/Template/WP54GWRT/Initramfs
157 $(call Image/Build/LZMAKernel/KArgs,wp54g-wrt,bin)
158 endef
159
160 #
161 # Edimax BR-6104K, BR-6104KP, BR-6104Wg, BR-6114WG
162 #
163 define Image/Build/Template/Edimax
164 $(call Image/Build/Edimax,$(1),$(2))
165 endef
166
167 define Image/Build/Template/Edimax/squashfs
168 $(call Image/Build/Template/Edimax,squashfs,$(1))
169 endef
170
171 define Image/Build/Template/Edimax/Initramfs
172 $(call Image/Build/LZMAKernel/Admboot,$(1),gz)
173 endef
174
175 #
176 # Infineon EASY 5120, EASY 83000
177 #
178 define Image/Build/Template/Infineon
179 $(call Image/Build/Infineon,$(1),$(2))
180 endef
181
182 define Image/Build/Template/Infineon/squashfs
183 $(call Image/Build/Template/Infineon,squashfs,$(1))
184 endef
185
186 define Image/Build/Template/Infineon/jffs2-64k
187 $(call Image/Build/Template/Infineon,jffs2-64k,$(1))
188 endef
189
190 define Image/Build/Template/Infineon/Initramfs
191 $(call Image/Build/LZMAKernel/Admboot,$(1),gz)
192 endef
193
194 #
195 # Mikrotik RouterBOARD 1xx
196 #
197 define Image/Build/Template/Mikrotik/Initramfs
198 $(CP) $(KDIR)/vmlinux.elf $(call imgname,netboot,rb1xx)
199 endef
200
201 #
202 # Profiles
203 #
204 define Image/Build/Profile/CAS630
205 $(call Image/Build/Template/Cellvision/$(1),cas-630,cas-630)
206 endef
207
208 define Image/Build/Profile/CAS630W
209 $(call Image/Build/Template/Cellvision/$(1),cas-630w,cas-630)
210 endef
211
212 define Image/Build/Profile/CAS670
213 $(call Image/Build/Template/Cellvision/$(1),cas-670,cas-670)
214 endef
215
216 define Image/Build/Profile/CAS670W
217 $(call Image/Build/Template/Cellvision/$(1),cas-670w,cas-670)
218 endef
219
220 define Image/Build/Profile/NFS101U
221 $(call Image/Build/Template/Cellvision/$(1),nfs-101u,nfs-101u)
222 $(call Image/Build/Template/Cellvision/$(1),dn-7013,nfs-101u)
223 $(call Image/Build/Template/Cellvision/$(1),dns-120,nfs-101u)
224 $(call Image/Build/Template/Cellvision/$(1),mu-5000fs,nfs-101u)
225 $(call Image/Build/Template/Cellvision/$(1),tn-u100,nfs-101u)
226 endef
227
228 define Image/Build/Profile/NFS101WU
229 $(call Image/Build/Template/Cellvision/$(1),nfs-101wu,nfs-101u)
230 $(call Image/Build/Template/Cellvision/$(1),dns-g120,nfs-101u)
231 endef
232
233 define Image/Build/Profile/CAS700
234 $(call Image/Build/Template/Cellvision2/$(1),cas-700,cas-700)
235 endef
236
237 define Image/Build/Profile/CAS700W
238 $(call Image/Build/Template/Cellvision2/$(1),cas-700w,cas-700)
239 endef
240
241 define Image/Build/Profile/CAS771
242 $(call Image/Build/Template/Cellvision2/$(1),cas-771,cas-771)
243 endef
244
245 define Image/Build/Profile/CAS771W
246 $(call Image/Build/Template/Cellvision2/$(1),cas-771w,cas-771)
247 endef
248
249 define Image/Build/Profile/CAS790
250 $(call Image/Build/Template/Cellvision2/$(1),cas-790,cas-790)
251 endef
252
253 define Image/Build/Profile/CAS861
254 $(call Image/Build/Template/Cellvision2/$(1),cas-861,cas-861)
255 endef
256
257 define Image/Build/Profile/CAS861W
258 $(call Image/Build/Template/Cellvision2/$(1),cas-861w,cas-861)
259 endef
260
261 define Image/Build/Profile/NP27G
262 $(call Image/Build/Template/Compex/$(1),np27g)
263 endef
264
265 define Image/Build/Profile/NP28G
266 $(call Image/Build/Template/Compex/$(1),np28g)
267 endef
268
269 define Image/Build/Profile/WP54
270 $(call Image/Build/Template/Compex/$(1),wp54g)
271 $(call Image/Build/Template/Compex/$(1),wp54ag)
272 $(call Image/Build/Template/Compex/$(1),wpp54g)
273 $(call Image/Build/Template/Compex/$(1),wpp54ag)
274 $(call Image/Build/Template/WP54GWRT/$(1))
275 endef
276
277 define Image/Build/Profile/BR6104K
278 $(call Image/Build/Template/Edimax/$(1),br-6104k)
279 endef
280
281 define Image/Build/Profile/BR6104KP
282 $(call Image/Build/Template/Edimax/$(1),br-6104kp)
283 endef
284
285 define Image/Build/Profile/BR6104WG
286 $(call Image/Build/Template/Edimax/$(1),br-6104wg)
287 endef
288
289 define Image/Build/Profile/BR6114WG
290 $(call Image/Build/Template/Edimax/$(1),br-6114wg)
291 endef
292
293 define Image/Build/Profile/EASY83000
294 $(call Image/Build/Template/Infineon/$(1),easy-83000)
295 endef
296
297 define Image/Build/Profile/EASY5120RT
298 $(call Image/Build/Template/Infineon/$(1),easy-5120-rt)
299 endef
300
301 define Image/Build/Profile/RouterBoard
302 $(call Image/Build/Template/Mikrotik/$(1))
303 endef
304
305 ifeq ($(CONFIG_BROKEN),y)
306 define Image/Build/Experimental
307 # Cellvison
308 $(call Image/Build/Profile/CAS630,$(1))
309 $(call Image/Build/Profile/CAS630W,$(1))
310 $(call Image/Build/Profile/CAS670,$(1))
311 $(call Image/Build/Profile/CAS670W,$(1))
312 $(call Image/Build/Profile/CAS700,$(1))
313 $(call Image/Build/Profile/CAS700W,$(1))
314 $(call Image/Build/Profile/CAS771,$(1))
315 $(call Image/Build/Profile/CAS771W,$(1))
316 $(call Image/Build/Profile/CAS861,$(1))
317 $(call Image/Build/Profile/CAS861W,$(1))
318 $(call Image/Build/Profile/NFS101U,$(1))
319 $(call Image/Build/Profile/NFS101WU,$(1))
320 endef
321 endif
322
323 define Image/Build/Profile/Generic
324 # Compex
325 $(call Image/Build/Profile/WP54,$(1))
326 $(call Image/Build/Profile/NP27G,$(1))
327 $(call Image/Build/Profile/NP28G,$(1))
328 # Edimax
329 $(call Image/Build/Profile/BR6104K,$(1))
330 $(call Image/Build/Profile/BR6104KP,$(1))
331 $(call Image/Build/Profile/BR6104WG,$(1))
332 $(call Image/Build/Profile/BR6114WG,$(1))
333 # Infineon
334 $(call Image/Build/Profile/EASY83000,$(1))
335 $(call Image/Build/Profile/EASY5120RT,$(1))
336 # Mikrotik
337 $(call Image/Build/Profile/RB1xx/$(1))
338 $(call Image/Build/Experimental,$(1))
339 endef
340
341 ifeq ($(PROFILE),RouterBoard)
342 define Image/cmdline/yaffs2
343 root=/dev/mtdblock3 rootfstype=yaffs2 init=/etc/preinit
344 endef
345
346 define Image/BuildKernel/RouterBoard
347 $(CP) $(KDIR)/vmlinux.elf $(call imgname,kernel,rb1xx)
348 $(STAGING_DIR_HOST)/bin/patch-cmdline $(call imgname,kernel,rb1xx) \
349 '$(strip $(call Image/cmdline/yaffs2))'
350 endef
351
352 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
353 define Image/BuildKernel
354 $(call Image/BuildKernel/RouterBoard)
355 endef
356 endif
357
358 endif
359
This page took 0.06004 seconds and 5 git commands to generate.