2 # Copyright (C) 2010-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # boards missing since devicetree update
9 #EASY50712 ARV3527P GIGASX76X ARV4519PW BTHOMEHUBV2B BTHOMEHUBV2BOPENRG
12 include $(TOPDIR
)/rules.mk
13 include $(INCLUDE_DIR
)/image.mk
15 JFFS2_BLOCKSIZE
= 64k
128k
256k
18 $(STAGING_DIR_HOST
)/bin
/lzma e
$(1) $(2)
21 define PatchKernelLzma
22 cp
$(KDIR
)/vmlinux
$(KDIR
)/vmlinux-
$(1)
23 $(LINUX_DIR
)/scripts
/dtc
/dtc
-O dtb
-o
$(KDIR
)/$(1).dtb .
/$(1).dts
24 $(STAGING_DIR_HOST
)/bin
/patch-dtb
$(KDIR
)/vmlinux-
$(1) $(KDIR
)/$(1).dtb
25 $(call CompressLzma
,$(KDIR
)/vmlinux-
$(1),$(KDIR
)/vmlinux-
$(1).lzma
)
29 cp
$(KDIR
)/vmlinux
$(KDIR
)/vmlinux-
$(1)
30 $(LINUX_DIR
)/scripts
/dtc
/dtc
-O dtb
-o
$(KDIR
)/$(1).dtb .
/$(1).dts
31 $(STAGING_DIR_HOST
)/bin
/patch-dtb
$(KDIR
)/vmlinux-
$(1) $(KDIR
)/$(1).dtb
35 mkbrncmdline
-i
$(KDIR
)/vmlinux-
$(4) -o
$(KDIR
)/vmlinux-
$(4)-brn BRN-BOOT
$(6)
36 $(call CompressLzma
,$(KDIR
)/vmlinux-
$(4)-brn
,$(KDIR
)/vmlinux-
$(4)-brn.lzma
)
37 mkbrnimg
-s
$(1) -m
$(2) -o
$(3) $(KDIR
)/vmlinux-
$(4)-brn.lzma
$(KDIR
)/root.
$(5)
41 mkimage
-A mips
-O linux
-T kernel
-a
0x80002000 -C lzma \
42 -e
0x80002000 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
43 -d
$(KDIR
)/vmlinux-
$(1).lzma
$(KDIR
)/uImage-
$(1)
47 lzma2eva
0x80002000 0x80002000 $(KDIR
)/vmlinux-
$(1).lzma
$(KDIR
)/$(1).eva.prealign
48 dd if
=$(KDIR
)/$(1).eva.prealign of
=$(KDIR
)/$(1).eva bs
=64k conv
=sync
49 cat .
/eva.dummy.squashfs
>> $(KDIR
)/$(1).eva
56 define PatchKernelGzip
57 cp
$(KDIR
)/vmlinux
$(KDIR
)/vmlinux-
$(1)
58 $(STAGING_DIR_HOST
)/bin
/patch-cmdline
$(KDIR
)/vmlinux-
$(1) '$(strip $(2))'
59 $(call CompressGzip
,$(KDIR
)/vmlinux-
$(1),$(KDIR
)/vmlinux-
$(1).gzip
)
63 mkimage
-A mips
-O linux
-T kernel
-a
0x80002000 -C gzip \
64 -e
0x80002000 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
65 -d
$(KDIR
)/vmlinux-
$(1).gzip
$(KDIR
)/uImage-
$(1)
68 define Image
/Build
/squashfs
69 cat
$(KDIR
)/uImage-
$(2) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
70 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
)
71 $(if
$(3),$(call MkBrnImage
,$(3),$(4),$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(3)-brnImage
,$(2),$(1),$(5)))
74 define Image
/BuildEVA
/squashfs
75 cat
$(KDIR
)/$(2).eva
$(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image.eva
76 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image.eva
)
79 define Image
/BuildRaw
/squashfs
80 dd if
=$(KDIR
)/vmlinux-
$(2) of
=$(KDIR
)/vmlinux-
$(2)-$(1) bs
=1M conv
=sync
81 cat
$(KDIR
)/vmlinux-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
82 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
)
85 define Image
/BuildNANDEVA
/jffs2-128k
86 cp
$(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).rootfs
89 define Image
/Build
/jffs2-64k
90 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=64k conv
=sync
91 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
94 define Image
/Build
/jffs2-128k
95 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=128k conv
=sync
96 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
99 define Image
/Build
/jffs2-256k
100 dd if
=$(KDIR
)/uImage-
$(2) of
=$(KDIR
)/uImage-
$(2)-$(1) bs
=256k conv
=sync
101 cat
$(KDIR
)/uImage-
$(2)-$(1) $(KDIR
)/root.
$(1) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(1).image
104 define Image
/BuildKernel
/Template
105 $(call PatchKernelLzma
,$(1),$(if
$(2),$(2) machtype
=$(1),))
106 $(call MkImageLzma
,$(1))
107 $(CP
) $(KDIR
)/uImage-
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-uImage
110 define Image
/BuildKernelRaw
/Template
111 $(call PatchKernelRaw
,$(1))
112 $(CP
) $(KDIR
)/vmlinux-
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-vmlinux
115 define Image
/BuildKernelEVA
/Template
116 $(call PatchKernelLzma
,$(1),$(if
$(2),$(2) machtype
=$(1),))
117 $(call MkImageEVA
,$(1))
118 $(CP
) $(KDIR
)/$(1).eva
$(BIN_DIR
)/$(IMG_PREFIX
)-$(1).eva
121 define Image
/BuildKernelGzip
/Template
122 $(call PatchKernelGzip
,$(1),$(if
$(2),$(2) machtype
=$(1),))
123 $(call MkImageGzip
,$(1))
124 $(CP
) $(KDIR
)/uImage-
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-uImage
128 ifeq ($(CONFIG_TARGET_lantiq_falcon
),y
)
130 Image
/BuildKernel
/Profile
/EASY98000NOR
=$(call Image
/BuildKernel
/Template
,EASY98000NOR
)
131 Image
/Build
/Profile
/EASY98000NOR
=$(call Image
/Build
/$(1),$(1),EASY98000NOR
)
133 Image
/BuildKernel
/Profile
/EASY98000SFLASH
=$(call Image
/BuildKernel
/Template
,EASY98000SFLASH
)
134 Image
/Build
/Profile
/EASY98000SFLASH
=$(call Image
/Build
/$(1),$(1),EASY98000SFLASH
)
140 ifeq ($(CONFIG_TARGET_lantiq_ase
),y
)
142 Image
/BuildKernel
/Profile
/DGN1000B
=$(call Image
/BuildKernel
/Template
,DGN1000B
)
143 Image
/Build
/Profile
/DGN1000B
=$(call Image
/Build
/$(1),$(1),DGN1000B
)
149 ifeq ($(CONFIG_TARGET_lantiq_xway
),y
)
152 Image
/BuildKernel
/Profile
/EASY50712
=$(call Image
/BuildKernel
/Template
,EASY50712
)
153 Image
/Build
/Profile
/EASY50712
=$(call Image
/Build
/$(1),$(1),EASY50712
)
155 Image
/BuildKernel
/Profile
/ACMP252
=$(call Image
/BuildKernel
/Template
,ACMP252
)
156 Image
/Build
/Profile
/ACMP252
=$(call Image
/Build
/$(1),$(1),ACMP252
)
158 Image
/BuildKernel
/Profile
/ARV4510PW
=$(call Image
/BuildKernel
/Template
,ARV4510PW
)
159 Image
/Build
/Profile
/ARV4510PW
=$(call Image
/Build
/$(1),$(1),ARV4510PW
)
161 Image
/BuildKernel
/Profile
/ARV4525PW
=$(call Image
/BuildKernel
/Template
,ARV4525PW
)
162 Image
/Build
/Profile
/ARV4525PW
=$(call Image
/Build
/$(1),$(1),ARV4525PW
)
164 Image
/BuildKernel
/Profile
/ARV7525PW
=$(call Image
/BuildKernel
/Template
,ARV7525PW
)
165 Image
/Build
/Profile
/ARV7525PW
=$(call Image
/Build
/$(1),$(1),ARV7525PW
)
167 Image
/BuildKernel
/Profile
/ARV4518PWR01
=$(call Image
/BuildKernel
/Template
,ARV4518PWR01
)
168 Image
/Build
/Profile
/ARV4518PWR01
=$(call Image
/Build
/$(1),$(1),ARV4518PWR01
)
170 Image
/BuildKernel
/Profile
/ARV4518PWR01A
=$(call Image
/BuildKernel
/Template
,ARV4518PWR01A
)
171 Image
/Build
/Profile
/ARV4518PWR01A
=$(call Image
/Build
/$(1),$(1),ARV4518PWR01A
)
173 Image
/BuildKernel
/Profile
/ARV4520PW
=$(call Image
/BuildKernel
/Template
,ARV4520PW
)
174 Image
/Build
/Profile
/ARV4520PW
=$(call Image
/Build
/$(1),$(1),ARV4520PW
)
176 Image
/BuildKernel
/Profile
/ARV452CQW
=$(call Image
/BuildKernel
/Template
,ARV452CQW
)
177 Image
/Build
/Profile
/ARV452CQW
=$(call Image
/Build
/$(1),$(1),ARV452CQW
)
179 Image
/BuildKernel
/Profile
/ARV7518PW
=$(call Image
/BuildKernel
/Template
,ARV7518PW
)
180 Image
/Build
/Profile
/ARV7518PW
=$(call Image
/Build
/$(1),$(1),ARV7518PW
)
182 Image
/BuildKernel
/Profile
/ARV752DPW
=$(call Image
/BuildKernel
/Template
,ARV752DPW
)
183 Image
/Build
/Profile
/ARV752DPW
=$(call Image
/Build
/$(1),$(1),ARV752DPW
)
185 Image
/BuildKernel
/Profile
/ARV752DPW22
=$(call Image
/BuildKernel
/Template
,ARV752DPW22
)
186 Image
/Build
/Profile
/ARV752DPW22
=$(call Image
/Build
/$(1),$(1),ARV752DPW22
)
190 Image
/BuildKernel
/Profile
/DGN3500
=$(call Image
/BuildKernel
/Template
,DGN3500
)
191 Image
/Build
/Profile
/DGN3500
=$(call Image
/Build
/$(1),$(1),DGN3500
)
193 Image
/BuildKernel
/Profile
/DGN3500B
=$(call Image
/BuildKernel
/Template
,DGN3500
)
194 Image
/Build
/Profile
/DGN3500B
=$(call Image
/Build
/$(1),$(1),DGN3500
)
196 Image
/BuildKernel
/Profile
/WBMRA
=$(call Image
/BuildKernel
/Template
,WBMR
)
197 Image
/Build
/Profile
/WBMRA
=$(call Image
/Build
/$(1),$(1),WBMR
)
199 Image
/BuildKernel
/Profile
/WBMRB
=$(call Image
/BuildKernel
/Template
,WBMR
)
200 Image
/Build
/Profile
/WBMRB
=$(call Image
/Build
/$(1),$(1),WBMR
)
202 Image
/BuildKernel
/Profile
/FRITZ7320
=$(call Image
/BuildKernelEVA
/Template
,FRITZ7320
)
203 Image
/Build
/Profile
/FRITZ7320
=$(call Image
/BuildEVA
/$(1),$(1),FRITZ7320
)
207 Image
/BuildKernel
/Profile
/EASY80920NAND
=$(call Image
/BuildKernel
/Template
,EASY80920NAND
)
208 Image
/Build
/Profile
/EASY80920NAND
=$(call Image
/Build
/$(1),$(1),EASY80920NAND
)
210 Image
/BuildKernel
/Profile
/EASY80920NOR
=$(call Image
/BuildKernel
/Template
,EASY80920NOR
)
211 Image
/Build
/Profile
/EASY80920NOR
=$(call Image
/Build
/$(1),$(1),EASY80920NOR
)
213 Image
/BuildKernel
/Profile
/FRITZ3370
=$(call Image
/BuildKernelEVA
/Template
,FRITZ3370
)
214 Image
/Build
/Profile
/FRITZ3370
=$(call Image
/BuildNANDEVA
/$(1),$(1),FRITZ3370
)
216 Image
/BuildKernel
/Profile
/VG3503J
=$(call Image
/BuildKernelRaw
/Template
,VG3503J
)
217 Image
/Build
/Profile
/VG3503J
=$(call Image
/BuildRaw
/$(1),$(1),VG3503J
)
223 ifeq ($(CONFIG_TARGET_lantiq_svip_be
),y
)
225 Image
/BuildKernel
/Profile
/EASY33016
=$(call Image
/BuildKernelGzip
/Template
,EASY33016
)
226 Image
/Build
/Profile
/EASY33016
=$(call Image
/Build
/$(1),$(1),EASY33016
)
231 define Image
/BuildKernel
232 $(call Image
/BuildKernel
/Profile
/$(PROFILE
))
236 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
239 $(eval
$(call BuildImage
))