summaryrefslogtreecommitdiff
path: root/fs/initramfs/initramfs.mk
diff options
context:
space:
mode:
authorArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2011-09-06 23:16:09 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-09-27 22:46:00 +0200
commit13a3afc536b845e8de8eea9b91bbc6e7430c4566 (patch)
treee6c12ef1dc34eb5d70877b6c3c7a880958ddce34 /fs/initramfs/initramfs.mk
parent3fac21ef8d794b47f731003b399e704349c54346 (diff)
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 'fs/initramfs/initramfs.mk')
-rw-r--r--fs/initramfs/initramfs.mk35
1 files changed, 11 insertions, 24 deletions
diff --git a/fs/initramfs/initramfs.mk b/fs/initramfs/initramfs.mk
index 1cd48b6c8..f1eb8b6e6 100644
--- a/fs/initramfs/initramfs.mk
+++ b/fs/initramfs/initramfs.mk
@@ -1,36 +1,23 @@
#############################################################
#
-# Make a initramfs_list file to be used by gen_init_cpio
-# gen_init_cpio is part of the 2.6 linux kernels to build an
-# initial ramdisk filesystem based on cpio
+# Build a kernel with an integrated initial ramdisk
+# filesystem based on cpio.
#
#############################################################
-ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
+ROOTFS_INITRAMFS_DEPENDENCIES += rootfs-cpio
-define ROOTFS_INITRAMFS_ADD_INIT
- if [ ! -e $(TARGET_DIR)/init ]; then \
- ln -sf sbin/init $(TARGET_DIR)/init; \
- fi
-endef
+ROOTFS_INITRAMFS_POST_TARGETS += linux26-rebuild-with-initramfs
-else
-# devtmpfs does not get automounted when initramfs is used.
-# Add a pre-init script to mount it before running init
-define ROOTFS_INITRAMFS_ADD_INIT
- if [ ! -e $(TARGET_DIR)/init ]; then \
- $(INSTALL) -m 0755 fs/initramfs/init $(TARGET_DIR)/init; \
- fi
-endef
-endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
+# The generic fs infrastructure isn't very useful here.
-ROOTFS_INITRAMFS_PRE_GEN_HOOKS += ROOTFS_INITRAMFS_ADD_INIT
+rootfs-initramfs: $(ROOTFS_INITRAMFS_DEPENDENCIES) $(ROOTFS_INITRAMFS_POST_TARGETS)
-define ROOTFS_INITRAMFS_CMD
- $(SHELL) fs/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(TARGET_DIR) > $$@
-endef
+rootfs-initramfs-show-depends:
+ @echo $(ROOTFS_INITRAMFS_DEPENDENCIES)
-ROOTFS_INITRAMFS_POST_TARGETS += linux26-rebuild-with-initramfs
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+TARGETS += rootfs-initramfs
+endif
-$(eval $(call ROOTFS_TARGET,initramfs))