initramfs.mk 1.3 KB

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