commit:     7436269f07727daf13eabef57c6cc936e4e294e2
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 15 20:57:46 2021 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Mar 15 21:02:24 2021 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=7436269f

genkernel: fix used kernel.config

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

 genkernel | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/genkernel b/genkernel
index 046e0e3..e6424ba 100755
--- a/genkernel
+++ b/genkernel
@@ -478,8 +478,10 @@ fi
 
 if isTrue "${BUILD_RAMDISK}"
 then
+       kconfig_file_used="${KERNEL_OUTPUTDIR}/.config"
        if ! isTrue "${BUILD_KERNEL}"
        then
+               kconfig_file_used="${KERNEL_CONFIG}"
                INITRAMFS_FILE="${TMPDIR}/${GK_FILENAME_TEMP_INITRAMFS}"
                isTrue "${CMD_INSTALL}" && 
INITRAMFS_FILE="${BOOTDIR}/${GK_FILENAME_INITRAMFS}"
 
@@ -524,8 +526,8 @@ then
                print_warning 1 '"man genkernel" explains "dozfs" in detail.'
        fi
 
-       CONFGREP_CMD=$(get_grep_cmd_for_file "${KERNEL_CONFIG}")
-       if [ $("${CONFGREP_CMD}" 'CONFIG_EXT[0-9]_FS=' "${KERNEL_CONFIG}" | wc 
-l) -ge 2 ]
+       CONFGREP_CMD=$(get_grep_cmd_for_file "${kconfig_file_used}")
+       if [ $("${CONFGREP_CMD}" 'CONFIG_EXT[0-9]_FS=' "${kconfig_file_used}" | 
wc -l) -ge 2 ]
        then
                print_warning 1 ''
                print_warning 1 'With support for several ext* filesystems 
available, it may be needed to'
@@ -533,17 +535,17 @@ then
        fi
        unset CONFGREP_CMD
 
-       cfg_CONFIG_CMDLINE_OVERRIDE=$(kconfig_get_opt "${KERNEL_CONFIG}" 
CONFIG_CMDLINE_OVERRIDE)
+       cfg_CONFIG_CMDLINE_OVERRIDE=$(kconfig_get_opt "${kconfig_file_used}" 
CONFIG_CMDLINE_OVERRIDE)
        if [ "${cfg_CONFIG_CMDLINE_OVERRIDE}" = "y" ]
        then
-               cfg_CONFIG_CMDLINE=$(kconfig_get_opt "${KERNEL_CONFIG}" 
CONFIG_CMDLINE)
+               cfg_CONFIG_CMDLINE=$(kconfig_get_opt "${kconfig_file_used}" 
CONFIG_CMDLINE)
                print_warning 1 ''
                print_warning 1 "${BOLD}Note:${NORMAL}"
                print_warning 1 'You have set CONFIG_CMDLINE_OVERRIDE=y.'
                print_warning 1 "You will be unable to alter set kernel 
parameters (${cfg_CONFIG_CMDLINE}) at runtime!"
                unset cfg_CONFIG_CMDLINE
        fi
-       unset cfg_CONFIG_CMDLINE_OVERRIDE
+       unset cfg_CONFIG_CMDLINE_OVERRIDE kconfig_file_used
 fi
 
 isTrue "${CMD_INSTALL}" && restore_boot_mount_state

Reply via email to