aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-07-14 16:42:53 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-07-16 16:29:15 +0200
commit550341ce8adf4fed720939050f36a53d6044227d (patch)
tree8cea0268fb772c7841bff81193e31ea89dbcbf3b
parentgen_configkernel.sh: set_initramfs_compression_method() refactored (diff)
downloadgenkernel-550341ce8adf4fed720939050f36a53d6044227d.tar.gz
genkernel-550341ce8adf4fed720939050f36a53d6044227d.tar.bz2
genkernel-550341ce8adf4fed720939050f36a53d6044227d.zip
gen_configkernel.sh: config_kernel(): Re-order config checks
Re-order config checks for better logical grouping. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-xgen_configkernel.sh47
1 files 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