ext2.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ################################################################################
  2. #
  3. # Build the ext2 root filesystem image
  4. #
  5. ################################################################################
  6. EXT2_OPTS = -G $(BR2_TARGET_ROOTFS_EXT2_GEN) -R $(BR2_TARGET_ROOTFS_EXT2_REV)
  7. ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
  8. EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
  9. endif
  10. EXT2_OPTS += -B $(BR2_TARGET_ROOTFS_EXT2_EXTRA_BLOCKS)
  11. ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0)
  12. EXT2_OPTS += -i $(BR2_TARGET_ROOTFS_EXT2_INODES)
  13. endif
  14. EXT2_OPTS += -I $(BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES)
  15. ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
  16. EXT2_OPTS += -r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
  17. endif
  18. # qstrip results in stripping consecutive spaces into a single one. So the
  19. # variable is not qstrip-ed to preserve the integrity of the string value.
  20. EXT2_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
  21. ifneq ($(EXT2_LABEL),)
  22. EXT2_OPTS += -l "$(EXT2_LABEL)"
  23. endif
  24. ROOTFS_EXT2_DEPENDENCIES = host-mke2img
  25. define ROOTFS_EXT2_CMD
  26. PATH=$(BR_PATH) mke2img -d $(TARGET_DIR) $(EXT2_OPTS) -o $@
  27. endef
  28. rootfs-ext2-symlink:
  29. ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT)
  30. .PHONY: rootfs-ext2-symlink
  31. ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)
  32. ROOTFS_EXT2_POST_TARGETS += rootfs-ext2-symlink
  33. endif
  34. $(eval $(call ROOTFS_TARGET,ext2))