1################################################################################ 2# 3# Build a kernel with an integrated initial ramdisk filesystem based on cpio. 4# 5################################################################################ 6 7# The generic fs infrastructure isn't very useful here. 8# 9# The initramfs image does not actually build an image; its only purpose is: 10# 1- to ensure rootfs.cpio is generated, 11# 2- to then rebuild the kernel with rootfs.cpio as initramfs 12# 13# Note: ordering of the dependencies is not guaranteed here, but in 14# linux/linux.mk, via the linux-rebuild-with-initramfs rule, which depends 15# on the rootfs-cpio filesystem rule. 16# 17# Note: the trick here is that we directly depend on rebuilding the Linux 18# kernel image (which itself depends on the rootfs-cpio rule), while we 19# advertise that our dependency is on the rootfs-cpio rule, which is 20# cleaner in the dependency graph. 21 22rootfs-initramfs: linux-rebuild-with-initramfs 23 24rootfs-initramfs-show-depends: 25 @echo rootfs-cpio 26 27.PHONY: rootfs-initramfs rootfs-initramfs-show-depends 28 29ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y) 30TARGETS_ROOTFS += rootfs-initramfs 31endif 32 33# Not using the rootfs infra, so fake the variables 34ROOTFS_INITRAMFS_NAME = rootfs-initramfs 35ROOTFS_INITRAMFS_TYPE = rootfs 36ROOTFS_INITRAMFS_DEPENDENCIES = rootfs-cpio linux 37