2 # Copyright (C) 2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 JFFS2_BLOCKSIZE
= 64k
128k
256k
12 ase_cmdline
=-console
=ttyLTQ0
,115200 rootfstype
=squashfs
,jffs2
13 xway_cmdline
=-console
=ttyLTQ1
,115200 rootfstype
=squashfs
,jffs2
14 falcon_cmdline
=-console
=ttyLTQ0
,115200 rootfstype
=squashfs
,jffs2
17 $(STAGING_DIR_HOST
)/bin
/lzma e
$(1) $(2)
20 define PatchKernelLzma
21 cp
$(KDIR
)/vmlinux
$(KDIR
)/vmlinux-
$(1)
22 $(STAGING_DIR_HOST
)/bin
/patch-cmdline
$(KDIR
)/vmlinux-
$(1) '$(strip $(2))'
23 $(call CompressLzma
,$(KDIR
)/vmlinux-
$(1),$(KDIR
)/vmlinux-
$(1).lzma
)
27 mkbrncmdline
-i
$(KDIR
)/vmlinux-
$(4) -o
$(KDIR
)/vmlinux-
$(4)-brn BRN-BOOT
$(6)
28 $(call CompressLzma
,$(KDIR
)/vmlinux-
$(4)-brn
,$(KDIR
)/vmlinux-
$(4)-brn.lzma
)
29 mkbrnimg
-s
$(1) -m
$(2) -o
$(3) $(KDIR
)/vmlinux-
$(4)-brn.lzma
$(KDIR
)/root.
$(5)
33 mkimage
-A mips
-O linux
-T kernel
-a
0x80002000 -C lzma \
34 -e
0x80002000 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
35 -d
$(KDIR
)/vmlinux-
$(1).lzma
$(KDIR
)/uImage-
$(1)
38 define Image
/Build
/squashfs
39 cat
$(KDIR
)/uImage-
$(2) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
40 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
)
41 $(if
$(3),$(call MkBrnImage
,$(3),$(4),$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(3)-brnImage
,$(2),$(1),$(5)))
44 define Image
/Build
/jffs2-64k
45 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=64k conv
=sync
46 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
49 define Image
/Build
/jffs2-128k
50 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=128k conv
=sync
51 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
54 define Image
/Build
/jffs2-256k
55 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=256k conv
=sync
56 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
59 define Image
/BuildKernel
/Template
60 $(call PatchKernelLzma
,$(1),$(if
$(2),$(2) machtype
=$(1),))
61 $(call MkImageLzma
,$(1))
62 $(CP
) $(KDIR
)/uImage-
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-uImage
65 ifeq ($(CONFIG_TARGET_lantiq_danube
),y
)
66 define Image
/BuildKernel
/Profile
/EASY50712
67 $(call Image
/BuildKernel
/Template
,EASY50712
,$(xway_cmdline
))
70 define Image
/Build
/Profile
/EASY50712
71 $(call Image
/Build
/$(1),$(1),EASY50712
)
74 define Image
/BuildKernel
/Profile
/EASY50812
75 $(call Image
/BuildKernel
/Template
,EASY50812
,$(xway_cmdline
))
78 define Image
/Build
/Profile
/EASY50812
79 $(call Image
/Build
/$(1),$(1),EASY50812
)
82 define Image
/BuildKernel
/Profile
/ARV3527P
83 $(call Image
/BuildKernel
/Template
,ARV3527P
,$(xway_cmdline
))
86 define Image
/Build
/Profile
/ARV3527P
87 $(call Image
/Build
/$(1),$(1),ARV3527P
)
90 define Image
/BuildKernel
/Profile
/ARV4510PW
91 $(call Image
/BuildKernel
/Template
,ARV4510PW
,$(xway_cmdline
))
94 define Image
/Build
/Profile
/ARV4510PW
95 $(call Image
/Build
/$(1),$(1),ARV4510PW
)
98 define Image
/BuildKernel
/Profile
/ARV4518PW
99 $(call Image
/BuildKernel
/Template
,ARV4518PW
,$(xway_cmdline
))
102 define Image
/Build
/Profile
/ARV4518PW
103 $(call Image
/Build
/$(1),$(1),ARV4518PW
)
106 define Image
/BuildKernel
/Profile
/ARV4520PW
107 $(call Image
/BuildKernel
/Template
,ARV4520PW
,$(xway_cmdline
))
110 define Image
/Build
/Profile
/ARV4520PW
111 $(call Image
/Build
/$(1),$(1),ARV4520PW
)
114 define Image
/BuildKernel
/Profile
/ARV4525PW
115 $(call Image
/BuildKernel
/Template
,ARV4525PW
,$(xway_cmdline
))
118 define Image
/Build
/Profile
/ARV4525PW
119 $(call Image
/Build
/$(1),$(1),ARV4525PW
,BRNDTW502
,0x12345678,memsize
=32)
122 define Image
/BuildKernel
/Profile
/ARV7525PW
123 $(call Image
/BuildKernel
/Template
,ARV7525PW
,$(xway_cmdline
))
126 define Image
/Build
/Profile
/ARV7525PW
127 $(call Image
/Build
/$(1),$(1),ARV7525PW
)
130 define Image
/BuildKernel
/Profile
/ARV452CPW
131 $(call Image
/BuildKernel
/Template
,ARV452CPW
,$(xway_cmdline
))
134 define Image
/Build
/Profile
/ARV452CPW
135 $(call Image
/Build
/$(1),$(1),ARV452CPW
)
138 define Image
/BuildKernel
/Profile
/ARV7518PW
139 $(call Image
/BuildKernel
/Template
,ARV7518PW
,$(xway_cmdline
))
142 define Image
/Build
/Profile
/ARV7518PW
143 $(call Image
/Build
/$(1),$(1),ARV7518PW
)
146 define Image
/BuildKernel
/Profile
/ARV752DPW
147 $(call Image
/BuildKernel
/Template
,ARV752DPW
,$(xway_cmdline
))
150 define Image
/Build
/Profile
/ARV752DPW
151 $(call Image
/Build
/$(1),$(1),ARV752DPW
)
154 define Image
/BuildKernel
/Profile
/ARV752DPW22
155 $(call Image
/BuildKernel
/Template
,ARV752DPW22
,$(xway_cmdline
))
158 define Image
/Build
/Profile
/ARV752DPW22
159 $(call Image
/Build
/$(1),$(1),ARV752DPW22
)
162 define Image
/BuildKernel
/Profile
/GIGASX76X
163 $(call Image
/BuildKernel
/Template
,GIGASX76X
,$(xway_cmdline
))
166 define Image
/Build
/Profile
/GIGASX76X
167 $(call Image
/Build
/$(1),$(1),GIGASX76X
)
170 define Image
/BuildKernel
/Profile
/Generic
171 $(call Image
/BuildKernel
/Template
,EASY4010
,$(xway_cmdline
))
172 $(call Image
/BuildKernel
/Template
,EASY50712
,$(xway_cmdline
))
173 $(call Image
/BuildKernel
/Template
,EASY50812
,$(xway_cmdline
))
174 $(call Image
/BuildKernel
/Template
,ARV3527P
,$(xway_cmdline
))
175 $(call Image
/BuildKernel
/Template
,ARV4510PW
,$(xway_cmdline
))
176 $(call Image
/BuildKernel
/Template
,ARV4518PW
,$(xway_cmdline
))
177 $(call Image
/BuildKernel
/Template
,ARV4520PW
,$(xway_cmdline
))
178 $(call Image
/BuildKernel
/Template
,ARV452CPW
,$(xway_cmdline
))
179 $(call Image
/BuildKernel
/Template
,ARV4525PW
,$(xway_cmdline
))
180 $(call Image
/BuildKernel
/Template
,ARV7525PW
,$(xway_cmdline
))
181 $(call Image
/BuildKernel
/Template
,ARV7518PW
,$(xway_cmdline
))
182 $(call Image
/BuildKernel
/Template
,ARV752DPW
,$(xway_cmdline
))
183 $(call Image
/BuildKernel
/Template
,ARV752DPW22
,$(xway_cmdline
))
184 $(call Image
/BuildKernel
/Template
,GIGASX76X
,$(xway_cmdline
))
185 $(call Image
/BuildKernel
/Template
,NONE
)
188 define Image
/Build
/Profile
/Generic
189 $(call Image
/Build
/$(1),$(1),EASY4010
)
190 $(call Image
/Build
/$(1),$(1),EASY50712
)
191 $(call Image
/Build
/$(1),$(1),EASY50812
)
192 $(call Image
/Build
/$(1),$(1),ARV3527P
)
193 $(call Image
/Build
/$(1),$(1),ARV4510PW
)
194 $(call Image
/Build
/$(1),$(1),ARV4518PW
)
195 $(call Image
/Build
/$(1),$(1),ARV4520PW
)
196 $(call Image
/Build
/$(1),$(1),ARV452CPW
)
197 $(call Image
/Build
/$(1),$(1),ARV4525PW
)
198 $(call Image
/Build
/$(1),$(1),ARV7525PW
)
199 $(call Image
/Build
/$(1),$(1),ARV7518PW
)
200 $(call Image
/Build
/$(1),$(1),ARV752DPW
)
201 $(call Image
/Build
/$(1),$(1),ARV752DPW22
)
202 $(call Image
/Build
/$(1),$(1),GIGASX76X
)
203 $(call Image
/Build
/$(1),$(1),NONE
)
204 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
208 ifeq ($(CONFIG_TARGET_lantiq_ar9
),y
)
209 define Image
/BuildKernel
/Profile
/WBMR
210 $(call Image
/BuildKernel
/Template
,WBMR
,$(xway_cmdline
))
213 define Image
/Build
/Profile
/WBMR
214 $(call Image
/Build
/$(1),$(1),WBMR
)
217 define Image
/BuildKernel
/Profile
/DGN3500B
218 $(call Image
/BuildKernel
/Template
,DGN3500B
,$(xway_cmdline
))
221 define Image
/Build
/Profile
/DGN3500B
222 $(call Image
/Build
/$(1),$(1),DGN3500B
)
225 define Image
/BuildKernel
/Profile
/Generic
226 $(call Image
/BuildKernel
/Template
,WBMR
,$(xway_cmdline
))
227 $(call Image
/BuildKernel
/Template
,DGN3500B
,$(xway_cmdline
))
228 $(call Image
/BuildKernel
/Template
,NONE
)
231 define Image
/Build
/Profile
/Generic
232 $(call Image
/Build
/$(1),$(1),WBMR
)
233 $(call Image
/Build
/$(1),$(1),DGN3500B
)
234 $(call Image
/Build
/$(1),$(1),NONE
)
235 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
239 ifeq ($(CONFIG_TARGET_lantiq_falcon
)$(CONFIG_TARGET_lantiq_falcon_stable
),y
)
240 define Image
/BuildKernel
/Profile
/EASY98000
241 $(call Image
/BuildKernel
/Template
,EASY98000
,$(falcon_cmdline
))
244 define Image
/Build
/Profile
/EASY98000
245 $(call Image
/Build
/$(1),$(1),EASY98000
)
248 define Image
/BuildKernel
/Profile
/EASY98020
249 $(call Image
/BuildKernel
/Template
,EASY98020
,$(falcon_cmdline
))
252 define Image
/Build
/Profile
/EASY98020
253 $(call Image
/Build
/$(1),$(1),EASY98020
)
256 define Image
/BuildKernel
/Profile
/Generic
257 $(call Image
/BuildKernel
/Template
,EASY98000
,$(falcon_cmdline
))
258 $(call Image
/BuildKernel
/Template
,EASY98020
,$(falcon_cmdline
))
259 $(call Image
/BuildKernel
/Template
,NONE
)
262 define Image
/Build
/Profile
/Generic
263 $(call Image
/Build
/$(1),$(1),EASY98000
)
264 $(call Image
/Build
/$(1),$(1),EASY98020
)
265 $(call Image
/Build
/$(1),$(1),NONE
)
266 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
270 ifeq ($(CONFIG_TARGET_lantiq_ase
),y
)
271 define Image
/BuildKernel
/Profile
/EASY50601
272 $(call Image
/BuildKernel
/Template
,EASY50601
,$(ase_cmdline
))
275 define Image
/Build
/Profile
/EASY50601
276 $(call Image
/Build
/$(1),$(1),EASY50601
)
279 define Image
/BuildKernel
/Profile
/Generic
280 $(call Image
/BuildKernel
/Template
,EASY50601
,$(ase_cmdline
))
281 $(call Image
/BuildKernel
/Template
,NONE
)
284 define Image
/Build
/Profile
/Generic
285 $(call Image
/Build
/$(1),$(1),EASY50601
)
286 $(call Image
/Build
/$(1),$(1),NONE
)
287 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
291 define Image
/BuildKernel
292 $(call Image
/BuildKernel
/Profile
/$(PROFILE
))
296 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
299 $(eval
$(call BuildImage
))