commit:     550341ce8adf4fed720939050f36a53d6044227d
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 14 14:42:53 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 14:29:15 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=550341ce

gen_configkernel.sh: config_kernel(): Re-order config checks

Re-order config checks for better logical grouping.

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

 gen_configkernel.sh | 47 +++++++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 6ee57ed..b76d1b7 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -333,25 +333,35 @@ config_kernel() {
        local -a required_kernel_options
        [ -f "${KCONFIG_MODIFIED_MARKER}" ] && rm "${KCONFIG_MODIFIED_MARKER}"
 
-       # Ensure kernel supports initramfs
        if isTrue "${BUILD_RAMDISK}"
        then
+               # We really need this or we will fail to boot
+               print_info 2 "$(get_indent 1)>> Ensure that required kernel 
options for genkernel's initramfs usage are set ..."
+
+               # Ensure kernel supports initramfs
                kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_BLK_DEV_INITRD" "y"
-       fi
 
-       # --integrated-initramfs handling
-       if isTrue "${INTEGRATED_INITRAMFS}"
-       then
-               local cfg_CONFIG_INITRAMFS_SOURCE=$(kconfig_get_opt 
"${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE")
-               if [[ -n "${cfg_CONFIG_INITRAMFS_SOURCE}" && 
${#cfg_CONFIG_INITRAMFS_SOURCE} -gt 2 ]]
+               # Stuff required by init script
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_TTY" "y" \
+                       && required_kernel_options+=( 'CONFIG_TTY' )
+
+               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_UNIX98_PTYS" "y" \
+                       && required_kernel_options+=( 'CONFIG_UNIX98_PTYS' )
+
+               # --integrated-initramfs handling
+               if isTrue "${INTEGRATED_INITRAMFS}"
+               then
+                       local cfg_CONFIG_INITRAMFS_SOURCE=$(kconfig_get_opt 
"${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE")
+                       if [[ -n "${cfg_CONFIG_INITRAMFS_SOURCE}" && 
${#cfg_CONFIG_INITRAMFS_SOURCE} -gt 2 ]]
+                       then
+                               # Checking value length to allow 
'CONFIG_INITRAMFS_SOURCE=' and 'CONFIG_INITRAMFS_SOURCE=""'
+                               print_info 2 "$(get_indent 1)>> 
CONFIG_INITRAMFS_SOURCE is already set; Unsetting to avoid clashing with 
--integrated-initramfs ..."
+                               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_INITRAMFS_SOURCE" ""
+                       fi
+               elif isTrue "${COMPRESS_INITRD}"
                then
-                       # Checking value length to allow 
'CONFIG_INITRAMFS_SOURCE=' and 'CONFIG_INITRAMFS_SOURCE=""'
-                       print_info 2 "$(get_indent 1)>> CONFIG_INITRAMFS_SOURCE 
is already set; Unsetting to avoid clashing with --integrated-initramfs ..."
-                       kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_INITRAMFS_SOURCE" ""
+                       set_initramfs_compression_method 
"${KERNEL_OUTPUTDIR}/.config"
                fi
-       elif isTrue "${COMPRESS_INITRD}"
-       then
-               set_initramfs_compression_method "${KERNEL_OUTPUTDIR}/.config"
        fi
 
        # Force this on if we are using --genzimage
@@ -443,17 +453,6 @@ config_kernel() {
                fi
        fi
 
-       if isTrue "${BUILD_RAMDISK}"
-       then
-               # We really need this or we will fail to boot
-               print_info 2 "$(get_indent 1)>> Ensure that required kernel 
options for genkernel's initramfs usage are set ..."
-               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_TTY" "y" \
-                       && required_kernel_options+=( 'CONFIG_TTY' )
-
-               kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" 
"CONFIG_UNIX98_PTYS" "y" \
-                       && required_kernel_options+=( 'CONFIG_UNIX98_PTYS' )
-       fi
-
        # If the user has configured DM as built-in, we need to respect that.
        local cfg_CONFIG_BLK_DEV_DM=$(kconfig_get_opt 
"${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM")
        case "${cfg_CONFIG_BLK_DEV_DM}" in

Reply via email to