All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] init: add support for zstd compressed modules
@ 2021-01-13 14:50 >
  0 siblings, 0 replies; 12+ messages in thread
From: > @ 2021-01-13 14:50 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Piotr Gorski

From: Piotr Gorski <lucjan.lucjanov@gmail.com>

kmod 28 supports modules compressed in zstd format so let's add this possibility to kernel.

Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
---
 Makefile     | 7 +++++--
 init/Kconfig | 9 ++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index cf54d33ba863..90986a3f5897 100644
--- a/Makefile
+++ b/Makefile
@@ -1049,8 +1049,8 @@ endif # INSTALL_MOD_STRIP
 export mod_strip_cmd
 
 # CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed
-# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP
-# or CONFIG_MODULE_COMPRESS_XZ.
+# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP,
+# CONFIG_MODULE_COMPRESS_XZ, or CONFIG_MODULE_COMPRESS_ZSTD.
 
 mod_compress_cmd = true
 ifdef CONFIG_MODULE_COMPRESS
@@ -1060,6 +1060,9 @@ ifdef CONFIG_MODULE_COMPRESS
   ifdef CONFIG_MODULE_COMPRESS_XZ
     mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f
   endif # CONFIG_MODULE_COMPRESS_XZ
+  ifdef CONFIG_MODULE_COMPRESS_ZSTD
+    mod_compress_cmd = $(ZSTD) -T0 -9 --rm -f
+  endif # CONFIG_MODULE_COMPRESS_ZSTD
 endif # CONFIG_MODULE_COMPRESS
 export mod_compress_cmd
 
diff --git a/init/Kconfig b/init/Kconfig
index b77c60f8b963..11d7dfea98b6 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2216,8 +2216,8 @@ config MODULE_COMPRESS
 	bool "Compress modules on installation"
 	help
 
-	  Compresses kernel modules when 'make modules_install' is run; gzip or
-	  xz depending on "Compression algorithm" below.
+	  Compresses kernel modules when 'make modules_install' is run; gzip,
+	  xz, or zstd depending on "Compression algorithm" below.
 
 	  module-init-tools MAY support gzip, and kmod MAY support gzip and xz.
 
@@ -2239,7 +2239,7 @@ choice
 	  This determines which sort of compression will be used during
 	  'make modules_install'.
 
-	  GZIP (default) and XZ are supported.
+	  GZIP (default), XZ, and ZSTD are supported.
 
 config MODULE_COMPRESS_GZIP
 	bool "GZIP"
@@ -2247,6 +2247,9 @@ config MODULE_COMPRESS_GZIP
 config MODULE_COMPRESS_XZ
 	bool "XZ"
 
+config MODULE_COMPRESS_ZSTD
+	bool "ZSTD"
+
 endchoice
 
 config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
-- 
2.30.0.81.g72c4083ddf


^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH] init: add support for zstd compressed modules
@ 2021-03-30 11:32 Piotr Gorski
  2021-03-30 11:50 ` Oleksandr Natalenko
  2021-04-07 14:32 ` Masahiro Yamada
  0 siblings, 2 replies; 12+ messages in thread
From: Piotr Gorski @ 2021-03-30 11:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-kbuild, Oleksandr Natalenko, Masahiro Yamada, Piotr Gorski

kmod 28 supports modules compressed in zstd format so let's add this possibility to kernel.

Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
---
 Makefile     | 7 +++++--
 init/Kconfig | 9 ++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 5160ff8903c1..82f4f4cc2955 100644
--- a/Makefile
+++ b/Makefile
@@ -1156,8 +1156,8 @@ endif # INSTALL_MOD_STRIP
 export mod_strip_cmd
 
 # CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed
-# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP
-# or CONFIG_MODULE_COMPRESS_XZ.
+# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP,
+# CONFIG_MODULE_COMPRESS_XZ, or CONFIG_MODULE_COMPRESS_ZSTD.
 
 mod_compress_cmd = true
 ifdef CONFIG_MODULE_COMPRESS
@@ -1167,6 +1167,9 @@ ifdef CONFIG_MODULE_COMPRESS
   ifdef CONFIG_MODULE_COMPRESS_XZ
     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
+  endif # CONFIG_MODULE_COMPRESS_ZSTD
 endif # CONFIG_MODULE_COMPRESS
 export mod_compress_cmd
 
diff --git a/init/Kconfig b/init/Kconfig
index 8c2cfd88f6ef..86a452bc2747 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2250,8 +2250,8 @@ config MODULE_COMPRESS
 	bool "Compress modules on installation"
 	help
 
-	  Compresses kernel modules when 'make modules_install' is run; gzip or
-	  xz depending on "Compression algorithm" below.
+	  Compresses kernel modules when 'make modules_install' is run; gzip,
+	  xz, or zstd depending on "Compression algorithm" below.
 
 	  module-init-tools MAY support gzip, and kmod MAY support gzip and xz.
 
@@ -2273,7 +2273,7 @@ choice
 	  This determines which sort of compression will be used during
 	  'make modules_install'.
 
-	  GZIP (default) and XZ are supported.
+	  GZIP (default), XZ, and ZSTD are supported.
 
 config MODULE_COMPRESS_GZIP
 	bool "GZIP"
@@ -2281,6 +2281,9 @@ config MODULE_COMPRESS_GZIP
 config MODULE_COMPRESS_XZ
 	bool "XZ"
 
+config MODULE_COMPRESS_ZSTD
+	bool "ZSTD"
+
 endchoice
 
 config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
-- 
2.31.0.97.g1424303384


^ permalink raw reply related	[flat|nested] 12+ messages in thread
[parent not found: <722602000.5829.1617263646814@office.mailbox.org>]

end of thread, other threads:[~2021-04-07 17:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13 14:50 [PATCH] init: add support for zstd compressed modules >
2021-03-30 11:32 Piotr Gorski
2021-03-30 11:50 ` Oleksandr Natalenko
2021-03-31 17:39   ` Nick Terrell
2021-03-31 17:48     ` Oleksandr Natalenko
2021-03-31 19:21       ` Nick Terrell
2021-03-31 20:28         ` Oleksandr Natalenko
2021-04-07 13:53         ` Masahiro Yamada
2021-04-07 17:45           ` Nick Terrell
2021-04-07 14:32 ` Masahiro Yamada
     [not found] <722602000.5829.1617263646814@office.mailbox.org>
2021-04-01  8:01 ` torvic9
2021-04-01 19:18 ` Nick Terrell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.