This commit is contained in:
TriForceX
2019-09-25 20:51:37 -03:00
commit 6203ff3e7c
11215 changed files with 428258 additions and 0 deletions

59
fs/f2fs/Config.in Normal file
View File

@@ -0,0 +1,59 @@
config BR2_TARGET_ROOTFS_F2FS
bool "f2fs root filesystem"
select BR2_PACKAGE_HOST_F2FS_TOOLS
help
Build a f2fs root filesystem. If you enable this option, you
probably want to enable the f2fs-tools package too.
if BR2_TARGET_ROOTFS_F2FS
config BR2_TARGET_ROOTFS_F2FS_LABEL
string "filesystem label"
config BR2_TARGET_ROOTFS_F2FS_SIZE
string "filesystem size"
default "100M"
help
The size of the filesystem image in bytes.
Suffix with K, M, G or T for power-of-two kilo-, mega-, giga-
or terabytes.
config BR2_TARGET_ROOTFS_F2FS_COLD_FILES
string "extension list for cold files"
help
Specify a comma separated file extension list in order f2fs
to treat them as cold files. The default list includes most
of multimedia file extensions such as jpg, gif, mpeg, mkv,
and so on.
config BR2_TARGET_ROOTFS_F2FS_HOT_FILES
string "extension list for hot files"
help
Specify a comma separated file extension list in order f2fs
to treat them as hot files. The default list includes only
a db extension.
config BR2_TARGET_ROOTFS_F2FS_OVERPROVISION
int "overprovision ratio"
default 0
help
The percentage over the volume size for overprovision
area. This area is hidden to users, and utilized by F2FS
cleaner.
Leave at 0 for autocalculation according to the partition
size.
config BR2_TARGET_ROOTFS_F2FS_DISCARD
bool "discard policy"
default y
help
Enable or disable discard policy.
config BR2_TARGET_ROOTFS_F2FS_FEATURES
string "filesystem features"
help
List of features that the F2FS filesystem should support
(e.g "encrypt")
endif # BR2_TARGET_ROOTFS_F2FS

45
fs/f2fs/f2fs.mk Normal file
View File

@@ -0,0 +1,45 @@
################################################################################
#
# 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_COLD_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_COLD_FILES))
F2FS_HOT_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_HOT_FILES))
ifeq ($(BR2_TARGET_ROOTFS_F2FS_DISCARD),y)
F2FS_DISCARD = 1
else
F2FS_DISCARD = 0
endif
F2FS_FEATURES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_FEATURES))
F2FS_OPTS = \
-f \
-l "$(F2FS_LABEL)" \
-t $(F2FS_DISCARD) \
-o $(BR2_TARGET_ROOTFS_F2FS_OVERPROVISION) \
$(if $(F2FS_COLD_FILES),-e "$(F2FS_COLD_FILES)") \
$(if $(F2FS_HOT_FILES),-E "$(F2FS_HOT_FILES)") \
$(if $(F2FS_FEATURES),-O "$(F2FS_FEATURES)")
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))