Skip to content

Commit

Permalink
init: add support for zstd compressed modules
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
  • Loading branch information
sirlucjan authored and xanmod committed Oct 15, 2020
1 parent a82da6f commit 324aac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,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
Expand All @@ -1054,6 +1054,9 @@ ifdef CONFIG_MODULE_COMPRESS
ifdef CONFIG_MODULE_COMPRESS_XZ
mod_compress_cmd = $(XZ) -f
endif # CONFIG_MODULE_COMPRESS_XZ
ifdef CONFIG_MODULE_COMPRESS_ZSTD
mod_compress_cmd = $(ZSTD) -T0 -20 --ultra --rm -f
endif
endif # CONFIG_MODULE_COMPRESS
export mod_compress_cmd

Expand Down
9 changes: 6 additions & 3 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2214,8 +2214,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.

Expand All @@ -2237,14 +2237,17 @@ 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"

config MODULE_COMPRESS_XZ
bool "XZ"

config MODULE_COMPRESS_ZSTD
bool "ZSTD"

endchoice

config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
Expand Down

0 comments on commit 324aac9

Please sign in to comment.