2018-10-26 22:00:16 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Build the f2fs root filesystem image
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
F2FS_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_SIZE))
|
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_F2FS)-$(F2FS_SIZE),y-)
|
|
|
|
$(error BR2_TARGET_ROOTFS_F2FS_SIZE cannot be empty)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# qstrip results in stripping consecutive spaces into a single one. So the
|
|
|
|
# variable is not qstrip-ed to preserve the integrity of the string value.
|
|
|
|
F2FS_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_F2FS_LABEL))
|
|
|
|
# ")
|
2018-11-03 15:17:02 +01:00
|
|
|
F2FS_COLD_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_COLD_FILES))
|
2018-11-06 15:06:45 +01:00
|
|
|
F2FS_HOT_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_HOT_FILES))
|
2018-10-26 22:00:16 +02:00
|
|
|
|
2018-11-03 15:29:32 +01:00
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_F2FS_DISCARD),y)
|
|
|
|
F2FS_DISCARD = 1
|
|
|
|
else
|
|
|
|
F2FS_DISCARD = 0
|
|
|
|
endif
|
|
|
|
|
2018-11-03 15:32:52 +01:00
|
|
|
F2FS_FEATURES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_FEATURES))
|
|
|
|
|
2018-10-26 22:00:16 +02:00
|
|
|
F2FS_OPTS = \
|
|
|
|
-f \
|
2018-11-03 15:17:02 +01:00
|
|
|
-l "$(F2FS_LABEL)" \
|
2018-11-03 15:29:32 +01:00
|
|
|
-t $(F2FS_DISCARD) \
|
2018-11-06 15:06:46 +01:00
|
|
|
-o $(BR2_TARGET_ROOTFS_F2FS_OVERPROVISION) \
|
2018-11-03 15:27:27 +01:00
|
|
|
$(if $(F2FS_COLD_FILES),-e "$(F2FS_COLD_FILES)") \
|
2018-11-06 15:06:45 +01:00
|
|
|
$(if $(F2FS_HOT_FILES),-E "$(F2FS_HOT_FILES)") \
|
2018-11-03 15:32:52 +01:00
|
|
|
$(if $(F2FS_FEATURES),-O "$(F2FS_FEATURES)")
|
2018-10-26 22:00:16 +02:00
|
|
|
|
|
|
|
ROOTFS_F2FS_DEPENDENCIES = host-f2fs-tools
|
|
|
|
|
|
|
|
define ROOTFS_F2FS_CMD
|
|
|
|
$(RM) -f $@
|
|
|
|
truncate -s $(F2FS_SIZE) $@
|
|
|
|
$(HOST_DIR)/sbin/mkfs.f2fs $(F2FS_OPTS) $@
|
|
|
|
$(HOST_DIR)/sbin/sload.f2fs -f $(TARGET_DIR) $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(rootfs))
|