aboutsummaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorGravatar Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2011-09-06 23:16:09 +0200
committerGravatar Peter Korsgaard <jacmet@sunsite.dk>2011-09-27 22:46:00 +0200
commit13a3afc536b845e8de8eea9b91bbc6e7430c4566 (patch)
treee6c12ef1dc34eb5d70877b6c3c7a880958ddce34 /linux
parent3fac21ef8d794b47f731003b399e704349c54346 (diff)
downloadbuildroot-13a3afc536b845e8de8eea9b91bbc6e7430c4566.tar.gz
buildroot-13a3afc536b845e8de8eea9b91bbc6e7430c4566.tar.bz2
fs/initramfs: refactor with fs/cpio
An initramfs is in fact the same as a cpio archive, but embedded in the kernel. So instead of duplicating the cpio infrastructure, we can simply build images/rootfs.cpio and link that into the kernel. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'linux')
-rw-r--r--linux/linux.mk17
1 files changed, 7 insertions, 10 deletions
diff --git a/linux/linux.mk b/linux/linux.mk
index f249d96701..600b14d752 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -126,13 +126,13 @@ define LINUX_CONFIGURE_CMDS
$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config),
$(call KCONFIG_DISABLE_OPT,CONFIG_AEABI,$(@D)/.config))
# As the kernel gets compiled before root filesystems are
- # built, we create a fake initramfs file list. It'll be
- # replaced later by the real list, and the kernel will be
+ # built, we create a fake cpio file. It'll be
+ # replaced later by the real cpio archive, and the kernel will be
# rebuilt using the linux26-rebuild-with-initramfs target.
$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
- touch $(BINARIES_DIR)/rootfs.initramfs
+ touch $(BINARIES_DIR)/rootfs.cpio
$(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config)
- $(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.initramfs\",$(@D)/.config)
+ $(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config)
$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config)
$(call KCONFIG_DISABLE_OPT,CONFIG_INITRAMFS_COMPRESSION_NONE,$(@D)/.config)
@@ -190,13 +190,10 @@ linux-savedefconfig linux26-savedefconfig: dirs $(LINUX_DIR)/.stamp_configured
$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
$(subst linux-,,$(subst linux26-,,$@))
-# Support for rebuilding the kernel after the initramfs file list has
-# been generated in $(BINARIES_DIR)/rootfs.initramfs.
-$(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LINUX_DIR)/.stamp_images_installed $(BINARIES_DIR)/rootfs.initramfs
+# Support for rebuilding the kernel after the cpio archive has
+# been generated in $(BINARIES_DIR)/rootfs.cpio.
+$(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LINUX_DIR)/.stamp_images_installed $(BINARIES_DIR)/rootfs.cpio
@$(call MESSAGE,"Rebuilding kernel with initramfs")
- # Remove the previously generated initramfs which was empty,
- # to make sure the kernel will actually regenerate it.
- $(RM) -f $(@D)/usr/initramfs_data.cpio*
# Build the kernel.
$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_NAME)
# Copy the kernel image to its final destination