2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(INCLUDE_DIR)/prereq.mk
10 include $(INCLUDE_DIR)/kernel.mk
11 include $(INCLUDE_DIR)/host.mk
12 include $(INCLUDE_DIR)/version.mk
14 override MAKE:=$(_SINGLE)$(SUBMAKE)
15 override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
17 KDIR=$(KERNEL_BUILD_DIR)
19 DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
21 sanitize = $(call tolower,$(subst _,-,$(1)))
23 DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
24 EXTRA_NAME_SANITIZED=$(call sanitize,$(EXTRA_IMAGE_NAME))
26 IMG_PREFIX:=$(DIST_SANITIZED)-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(if $(EXTRA_NAME_SANITIZED),$(EXTRA_NAME_SANITIZED)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
28 MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
30 ifneq ($(CONFIG_BIG_ENDIAN),)
31 JFFS2OPTS := --big-endian --squash-uids -v
33 JFFS2OPTS := --little-endian --squash-uids -v
36 ifeq ($(CONFIG_JFFS2_RTIME),y)
39 ifeq ($(CONFIG_JFFS2_ZLIB),y)
42 ifeq ($(CONFIG_JFFS2_LZMA),y)
43 JFFS2OPTS += -X lzma --compression-mode=size
45 ifneq ($(CONFIG_JFFS2_RTIME),y)
48 ifneq ($(CONFIG_JFFS2_ZLIB),y)
51 ifneq ($(CONFIG_JFFS2_LZMA),y)
55 JFFS2OPTS += $(MKFS_DEVTABLE_OPT)
57 SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k
58 SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
59 SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
61 LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
62 ifeq ($(CONFIG_SQUASHFS_LZMA),y)
63 SQUASHFSCOMP := lzma $(LZMA_XZ_OPTIONS)
65 ifeq ($(CONFIG_SQUASHFS_XZ),y)
66 ifneq ($(filter arm x86 powerpc sparc,$(LINUX_KARCH)),)
67 BCJ_FILTER:=-Xbcj $(LINUX_KARCH)
69 SQUASHFSCOMP := xz $(LZMA_XZ_OPTIONS) $(BCJ_FILTER)
72 JFFS2_BLOCKSIZE ?= 64k 128k
74 fs-types-$(CONFIG_TARGET_ROOTFS_SQUASHFS) += squashfs
75 fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addprefix jffs2-,$(JFFS2_BLOCKSIZE))
76 fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2_NAND) += $(addprefix jffs2-nand-,$(NAND_BLOCKSIZE))
77 fs-types-$(CONFIG_TARGET_ROOTFS_EXT4FS) += ext4
78 fs-types-$(CONFIG_TARGET_ROOTFS_ISO) += iso
79 fs-subtypes-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addsuffix -raw,$(addprefix jffs2-,$(JFFS2_BLOCKSIZE)))
80 fs-subtypes-$(CONFIG_TARGET_ROOTFS_CPIOGZ) += cpiogz
81 fs-subtypes-$(CONFIG_TARGET_ROOTFS_TARGZ) += targz
83 TARGET_FILESYSTEMS := $(fs-types-y)
85 FS_64K := $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-64k
86 FS_128K := $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-128k
87 FS_256K := $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-256k
90 echo -ne '\xde\xad\xc0\xde' >> $(1)
93 PROFILE_SANITIZED := $(call sanitize,$(PROFILE))
98 $(subst $(space),^,$(1))), \
99 $(call $(2),$(strip $(subst ^,$(space),$(data)))))
103 $(if $(Build/$(word 1,$(1))),,$(error Missing Build/$(word 1,$(1))))
104 $(call Build/$(word 1,$(1)),$(wordlist 2,$(words $(1)),$(1)))
109 $(call split_args,$(1),build_cmd)
112 # pad to 4k, 8k, 16k, 64k, 128k, 256k and add jffs2 end-of-filesystem mark
113 define prepare_generic_squashfs
114 $(STAGING_DIR_HOST)/bin/padjffs2 $(1) 4 8 16 64 128 256
117 define Image/BuildKernel/Initramfs
118 $(call Image/Build/Initramfs)
121 define Image/BuildKernel/MkuImage
122 mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
123 -n '$(call toupper,$(ARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $(4) $(5)
126 define Image/BuildKernel/MkFIT
127 $(TOPDIR)/scripts/mkits.sh \
128 -D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
129 -A $(ARCH) -v $(LINUX_VERSION)
130 PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
133 # $(1) source dts file
134 # $(2) target dtb file
135 # $(3) extra CPP flags
136 # $(4) extra DTC flags
137 define Image/BuildDTB
138 $(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
140 -I$(DTS_DIR)/include \
141 -undef -D__DTS__ $(3) \
143 $(LINUX_DIR)/scripts/dtc/dtc -O dtb \
149 define Image/mkfs/jffs2/sub
150 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) --pad -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2) -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
151 $(call add_jffs2_mark,$(KDIR)/root.jffs2-$(2))
154 define Image/mkfs/jffs2/sub-raw
155 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2)-raw -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
158 define Image/mkfs/jffs2/template
159 Image/mkfs/jffs2-$(1) = $$(call Image/mkfs/jffs2/sub,$(1),$(1),$(JFFS2OPTS))
160 Image/mkfs/jffs2-$(1)-raw = $$(call Image/mkfs/jffs2/sub-raw,$(1),$(1),$(JFFS2OPTS))
164 define Image/mkfs/jffs2-nand/template
165 Image/mkfs/jffs2-nand-$(1) = \
166 $$(call Image/mkfs/jffs2/sub, \
167 $(word 2,$(subst -, ,$(1))),nand-$(1), \
168 $(JFFS2OPTS) --no-cleanmarkers --pagesize=$(word 1,$(subst -, ,$(1))))
172 $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/template,$(S))))
173 $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))))
175 define Image/mkfs/squashfs
176 $(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) -processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1)
182 ifneq ($(CONFIG_NAND_SUPPORT),)
183 define Image/Build/SysupgradeNAND
184 mkdir -p "$(KDIR_TMP)/sysupgrade-$(1)/"
185 echo "BOARD=$(1)" > "$(KDIR_TMP)/sysupgrade-$(1)/CONTROL"
186 [ -z "$(2)" ] || $(CP) "$(KDIR)/root.$(2)" "$(KDIR_TMP)/sysupgrade-$(1)/root"
187 [ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel"
188 (cd "$(KDIR_TMP)"; $(TAR) cvf \
189 "$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1))
193 # $(2) ubinize-image options (e.g. --uboot-env and/or --kernel kernelimage)
194 # $(3) rootfstype (e.g. squashfs or ubifs)
195 # $(4) options to pass-through to ubinize (i.e. $($(PROFILE)_UBI_OPTS)))
196 define Image/Build/UbinizeImage
197 sh $(TOPDIR)/scripts/ubinize-image.sh $(2) \
198 "$(KDIR)/root.$(3)" \
199 "$(KDIR)/$(IMG_PREFIX)-$(1)-$(3)-ubinized.bin" \
205 ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
206 define Image/mkfs/ubifs/generate
207 $(CP) ./ubinize$(1).cfg $(KDIR)
209 $(STAGING_DIR_HOST)/bin/ubinize \
210 $(if $($(PROFILE)_UBI_OPTS), \
211 $(shell echo $($(PROFILE)_UBI_OPTS)), \
212 $(shell echo $(UBI_OPTS)) \
214 -o $(KDIR)/root$(1).ubi \
219 define Image/mkfs/ubifs
221 ifneq ($($(PROFILE)_UBIFS_OPTS)$(UBIFS_OPTS),)
222 $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
223 $(if $($(PROFILE)_UBIFS_OPTS), \
224 $(shell echo $($(PROFILE)_UBIFS_OPTS)), \
225 $(shell echo $(UBIFS_OPTS)) \
227 $(if $(CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP),--space-fixup) \
228 $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_NONE),--force-compr=none) \
229 $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_LZO),--force-compr=lzo) \
230 $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_ZLIB),--force-compr=zlib) \
231 $(if $(shell echo $(CONFIG_TARGET_UBIFS_JOURNAL_SIZE)),--jrn-size=$(CONFIG_TARGET_UBIFS_JOURNAL_SIZE)) \
233 -o $(KDIR)/root.ubifs \
236 $(call Image/Build,ubifs)
238 ifneq ($($(PROFILE)_UBI_OPTS)$(UBI_OPTS),)
239 $(if $(wildcard ./ubinize.cfg),$(call Image/mkfs/ubifs/generate,))
240 $(if $(wildcard ./ubinize-overlay.cfg),$(call Image/mkfs/ubifs/generate,-overlay))
242 $(if $(wildcard ./ubinize.cfg),$(call Image/Build,ubi))
246 define Image/mkfs/cpiogz
247 ( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
250 define Image/mkfs/targz
251 $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
254 E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
256 define Image/mkfs/ext4
257 $(STAGING_DIR_HOST)/bin/make_ext4fs \
258 -l $(E2SIZE) -b $(CONFIG_TARGET_EXT4_BLOCKSIZE) \
259 -i $(CONFIG_TARGET_EXT4_MAXINODE) \
260 -m $(CONFIG_TARGET_EXT4_RESERVED_PCT) \
261 $(if $(CONFIG_TARGET_EXT4_JOURNAL),,-J) \
262 $(KDIR)/root.ext4 $(TARGET_DIR)/
265 define Image/mkfs/prepare/default
266 # Use symbolic permissions to avoid clobbering SUID/SGID/sticky bits
267 - $(FIND) $(TARGET_DIR) -type f -not -perm /0100 -not -name 'ssh_host*' -not -name 'shadow' -print0 | $(XARGS) -0 chmod u+rw,g+r,o+r
268 - $(FIND) $(TARGET_DIR) -type f -perm /0100 -print0 | $(XARGS) -0 chmod u+rwx,g+rx,o+rx
269 - $(FIND) $(TARGET_DIR) -type d -print0 | $(XARGS) -0 chmod u+rwx,g+rx,o+rx
270 $(INSTALL_DIR) $(TARGET_DIR)/tmp $(TARGET_DIR)/overlay
271 chmod 1777 $(TARGET_DIR)/tmp
274 define Image/mkfs/prepare
275 $(call Image/mkfs/prepare/default)
279 define Image/Checksum
281 $(FIND) -maxdepth 1 -type f \! -name 'md5sums' -printf "%P\n" | sort | xargs $1 > $2 \
285 define BuildImage/mkfs
288 mkfs-$(1): kernel_prepare
290 $(call Build/mkfs/default,$(1))
291 $(call Build/mkfs/$(1),$(1))
292 $(KDIR)/root.$(1): mkfs-$(1)
296 # Build commands that can be called from Device/* templates
298 mkimage -A $(LINUX_KARCH) \
300 -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
301 -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new
305 define Build/netgear-chk
306 $(STAGING_DIR_HOST)/bin/mkchkimg \
309 -b $(NETGEAR_BOARD_ID) \
314 define Build/netgear-dni
315 $(STAGING_DIR_HOST)/bin/mkdniimg \
316 -B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
317 $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
324 $(TOPDIR)/scripts/mkits.sh \
325 -D $(DEVICE_NAME) -o $@.its -k $@ \
326 $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
327 -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
328 -A $(ARCH) -v $(LINUX_VERSION)
329 PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
334 $(STAGING_DIR_HOST)/bin/lzma e $@ -lc1 -lp2 -pb2 $(1) $@.new
339 gzip -9n -c $@ $(1) > $@.new
344 rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
345 mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
346 cp $@ $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$(1) && \
347 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 --pad \
348 $(if $(CONFIG_BIG_ENDIAN),--big-endian,--little-endian) \
349 --squash-uids -v -e $(patsubst %k,%KiB,$(BLOCKSIZE)) \
351 -d $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 \
352 2>&1 1>/dev/null | awk '/^.+$$$$/' && \
353 $(STAGING_DIR_HOST)/bin/padjffs2 $@.new -J $(patsubst %k,,$(BLOCKSIZE))
354 -rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/
358 define Build/kernel-bin
363 define Build/patch-cmdline
364 $(STAGING_DIR_HOST)/bin/patch-cmdline $@ '$(CMDLINE)'
367 define Build/append-kernel
368 dd if=$(word 1,$^) $(if $(1),bs=$(1) conv=sync) >> $@
371 define Build/append-rootfs
372 dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
375 define Build/append-ubi
376 sh $(TOPDIR)/scripts/ubinize-image.sh \
377 $(if $(KERNEL_IN_UBI),--kernel $(word 1,$^)) \
380 -p $(BLOCKSIZE) -m $(PAGESIZE) -E 5 \
381 $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE))
387 dd if=$@ of=$@.new bs=$(1) conv=sync
391 define Build/pad-rootfs
392 $(call prepare_generic_squashfs,$@ $(1))
395 define Build/pad-offset
397 size="$$(stat -c%s $@)" \
398 pad="$(word 1, $(1))" \
399 offset="$(word 2, $(1))" \
400 pad="(pad - ((size + offset) % pad)) % pad" \
401 newsize='size + pad'; \
402 dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync
406 define Build/check-size
407 @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
408 echo "WARNING: Image file $@ is too big" >&2; \
413 define Build/combined-image
414 -sh $(TOPDIR)/scripts/combined-image.sh \
421 define Build/sysupgrade-nand
422 sh $(TOPDIR)/scripts/sysupgrade-nand.sh \
423 --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
424 --kernel $(word 1,$^) \
425 --rootfs $(word 2,$^) \
430 PROFILES := $(PROFILE)
433 KERNEL_INITRAMFS = $$(KERNEL)
437 IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
438 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
440 KERNEL_SUFFIX := -kernel.bin
441 KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX)
442 KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-initramfs
443 KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_SUFFIX)
444 KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
446 KERNEL_NAME := vmlinux
450 FILESYSTEMS := $(TARGET_FILESYSTEMS)
453 define Device/ExportVar
454 $(1) : $(2):=$$($(2))
458 $(foreach var,$(DEVICE_VARS) DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE,$(call Device/ExportVar,$(1),$(var)))
459 $(1) : FILESYSTEM:=$(2)
463 _TARGET = $$(if $$(filter $(PROFILE),$$(PROFILES)),install,install-disabled)
464 _COMPILE_TARGET = $$(if $(if $(IB),,$(CONFIG_IB)$$(filter $(PROFILE),$$(PROFILES))),compile,compile-disabled)
468 define Device/Build/initramfs
469 $(call Device/Export,$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE),$(1))
470 $$(_TARGET): $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)
472 $(KDIR)/$$(KERNEL_INITRAMFS_NAME):: image_prepare
473 $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
476 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
478 $$(call concat_cmd,$$(KERNEL_INITRAMFS))
482 define Device/Build/check_size
483 @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
484 echo "WARNING: Image file $@ is too big" >&2; \
489 define Device/Build/compile
490 $$(_COMPILE_TARGET): $(KDIR)/$(1)
491 $(eval $(call Device/Export,$(KDIR)/$(1)))
493 $$(call concat_cmd,$(COMPILE/$(1)))
497 define Device/Build/kernel
498 _KERNEL_IMAGES += $(KDIR)/$$(KERNEL_NAME)
499 $(KDIR)/$$(KERNEL_NAME):: image_prepare
500 $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
501 $(call Device/Export,$(KDIR)/$$(KERNEL_IMAGE),$(1))
502 $(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE)
506 install: $(KDIR)/$$(KERNEL_IMAGE)
508 $(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
510 $$(call concat_cmd,$$(KERNEL))
511 $$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
515 define Device/Build/image
516 $$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))
517 $(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1)))
518 $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/$$(KERNEL_IMAGE) $(KDIR)/root.$(1)
520 [ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ]
521 $$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2))))
523 .IGNORE: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))
524 $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
530 $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
531 $(call Device/Build/kernel,$(1))
533 $$(eval $$(foreach compile,$$(COMPILE), \
534 $$(call Device/Build/compile,$$(compile),$(1))))
536 $$(eval $$(foreach image,$$(IMAGES), \
537 $$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \
538 $$(call Device/Build/image,$$(fs),$$(image),$(1)))))
542 $(call Device/Init,$(1))
543 $(call Device/Default,$(1))
544 $(call Device/Check,$(1))
545 $(call Device/$(1),$(1))
546 $(call Device/Build,$(1))
559 .PHONY: download prepare compile clean image_prepare mkfs_prepare kernel_prepare install
561 $(call Build/Compile)
566 image_prepare: compile
568 $(call Image/Prepare)
574 mkfs_prepare: image_prepare
575 $(call Image/mkfs/prepare)
577 kernel_prepare: mkfs_prepare
578 $(call Image/BuildKernel)
579 $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(call Image/BuildKernel/Initramfs)))
580 $(call Image/InstallKernel)
582 $(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
583 $(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))
585 install: kernel_prepare
586 $(foreach fs,$(TARGET_FILESYSTEMS),
587 $(call Image/Build,$(fs))
589 $(call Image/mkfs/ubifs)
590 $(call Image/Checksum,md5sum --binary,md5sums)
591 $(call Image/Checksum,openssl dgst -sha256,sha256sums)