Files
buildroot/fs/f2fs/f2fs.mk
Grzegorz Blach 6f727ce1fe fs/f2fs: add support for creating a f2fs image
This patch makes possible to create rootfs image using f2fs
filesystem.

Signed-off-by: Grzegorz Blach <grzegorz@blach.pl>
[Thomas:
 - keep only the minimal functionality, as suggested by Yann E. Morin
 - use truncate -s instead of dd to create the initial empty image
   file, as suggested by Yann E. Morin]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-11-03 15:14:47 +01:00

31 lines
855 B
Makefile

################################################################################
#
# 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))
# ")
F2FS_OPTS = \
-f \
-l "$(F2FS_LABEL)"
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))