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 xway_cmdline
=-console
=ttyS1
,115200 rootfstype
=squashfs
,jffs2
13 falcon_cmdline
=-console
=ttyS0
,115200 rootfstype
=squashfs
,jffs2
16 $(STAGING_DIR_HOST
)/bin
/lzma e
$(1) $(2)
19 define PatchKernelLzma
20 cp
$(KDIR
)/vmlinux
$(KDIR
)/vmlinux-
$(1)
21 $(STAGING_DIR_HOST
)/bin
/patch-cmdline
$(KDIR
)/vmlinux-
$(1) '$(strip $(2))'
22 $(call CompressLzma
,$(KDIR
)/vmlinux-
$(1),$(KDIR
)/vmlinux-
$(1).lzma
)
26 mkimage
-A mips
-O linux
-T kernel
-a
0x80002000 -C lzma \
27 -e
0x80002000 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
28 -d
$(KDIR
)/vmlinux-
$(1).lzma
$(KDIR
)/uImage-
$(1)
31 define Image
/Build
/squashfs
32 cat
$(KDIR
)/uImage-
$(2) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
33 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
)
36 define Image
/Build
/jffs2-64k
37 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=64k conv
=sync
38 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
41 define Image
/Build
/jffs2-128k
42 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=128k conv
=sync
43 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
46 define Image
/Build
/jffs2-256k
47 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=256k conv
=sync
48 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
51 define Image
/BuildKernel
/Template
52 $(call PatchKernelLzma
,$(1),$(if
$(2),$(2) machtype
=$(1),))
53 $(call MkImageLzma
,$(1))
54 $(CP
) $(KDIR
)/uImage-
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-uImage
57 ifeq ($(CONFIG_TARGET_lantiq_xway
),y
)
58 define Image
/BuildKernel
/Profile
/EASY50712
59 $(call Image
/BuildKernel
/Template
,EASY50712
,$(xway_cmdline
))
62 define Image
/Build
/Profile
/EASY50712
63 $(call Image
/Build
/$(1),$(1),EASY50712
)
66 define Image
/BuildKernel
/Profile
/EASY50812
67 $(call Image
/BuildKernel
/Template
,EASY50812
,$(xway_cmdline
))
70 define Image
/Build
/Profile
/EASY50812
71 $(call Image
/Build
/$(1),$(1),EASY50812
)
74 define Image
/BuildKernel
/Profile
/ARV3527P
75 $(call Image
/BuildKernel
/Template
,ARV3527P
,$(xway_cmdline
))
78 define Image
/Build
/Profile
/ARV3527P
79 $(call Image
/Build
/$(1),$(1),ARV3527P
)
82 define Image
/BuildKernel
/Profile
/ARV4510PW
83 $(call Image
/BuildKernel
/Template
,ARV4510PW
,$(xway_cmdline
))
86 define Image
/Build
/Profile
/ARV4510PW
87 $(call Image
/Build
/$(1),$(1),ARV4510PW
)
90 define Image
/BuildKernel
/Profile
/ARV4518PW
91 $(call Image
/BuildKernel
/Template
,ARV4518PW
,$(xway_cmdline
))
94 define Image
/Build
/Profile
/ARV4518PW
95 $(call Image
/Build
/$(1),$(1),ARV4518PW
)
98 define Image
/BuildKernel
/Profile
/ARV4520PW
99 $(call Image
/BuildKernel
/Template
,ARV4520PW
,$(xway_cmdline
))
102 define Image
/Build
/Profile
/ARV4520PW
103 $(call Image
/Build
/$(1),$(1),ARV4520PW
)
106 define Image
/BuildKernel
/Profile
/ARV4525PW
107 $(call Image
/BuildKernel
/Template
,ARV4525PW
,$(xway_cmdline
))
110 define Image
/Build
/Profile
/ARV4525PW
111 $(call Image
/Build
/$(1),$(1),ARV4525PW
)
114 define Image
/BuildKernel
/Profile
/ARV452CPW
115 $(call Image
/BuildKernel
/Template
,ARV452CPW
,$(xway_cmdline
))
118 define Image
/Build
/Profile
/ARV452CPW
119 $(call Image
/Build
/$(1),$(1),ARV452CPW
)
122 define Image
/BuildKernel
/Profile
/ARV7518PW
123 $(call Image
/BuildKernel
/Template
,ARV7518PW
,$(xway_cmdline
))
126 define Image
/Build
/Profile
/ARV7518PW
127 $(call Image
/Build
/$(1),$(1),ARV7518PW
)
130 define Image
/BuildKernel
/Profile
/ARV752DPW22
131 $(call Image
/BuildKernel
/Template
,ARV752DPW22
,$(xway_cmdline
))
134 define Image
/Build
/Profile
/ARV752DPW22
135 $(call Image
/Build
/$(1),$(1),ARV752DPW22
)
138 define Image
/BuildKernel
/Profile
/Generic
139 $(call Image
/BuildKernel
/Template
,EASY4010
,$(xway_cmdline
))
140 $(call Image
/BuildKernel
/Template
,EASY50712
,$(xway_cmdline
))
141 $(call Image
/BuildKernel
/Template
,EASY50812
,$(xway_cmdline
))
142 $(call Image
/BuildKernel
/Template
,ARV3527P
,$(xway_cmdline
))
143 $(call Image
/BuildKernel
/Template
,ARV4510PW
,$(xway_cmdline
))
144 $(call Image
/BuildKernel
/Template
,ARV4518PW
,$(xway_cmdline
))
145 $(call Image
/BuildKernel
/Template
,ARV4520PW
,$(xway_cmdline
))
146 $(call Image
/BuildKernel
/Template
,ARV452CPW
,$(xway_cmdline
))
147 $(call Image
/BuildKernel
/Template
,ARV4525PW
,$(xway_cmdline
))
148 $(call Image
/BuildKernel
/Template
,ARV7518PW
,$(xway_cmdline
))
149 $(call Image
/BuildKernel
/Template
,ARV752DPW
,$(xway_cmdline
))
150 $(call Image
/BuildKernel
/Template
,ARV752DPW22
,$(xway_cmdline
))
151 $(call Image
/BuildKernel
/Template
,NONE
)
154 define Image
/Build
/Profile
/Generic
155 $(call Image
/Build
/$(1),$(1),EASY4010
)
156 $(call Image
/Build
/$(1),$(1),EASY50712
)
157 $(call Image
/Build
/$(1),$(1),EASY50812
)
158 $(call Image
/Build
/$(1),$(1),ARV3527P
)
159 $(call Image
/Build
/$(1),$(1),ARV4510PW
)
160 $(call Image
/Build
/$(1),$(1),ARV4518PW
)
161 $(call Image
/Build
/$(1),$(1),ARV4520PW
)
162 $(call Image
/Build
/$(1),$(1),ARV452CPW
)
163 $(call Image
/Build
/$(1),$(1),ARV4525PW
)
164 $(call Image
/Build
/$(1),$(1),ARV7518PW
)
165 $(call Image
/Build
/$(1),$(1),ARV752DPW
)
166 $(call Image
/Build
/$(1),$(1),ARV752DPW22
)
167 $(call Image
/Build
/$(1),$(1),NONE
)
168 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
172 ifeq ($(CONFIG_TARGET_lantiq_falcon
),y
)
173 define Image
/BuildKernel
/Profile
/Generic
174 $(call Image
/BuildKernel
/Template
,EASY98000
,$(falcon_cmdline
))
175 $(call Image
/BuildKernel
/Template
,EASY98020
,$(falcon_cmdline
))
176 $(call Image
/BuildKernel
/Template
,NONE
)
179 define Image
/Build
/Profile
/Generic
180 $(call Image
/Build
/$(1),$(1),EASY98000
)
181 $(call Image
/Build
/$(1),$(1),EASY98020
)
182 $(call Image
/Build
/$(1),$(1),NONE
)
183 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).rootfs
187 define Image
/BuildKernel
188 $(call Image
/BuildKernel
/Profile
/$(PROFILE
))
192 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
195 $(eval
$(call BuildImage
))