You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/profiles/templates/3.6/6_ac_install_patch/sys-kernel/calculate-sources/5.12/4503_zstd-patches_3.patch

48 lines
1.4 KiB

# Calculate format=diff
From 6e4686daf7ef33cc8b3d4934e4585cfd4e79a8be Mon Sep 17 00:00:00 2001
From: torvic9 <torvic9@mailbox.org>
Date: Fri, 2 Apr 2021 16:00:26 +0200
Subject: [PATCH 3/4] allow setting zstd compression level for modules
Signed-off-by: torvic9 <torvic9@mailbox.org>
---
Makefile | 2 +-
init/Kconfig | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e5536960a..7c4c6f602 100644
--- a/Makefile
+++ b/Makefile
@@ -1078,7 +1078,7 @@ ifdef CONFIG_MODULE_COMPRESS
mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f
endif # CONFIG_MODULE_COMPRESS_XZ
ifdef CONFIG_MODULE_COMPRESS_ZSTD
- mod_compress_cmd = $(ZSTD) -T0 --rm -f -q
+ mod_compress_cmd = $(ZSTD) -T0 -$(CONFIG_MODULE_COMPRESS_ZSTD_LEVEL) --rm -f -q
endif # CONFIG_MODULE_COMPRESS_ZSTD
endif # CONFIG_MODULE_COMPRESS
export mod_compress_cmd
diff --git a/init/Kconfig b/init/Kconfig
index 34384e4a1..98197e83f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2284,6 +2284,14 @@ config MODULE_COMPRESS_ZSTD
endchoice
+config MODULE_COMPRESS_ZSTD_LEVEL
+ int "Compression level (1-19)"
+ depends on MODULE_COMPRESS_ZSTD
+ range 1 19
+ default 3
+ help
+ Compression level used by zstd for compressing modules.
+
config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
bool "Allow loading of modules with missing namespace imports"
help
--
2.31.1.305.gd1b10fc6d8