initramfs.mk 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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