ext2.mk 1.4 KB

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