include/image.mk: do not make initramfs build exclusive

Allow building initramfs along with other types of filesystems.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 37050
This commit is contained in:
Florian Fainelli 2013-06-27 19:58:35 +00:00
parent 6a4f2922f6
commit f5a0a578f8
2 changed files with 19 additions and 23 deletions

View file

@ -78,7 +78,6 @@ menu "Target Images"
config TARGET_ROOTFS_EXT4FS config TARGET_ROOTFS_EXT4FS
bool "ext4" bool "ext4"
default y if USES_EXT4 default y if USES_EXT4
depends on !TARGET_ROOTFS_INITRAMFS
help help
Ext4 file system with some free space for uml images Ext4 file system with some free space for uml images
@ -86,35 +85,32 @@ menu "Target Images"
bool "iso" bool "iso"
default n default n
depends on TARGET_x86_generic depends on TARGET_x86_generic
depends on !TARGET_ROOTFS_INITRAMFS
help help
Create some bootable ISO image Create some bootable ISO image
config TARGET_ROOTFS_JFFS2 config TARGET_ROOTFS_JFFS2
bool "jffs2" bool "jffs2"
default y if USES_JFFS2 default y if USES_JFFS2
depends on !TARGET_ROOTFS_INITRAMFS
help help
Build a jffs2 root filesystem Build a jffs2 root filesystem
config TARGET_ROOTFS_JFFS2_NAND config TARGET_ROOTFS_JFFS2_NAND
bool "jffs2 for NAND" bool "jffs2 for NAND"
default y if USES_JFFS2_NAND default y if USES_JFFS2_NAND
depends on !TARGET_ROOTFS_INITRAMFS && USES_JFFS2_NAND depends on USES_JFFS2_NAND
help help
Build a jffs2 root filesystem for NAND flash Build a jffs2 root filesystem for NAND flash
config TARGET_ROOTFS_SQUASHFS config TARGET_ROOTFS_SQUASHFS
bool "squashfs" bool "squashfs"
default y if USES_SQUASHFS default y if USES_SQUASHFS
depends on !TARGET_ROOTFS_INITRAMFS
help help
Build a squashfs-lzma root filesystem Build a squashfs-lzma root filesystem
config TARGET_ROOTFS_UBIFS config TARGET_ROOTFS_UBIFS
bool "ubifs" bool "ubifs"
default y if USES_UBIFS default y if USES_UBIFS
depends on !TARGET_ROOTFS_INITRAMFS && USES_UBIFS depends on USES_UBIFS
help help
Build a ubifs root filesystem Build a ubifs root filesystem

View file

@ -67,47 +67,47 @@ define prepare_generic_squashfs
$(STAGING_DIR_HOST)/bin/padjffs2 $(1) 4 8 64 128 256 $(STAGING_DIR_HOST)/bin/padjffs2 $(1) 4 8 64 128 256
endef endef
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
define Image/BuildKernel/Initramfs
define Image/BuildKernel cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(IMG_PREFIX)-initramfs-vmlinux.elf
cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
$(call Image/Build/Initramfs) $(call Image/Build/Initramfs)
endef endef
else else
define Image/BuildKernel/Initramfs
endef
endif
define Image/mkfs/jffs2/sub define Image/mkfs/jffs2/sub
# FIXME: removing this line will cause strange behaviour in the foreach loop below # FIXME: removing this line will cause strange behaviour in the foreach loop below
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2) -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/' $(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2) -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
$(call add_jffs2_mark,$(KDIR)/root.jffs2-$(2)) $(call add_jffs2_mark,$(KDIR)/root.jffs2-$(2))
$(call Image/Build,jffs2-$(2)) $(call Image/Build,jffs2-$(2))
endef endef
ifneq ($(CONFIG_TARGET_ROOTFS_JFFS2),) ifneq ($(CONFIG_TARGET_ROOTFS_JFFS2),)
define Image/mkfs/jffs2 define Image/mkfs/jffs2
$(foreach SZ,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/sub,$(SZ),$(SZ),$(JFFS2OPS))) $(foreach SZ,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/sub,$(SZ),$(SZ),$(JFFS2OPS)))
endef endef
endif endif
ifneq ($(CONFIG_TARGET_ROOTFS_JFFS2_NAND),) ifneq ($(CONFIG_TARGET_ROOTFS_JFFS2_NAND),)
define Image/mkfs/jffs2_nand define Image/mkfs/jffs2_nand
$(foreach SZ,$(NAND_BLOCKSIZE), $(call Image/mkfs/jffs2/sub, \ $(foreach SZ,$(NAND_BLOCKSIZE), $(call Image/mkfs/jffs2/sub, \
$(word 2,$(subst :, ,$(SZ))),nand-$(subst :,-,$(SZ)), \ $(word 2,$(subst :, ,$(SZ))),nand-$(subst :,-,$(SZ)), \
$(JFFS2OPTS) --no-cleanmarkers --pagesize=$(word 1,$(subst :, ,$(SZ)))) \ $(JFFS2OPTS) --no-cleanmarkers --pagesize=$(word 1,$(subst :, ,$(SZ)))) \
) )
endef endef
endif endif
ifneq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),) ifneq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),)
define Image/mkfs/squashfs define Image/mkfs/squashfs
@mkdir -p $(TARGET_DIR)/overlay @mkdir -p $(TARGET_DIR)/overlay
$(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) $(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)
$(call Image/Build,squashfs) $(call Image/Build,squashfs)
endef endef
endif endif
ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),) ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
define Image/mkfs/ubifs define Image/mkfs/ubifs
$(CP) ./ubinize.cfg $(KDIR) $(CP) ./ubinize.cfg $(KDIR)
$(STAGING_DIR_HOST)/bin/mkfs.ubifs $(UBIFS_OPTS) -o $(KDIR)/root.ubifs -d $(TARGET_DIR) $(STAGING_DIR_HOST)/bin/mkfs.ubifs $(UBIFS_OPTS) -o $(KDIR)/root.ubifs -d $(TARGET_DIR)
@ -116,8 +116,6 @@ else
$(STAGING_DIR_HOST)/bin/ubinize $(UBINIZE_OPTS) -o $(KDIR)/root.ubi ubinize.cfg) $(STAGING_DIR_HOST)/bin/ubinize $(UBINIZE_OPTS) -o $(KDIR)/root.ubi ubinize.cfg)
$(call Image/Build,ubi) $(call Image/Build,ubi)
endef endef
endif
endif endif
ifneq ($(CONFIG_TARGET_ROOTFS_CPIOGZ),) ifneq ($(CONFIG_TARGET_ROOTFS_CPIOGZ),)
@ -193,6 +191,7 @@ define BuildImage
$(call Image/Prepare) $(call Image/Prepare)
$(call Image/mkfs/prepare) $(call Image/mkfs/prepare)
$(call Image/BuildKernel) $(call Image/BuildKernel)
$(call Image/BuildKernel/Initramfs)
$(call Image/mkfs/cpiogz) $(call Image/mkfs/cpiogz)
$(call Image/mkfs/targz) $(call Image/mkfs/targz)
$(call Image/mkfs/ext4) $(call Image/mkfs/ext4)
@ -205,6 +204,7 @@ define BuildImage
else else
install: compile install-targets install: compile install-targets
$(call Image/BuildKernel) $(call Image/BuildKernel)
$(call Image/BuildKernel/Initramfs)
$(call Image/mkfs/cpiogz) $(call Image/mkfs/cpiogz)
$(call Image/mkfs/targz) $(call Image/mkfs/targz)
$(call Image/mkfs/ext4) $(call Image/mkfs/ext4)