2
1
Эх сурвалжийг харах

fs/erofs: add config options for dedupe, fragments and ztailpacking

Add Kconfig toggles for a few more extended options that are useful for
reducing size and improving performance of EROFS images. Descriptions of the
config options were taken from the erofs-utils manpage.

Signed-off-by: Jan Čermák <sairon@sairon.cz>
[Arnout: fix Config.in help text and indentation]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Jan Čermák 5 сар өмнө
parent
commit
39aec97630
2 өөрчлөгдсөн 43 нэмэгдсэн , 0 устгасан
  1. 27 0
      fs/erofs/Config.in
  2. 16 0
      fs/erofs/erofs.mk

+ 27 - 0
fs/erofs/Config.in

@@ -58,6 +58,33 @@ config BR2_TARGET_ROOTFS_EROFS_LZMA_LEVEL
 
 endif # BR2_TARGET_ROOTFS_EROFS_LZMA
 
+config BR2_TARGET_ROOTFS_EROFS_DEDUPE
+	bool "enable data deduplication"
+	depends on !BR2_TARGET_ROOTFS_EROFS_NONE
+	help
+	  Enable global compressed data deduplication to reduce FS image
+	  size. Introduced in Linux 6.1.
+
+config BR2_TARGET_ROOTFS_EROFS_FRAGMENTS
+	bool "enable fragments packing"
+	help
+	  Pack the tail part (pcluster) of compressed files, or entire
+	  files, into a special inode for smaller image size.
+	  Introduced in Linux 6.1.
+
+config BR2_TARGET_ROOTFS_EROFS_ALL_FRAGMENTS
+	bool "enable fragments packing"
+	help
+	  Forcely record the whole files into a special inode for better
+	  compression. Introduced in Linux 6.1.
+
+config BR2_TARGET_ROOTFS_EROFS_ZTAILPACKING
+	bool "enable ztailpacking"
+	help
+	  Pack the tail part (pcluster) of compressed files into its
+	  metadata to save more space and the tail part I/O. Introduced
+	  in Linux 5.17.
+
 config BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE
 	int "pcluster size"
 	default 0

+ 16 - 0
fs/erofs/erofs.mk

@@ -22,6 +22,22 @@ ifneq ($(BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE),0)
 ROOTFS_EROFS_ARGS += -C$(strip $(BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE))
 endif
 
+ifeq ($(BR2_TARGET_ROOTFS_EROFS_DEDUPE),y)
+ROOTFS_EROFS_ARGS += -Ededupe
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_EROFS_FRAGMENTS),y)
+ROOTFS_EROFS_ARGS += -Efragments
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_EROFS_ALL_FRAGMENTS),y)
+ROOTFS_EROFS_ARGS += -Eall-fragments
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_EROFS_ZTAILPACKING),y)
+ROOTFS_EROFS_ARGS += -Eztailpacking
+endif
+
 define ROOTFS_EROFS_CMD
 	$(HOST_DIR)/bin/mkfs.erofs $(ROOTFS_EROFS_ARGS) $@ $(TARGET_DIR)
 endef