ubi.mk 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. ################################################################################
  2. #
  3. # Embed the ubifs image into an ubi image
  4. #
  5. ################################################################################
  6. UBI_UBINIZE_OPTS := -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE)
  7. UBI_UBINIZE_OPTS += -p $(BR2_TARGET_ROOTFS_UBI_PEBSIZE)
  8. ifneq ($(BR2_TARGET_ROOTFS_UBI_SUBSIZE),0)
  9. UBI_UBINIZE_OPTS += -s $(BR2_TARGET_ROOTFS_UBI_SUBSIZE)
  10. endif
  11. UBI_UBINIZE_OPTS += $(call qstrip,$(BR2_TARGET_ROOTFS_UBI_OPTS))
  12. ROOTFS_UBI_DEPENDENCIES = rootfs-ubifs
  13. ifeq ($(BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG),y)
  14. UBI_UBINIZE_CONFIG_FILE_PATH = $(call qstrip,$(BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE))
  15. else
  16. UBI_UBINIZE_CONFIG_FILE_PATH = fs/ubi/ubinize.cfg
  17. endif
  18. # don't use sed -i as it misbehaves on systems with SELinux enabled when this is
  19. # executed through fakeroot (see #9386)
  20. define ROOTFS_UBI_CMD
  21. sed 's;BR2_ROOTFS_UBIFS_PATH;$@fs;' \
  22. $(UBI_UBINIZE_CONFIG_FILE_PATH) > $(BUILD_DIR)/ubinize.cfg
  23. $(HOST_DIR)/sbin/ubinize -o $@ $(UBI_UBINIZE_OPTS) $(BUILD_DIR)/ubinize.cfg
  24. rm $(BUILD_DIR)/ubinize.cfg
  25. endef
  26. $(eval $(rootfs))