ext2.mk 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # Not qstrip-ing the variable, because it may contain spaces, but we must
  19. # qstrip it when checking. Furthermore, we need to further quote it, so
  20. # that the quotes do not get eaten by the echo statement when creating the
  21. # fakeroot script
  22. ifneq ($(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_LABEL)),)
  23. EXT2_OPTS += -l '$(BR2_TARGET_ROOTFS_EXT2_LABEL)'
  24. endif
  25. ROOTFS_EXT2_DEPENDENCIES = host-mke2img
  26. define ROOTFS_EXT2_CMD
  27. PATH=$(BR_PATH) mke2img -d $(TARGET_DIR) $(EXT2_OPTS) -o $@
  28. endef
  29. rootfs-ext2-symlink:
  30. ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT)
  31. .PHONY: rootfs-ext2-symlink
  32. ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)
  33. ROOTFS_EXT2_POST_TARGETS += rootfs-ext2-symlink
  34. endif
  35. $(eval $(call ROOTFS_TARGET,ext2))