From 39aec97630e63559af2b84832da91e074582445d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Fri, 14 Feb 2025 12:21:38 +0100 Subject: [PATCH] fs/erofs: add config options for dedupe, fragments and ztailpacking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 [Arnout: fix Config.in help text and indentation] Signed-off-by: Arnout Vandecappelle --- fs/erofs/Config.in | 27 +++++++++++++++++++++++++++ fs/erofs/erofs.mk | 16 ++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/fs/erofs/Config.in b/fs/erofs/Config.in index 2041a0034e..91f51b76d7 100644 --- a/fs/erofs/Config.in +++ b/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 diff --git a/fs/erofs/erofs.mk b/fs/erofs/erofs.mk index e8d30bace8..3b64cb1c6e 100644 --- a/fs/erofs/erofs.mk +++ b/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