commit:     a864c2fa9a75c488355a9f4821aa5bc97cc188c5
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 16 17:56:38 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 17:56:38 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=a864c2fa

gen_initramfs.sh: create_initramfs(): Call set_initramfs_compression_method() 
when not building kernel

We need to call set_initramfs_compression_method() manually when we didn't build
kernel in same run to ensure that $COMPRESS_INITRD_TYPE is initialized.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_initramfs.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 617c656..ba7b5e8 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1912,6 +1912,13 @@ create_initramfs() {
        else
                if isTrue "${COMPRESS_INITRD}"
                then
+                       if ! isTrue "${BUILD_KERNEL}"
+                       then
+                               # We need to initialize COMPRESS_INITRD_TYPE in 
case it was set
+                               # to best/fastest
+                               set_initramfs_compression_method 
"${KERNEL_OUTPUTDIR}/.config"
+                       fi
+
                        print_info 1 "$(get_indent 1)>> Compressing cpio data 
(${GKICM_LOOKUP_TABLE_EXT[${COMPRESS_INITRD_TYPE}]}) ..."
                        print_info 3 "COMMAND: 
${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE}]} ${CPIO_ARCHIVE}" 1 0 1
                        ${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE}]} 
"${CPIO_ARCHIVE}" || gen_die "Initramfs compression using 
'${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE}]}' failed"

Reply via email to