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
=ttyLTQ1
,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 mkimage
-A mips
-O linux
-T kernel
-a
0x80002000 -C lzma \
28 -e
0x80002000 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
29 -d
$(KDIR
)/vmlinux-
$(1).lzma
$(KDIR
)/uImage-
$(1)
32 define Image
/Build
/squashfs
33 cat
$(KDIR
)/uImage-
$(2) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
34 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
)
37 define Image
/Build
/jffs2-64k
38 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=64k conv
=sync
39 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
42 define Image
/Build
/jffs2-128k
43 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=128k conv
=sync
44 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
47 define Image
/Build
/jffs2-256k
48 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=256k conv
=sync
49 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
52 define Image
/BuildKernel
/Template
53 $(call PatchKernelLzma
,$(1),$(if
$(2),$(2) machtype
=$(1),))
54 $(call MkImageLzma
,$(1))
55 $(CP
) $(KDIR
)/uImage-
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-uImage
58 ifeq ($(CONFIG_TARGET_lantiq_xway
),y
)
59 define Image
/BuildKernel
/Profile
/EASY50712
60 $(call Image
/BuildKernel
/Template
,EASY50712
,$(xway_cmdline
))
63 define Image
/Build
/Profile
/EASY50712
64 $(call Image
/Build
/$(1),$(1),EASY50712
)
67 define Image
/BuildKernel
/Profile
/EASY50812
68 $(call Image
/BuildKernel
/Template
,EASY50812
,$(xway_cmdline
))
71 define Image
/Build
/Profile
/EASY50812
72 $(call Image
/Build
/$(1),$(1),EASY50812
)
75 define Image
/BuildKernel
/Profile
/ARV3527P
76 $(call Image
/BuildKernel
/Template
,ARV3527P
,$(xway_cmdline
))
79 define Image
/Build
/Profile
/ARV3527P
80 $(call Image
/Build
/$(1),$(1),ARV3527P
)
83 define Image
/BuildKernel
/Profile
/ARV4510PW
84 $(call Image
/BuildKernel
/Template
,ARV4510PW
,$(xway_cmdline
))
87 define Image
/Build
/Profile
/ARV4510PW
88 $(call Image
/Build
/$(1),$(1),ARV4510PW
)
91 define Image
/BuildKernel
/Profile
/ARV4518PW
92 $(call Image
/BuildKernel
/Template
,ARV4518PW
,$(xway_cmdline
))
95 define Image
/Build
/Profile
/ARV4518PW
96 $(call Image
/Build
/$(1),$(1),ARV4518PW
)
99 define Image
/BuildKernel
/Profile
/ARV4520PW
100 $(call Image
/BuildKernel
/Template
,ARV4520PW
,$(xway_cmdline
))
103 define Image
/Build
/Profile
/ARV4520PW
104 $(call Image
/Build
/$(1),$(1),ARV4520PW
)
107 define Image
/BuildKernel
/Profile
/ARV4525PW
108 $(call Image
/BuildKernel
/Template
,ARV4525PW
,$(xway_cmdline
))
111 define Image
/Build
/Profile
/ARV4525PW
112 $(call Image
/Build
/$(1),$(1),ARV4525PW
)
115 define Image
/BuildKernel
/Profile
/ARV452CPW
116 $(call Image
/BuildKernel
/Template
,ARV452CPW
,$(xway_cmdline
))
119 define Image
/Build
/Profile
/ARV452CPW
120 $(call Image
/Build
/$(1),$(1),ARV452CPW
)
123 define Image
/BuildKernel
/Profile
/ARV7518PW
124 $(call Image
/BuildKernel
/Template
,ARV7518PW
,$(xway_cmdline
))
127 define Image
/Build
/Profile
/ARV7518PW
128 $(call Image
/Build
/$(1),$(1),ARV7518PW
)
131 define Image
/BuildKernel
/Profile
/ARV752DPW22
132 $(call Image
/BuildKernel
/Template
,ARV752DPW22
,$(xway_cmdline
))
135 define Image
/Build
/Profile
/ARV752DPW22
136 $(call Image
/Build
/$(1),$(1),ARV752DPW22
)
139 define Image
/BuildKernel
/Profile
/Generic
140 $(call Image
/BuildKernel
/Template
,EASY4010
,$(xway_cmdline
))
141 $(call Image
/BuildKernel
/Template
,EASY50712
,$(xway_cmdline
))
142 $(call Image
/BuildKernel
/Template
,EASY50812
,$(xway_cmdline
))
143 $(call Image
/BuildKernel
/Template
,ARV3527P
,$(xway_cmdline
))
144 $(call Image
/BuildKernel
/Template
,ARV4510PW
,$(xway_cmdline
))
145 $(call Image
/BuildKernel
/Template
,ARV4518PW
,$(xway_cmdline
))
146 $(call Image
/BuildKernel
/Template
,ARV4520PW
,$(xway_cmdline
))
147 $(call Image
/BuildKernel
/Template
,ARV452CPW
,$(xway_cmdline
))
148 $(call Image
/BuildKernel
/Template
,ARV4525PW
,$(xway_cmdline
))
149 $(call Image
/BuildKernel
/Template
,ARV7518PW
,$(xway_cmdline
))
150 $(call Image
/BuildKernel
/Template
,ARV752DPW
,$(xway_cmdline
))
151 $(call Image
/BuildKernel
/Template
,ARV752DPW22
,$(xway_cmdline
))
152 $(call Image
/BuildKernel
/Template
,NONE
)
155 define Image
/Build
/Profile
/Generic
156 $(call Image
/Build
/$(1),$(1),EASY4010
)
157 $(call Image
/Build
/$(1),$(1),EASY50712
)
158 $(call Image
/Build
/$(1),$(1),EASY50812
)
159 $(call Image
/Build
/$(1),$(1),ARV3527P
)
160 $(call Image
/Build
/$(1),$(1),ARV4510PW
)
161 $(call Image
/Build
/$(1),$(1),ARV4518PW
)
162 $(call Image
/Build
/$(1),$(1),ARV4520PW
)
163 $(call Image
/Build
/$(1),$(1),ARV452CPW
)
164 $(call Image
/Build
/$(1),$(1),ARV4525PW
)
165 $(call Image
/Build
/$(1),$(1),ARV7518PW
)
166 $(call Image
/Build
/$(1),$(1),ARV752DPW
)
167 $(call Image
/Build
/$(1),$(1),ARV752DPW22
)
168 $(call Image
/Build
/$(1),$(1),NONE
)
169 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
173 ifeq ($(CONFIG_TARGET_lantiq_falcon
),y
)
174 define Image
/BuildKernel
/Profile
/Generic
175 $(call Image
/BuildKernel
/Template
,EASY98000
,$(falcon_cmdline
))
176 $(call Image
/BuildKernel
/Template
,EASY98020
,$(falcon_cmdline
))
177 $(call Image
/BuildKernel
/Template
,NONE
)
180 define Image
/Build
/Profile
/Generic
181 $(call Image
/Build
/$(1),$(1),EASY98000
)
182 $(call Image
/Build
/$(1),$(1),EASY98020
)
183 $(call Image
/Build
/$(1),$(1),NONE
)
184 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
188 ifeq ($(CONFIG_TARGET_lantiq_ase
),y
)
189 define Image
/BuildKernel
/Profile
/EASY50601
190 $(call Image
/BuildKernel
/Template
,EASY50601
,$(ase_cmdline
))
193 define Image
/Build
/Profile
/EASY50601
194 $(call Image
/Build
/$(1),$(1),EASY50601
)
197 define Image
/BuildKernel
/Profile
/Generic
198 $(call Image
/BuildKernel
/Template
,EASY50601
,$(ase_cmdline
))
199 $(call Image
/BuildKernel
/Template
,NONE
)
202 define Image
/Build
/Profile
/Generic
203 $(call Image
/Build
/$(1),$(1),EASY50601
)
204 $(call Image
/Build
/$(1),$(1),NONE
)
205 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
209 define Image
/BuildKernel
210 $(call Image
/BuildKernel
/Profile
/$(PROFILE
))
214 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
217 $(eval
$(call BuildImage
))