commit:     80e3a6086c92e30101f772170c4b056f1ff4c81c
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 15 22:05:53 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 14:29:17 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=80e3a608

Add ZSTD compression support for initramfs

Bug: https://bugs.gentoo.org/731294
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 defaults/compression_methods.sh | 5 +++++
 doc/genkernel.8.txt             | 3 ++-
 gen_cmdline.sh                  | 2 +-
 gen_funcs.sh                    | 2 ++
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/defaults/compression_methods.sh b/defaults/compression_methods.sh
index 41ee9c4..b65f057 100644
--- a/defaults/compression_methods.sh
+++ b/defaults/compression_methods.sh
@@ -35,3 +35,8 @@ GKICM_XZ_KOPTNAME="XZ"
 GKICM_XZ_CMD="xz -e --check=none -z -f -9"
 GKICM_XZ_EXT=".xz"
 GKICM_XZ_PKG="app-arch/xz-utils"
+
+GKICM_ZSTD_KOPTNAME="ZSTD"
+GKICM_ZSTD_CMD="zstd -f -19 -q"
+GKICM_ZSTD_EXT=".zst"
+GKICM_ZSTD_PKG="app-arch/zstd"

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 40c591e..5b15a02 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -598,7 +598,8 @@ NOTE: System.map filename and System.map symlink name must 
be different.
     Deprecated alias for *--*[*no-*]*compress-initramfs*.
 
 *--compress-initramfs-type*=<arg>::
-    Compression type for initramfs (best, bzip2, fastest, gzip, lz4, lzma, 
lza, xz).
+    Compression type for initramfs (best, bzip2, fastest, gzip, lz4, lzma,
+    lza, xz, zstd).
 +
 *best* will select the algorithm providing best compression
 from those selected in your kernel configuration.

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 1daee5c..5e667bd 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -244,7 +244,7 @@ longusage() {
   echo "       --no-compress-initrd    Deprecated alias for 
--no-compress-initramfs"
   echo "       --compress-initramfs-type=<arg>"
   echo "                               Compression type for initramfs (best, 
bzip2, fastest, gzip, lz4,"
-  echo "                               lzma, lza, xz)"
+  echo "                               lzma, lza, xz, zstd)"
   echo "       --strip=(all|kernel|modules|none)"
   echo "                               Strip debug symbols from none, all, 
installed kernel (obsolete) or"
   echo "                               modules (default)"

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 69e7242..a58fbbb 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -468,6 +468,7 @@ get_initramfs_compression_method_by_compression() {
        local -a methods=()
        methods+=( XZ )
        methods+=( LZMA )
+       methods+=( ZSTD )
        methods+=( GZIP )
        methods+=( BZIP2 )
        methods+=( LZO )
@@ -479,6 +480,7 @@ get_initramfs_compression_method_by_compression() {
 get_initramfs_compression_method_by_speed() {
        local -a methods=()
        methods+=( LZ4 )
+       methods+=( ZSTD )
        methods+=( LZO )
        methods+=( GZIP )
        methods+=( BZIP2 )

Reply via email to