aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-07-13 14:17:24 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-07-14 13:58:11 +0200
commitfdce503a4aba5b153b68f80a1a04463658133cf2 (patch)
tree591ff6ea0dd9f4a20c47df3c91386e3a078ef7ba /gen_configkernel.sh
parentgen_configkernel.sh: config_kernel(): Make use of KCONFIG_MODIFIED_MARKER (diff)
downloadgenkernel-fdce503a4aba5b153b68f80a1a04463658133cf2.tar.gz
genkernel-fdce503a4aba5b153b68f80a1a04463658133cf2.tar.bz2
genkernel-fdce503a4aba5b153b68f80a1a04463658133cf2.zip
gen_configkernel.sh: Refactor config_kernel()
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_configkernel.sh')
-rwxr-xr-xgen_configkernel.sh315
1 files changed, 160 insertions, 155 deletions
diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 224e86d0..63f38b0b 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -72,19 +72,18 @@ determine_kernel_config_file() {
}
config_kernel() {
- cd "${KERNEL_DIR}" || gen_die 'Could not switch to the kernel directory!'
+ cd "${KERNEL_DIR}" || gen_die "Failed to chdir to '${KERNEL_DIR}'!"
print_info 1 "kernel: >> Initializing ..."
-
if isTrue "${CLEAN}" && isTrue "${MRPROPER}"
then
- print_info 2 "$(getIndent 1)>> --mrproper is set; Skipping 'make clean' ..."
+ print_info 2 "$(get_indent 1)>> --mrproper is set; Skipping 'make clean' ..."
elif isTrue "${CLEAN}" && ! isTrue "${MRPROPER}"
then
- print_info 1 "$(getIndent 1)>> Cleaning ..."
+ print_info 1 "$(get_indent 1)>> Running 'make clean' ..."
compile_generic clean kernel
else
- print_info 1 "$(getIndent 1)>> --clean is disabled; not running 'make clean'."
+ print_info 1 "$(get_indent 1)>> --no-clean is set; Skipping 'make clean' ..."
fi
if isTrue "${MRPROPER}" || [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ]
@@ -94,55 +93,55 @@ config_kernel() {
then
# Current .config is different then one we are going to use
if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] || \
- ! diff -q "${KERNEL_OUTPUTDIR}"/.config "${KERNEL_CONFIG}" > /dev/null
+ ! diff -q "${KERNEL_OUTPUTDIR}"/.config "${KERNEL_CONFIG}" >/dev/null
then
NOW=$(date +--%Y-%m-%d--%H-%M-%S)
cp "${KERNEL_OUTPUTDIR}/.config" "${KERNEL_OUTPUTDIR}/.config${NOW}.bak" \
|| gen_die "Could not backup kernel config (${KERNEL_OUTPUTDIR}/.config)"
- print_info 1 "$(getIndent 1)>> Previous config backed up to .config${NOW}.bak"
+ print_info 1 "$(get_indent 1)>> Previous config backed up to .config${NOW}.bak"
[ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] &&
- rm "${KERNEL_OUTPUTDIR}/.config" > /dev/null
+ rm "${KERNEL_OUTPUTDIR}/.config" >/dev/null
fi
fi
fi
if isTrue "${MRPROPER}"
then
- print_info 1 "$(getIndent 1)>> Running mrproper ..."
+ print_info 1 "$(get_indent 1)>> Running 'make mrproper' ..."
compile_generic mrproper kernel
else
if [ -f "${KERNEL_OUTPUTDIR}/.config" ]
then
- print_info 1 "$(getIndent 1)>> Using config from ${KERNEL_OUTPUTDIR}/.config"
+ print_info 1 "$(get_indent 1)>> Using config from '${KERNEL_OUTPUTDIR}/.config' ..."
else
- print_info 1 "$(getIndent 1)>> Using config from ${KERNEL_CONFIG}"
+ print_info 1 "$(get_indent 1)>> Using config from '${KERNEL_CONFIG}' ..."
fi
- print_info 1 "$(getIndent 1)>> --mrproper is disabled; not running 'make mrproper'."
+ print_info 1 "$(get_indent 1)>> --no-mrproper is set; Skipping 'make mrproper' ..."
fi
# If we're not cleaning a la mrproper, then we don't want to try to overwrite the configs
# or we might remove configurations someone is trying to test.
if isTrue "${MRPROPER}" || [ ! -f "${KERNEL_OUTPUTDIR}/.config" ]
then
- print_info 1 "$(getIndent 1)>> Using config from ${KERNEL_CONFIG}"
+ print_info 1 "$(get_indent 1)>> Using config from '${KERNEL_CONFIG}' ..."
- local message='Could not copy configuration file!'
- if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]
+ local message="Could not copy configuration file '${KERNEL_CONFIG}'!"
+ if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}" 2>/dev/null)" == application/x-gzip ]]
then
# Support --kernel-config=/proc/config.gz, mainly
zcat "${KERNEL_CONFIG}" > "${KERNEL_OUTPUTDIR}/.config" || gen_die "${message}"
else
- cp "${KERNEL_CONFIG}" "${KERNEL_OUTPUTDIR}/.config" || gen_die "${message}"
+ cp -aL "${KERNEL_CONFIG}" "${KERNEL_OUTPUTDIR}/.config" || gen_die "${message}"
fi
fi
if isTrue "${OLDCONFIG}"
then
- print_info 1 "$(getIndent 1)>> Running oldconfig ..."
+ print_info 1 "$(get_indent 1)>> Running 'make oldconfig' ..."
yes '' 2>/dev/null | compile_generic oldconfig kernel 2>/dev/null
else
- print_info 1 "$(getIndent 1)>> --oldconfig is disabled; not running 'make oldconfig'."
+ print_info 1 "$(get_indent 1)>> --no-oldconfig is set; Skipping 'make oldconfig' ..."
fi
local add_config
@@ -160,11 +159,11 @@ config_kernel() {
add_config=xconfig
fi
- if [ x"${add_config}" != x"" ]
+ if [ -n "${add_config}" ]
then
- print_info 1 "$(getIndent 1)>> Invoking ${add_config} ..."
- compile_generic $add_config kernelruntask
- [ "$?" ] || gen_die "Error: ${add_config} failed!"
+ print_info 1 "$(get_indent 1)>> Invoking ${add_config} ..."
+ compile_generic ${add_config} kernelruntask
+ [ $? -eq 0 ] || gen_die "Error: ${add_config} failed!"
fi
local -a required_kernel_options
@@ -173,38 +172,38 @@ config_kernel() {
# Force this on if we are using --genzimage
if isTrue "${CMD_GENZIMAGE}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for --genzimage are set ..."
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for --genzimage are set ..."
# Make sure Ext2 support is on...
- cfg_CONFIG_EXT2_FS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT2_FS")
+ local cfg_CONFIG_EXT2_FS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT2_FS")
if ! isTrue "${cfg_CONFIG_EXT2_FS}"
then
- cfg_CONFIG_EXT4_USE_FOR_EXT2=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT4_USE_FOR_EXT2")
+ local cfg_CONFIG_EXT4_USE_FOR_EXT2=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT4_USE_FOR_EXT2")
if ! isTrue "${cfg_CONFIG_EXT4_USE_FOR_EXT2}"
then
- cfg_CONFIG_EXT4_FS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT4_FS")
+ local cfg_CONFIG_EXT4_FS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT4_FS")
if isTrue "${cfg_CONFIG_EXT4_FS}"
then
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT4_USE_FOR_EXT2" "y" &&
- required_kernel_options+=(CONFIG_EXT4_USE_FOR_EXT2)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT4_USE_FOR_EXT2" "y" \
+ && required_kernel_options+=( 'CONFIG_EXT4_USE_FOR_EXT2' )
else
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLOCK" "y"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT2_FS" "y" &&
- required_kernel_options+=(CONFIG_EXT2_FS)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_EXT2_FS" "y" \
+ && required_kernel_options+=( 'CONFIG_EXT2_FS' )
fi
fi
fi
fi
# Do we support modules at all?
- cfg_CONFIG_MODULES=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULES")
+ local cfg_CONFIG_MODULES=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULES")
if isTrue "${cfg_CONFIG_MODULES}"
then
# yes, we support modules, set 'm' for new stuff.
- newcfg_setting='m'
+ local newcfg_setting='m'
# Compare the kernel module compression vs the depmod module compression support
# WARNING: if the buildhost has +XZ but the target machine has -XZ, you will get failures!
- cfg_CONFIG_MODULE_COMPRESS_GZIP=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULE_COMPRESS_GZIP")
- cfg_CONFIG_MODULE_COMPRESS_XZ=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULE_COMPRESS_XZ")
+ local cfg_CONFIG_MODULE_COMPRESS_GZIP=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULE_COMPRESS_GZIP")
+ local cfg_CONFIG_MODULE_COMPRESS_XZ=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULE_COMPRESS_XZ")
if isTrue "${cfg_CONFIG_MODULE_COMPRESS_GZIP}"
then
depmod_GZIP=$(/sbin/depmod -V | tr ' ' '\n' | awk '/ZLIB/{print $1; exit}')
@@ -226,14 +225,14 @@ config_kernel() {
if ! isTrue "${BUILD_STATIC}"
then
- local _no_modules_support_warning="$(getIndent 1)>> Forcing --static "
+ local _no_modules_support_warning="$(get_indent 1)>> Forcing --static"
if isTrue "${BUILD_RAMDISK}" && isTrue "${RAMDISKMODULES}"
then
- _no_modules_support_warning+="and --no-ramdisk-modules "
+ _no_modules_support_warning+=" and --no-ramdisk-modules"
RAMDISKMODULES="no"
fi
- _no_modules_support_warning+="to avoid genkernel failures because kernel does NOT support modules ..."
+ _no_modules_support_warning+=" to avoid genkernel failures because kernel does NOT support modules ..."
print_warning 1 "${_no_modules_support_warning}"
BUILD_STATIC="yes"
@@ -241,8 +240,8 @@ config_kernel() {
fi
# If the user has configured DM as built-in, we need to respect that.
- cfg_CONFIG_BLK_DEV_DM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM")
- case "$cfg_CONFIG_BLK_DEV_DM" in
+ local cfg_CONFIG_BLK_DEV_DM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM")
+ case "${cfg_CONFIG_BLK_DEV_DM}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_BLK_DEV_DM=${newcfg_setting}
esac
@@ -250,82 +249,82 @@ config_kernel() {
# Make sure lvm modules are enabled in the kernel, if --lvm
if isTrue "${CMD_LVM}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for LVM support are set ..."
- cfg_CONFIG_DM_SNAPSHOT=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_SNAPSHOT")
- case "$cfg_CONFIG_DM_SNAPSHOT" in
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for LVM support are set ..."
+ local cfg_CONFIG_DM_SNAPSHOT=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_SNAPSHOT")
+ case "${cfg_CONFIG_DM_SNAPSHOT}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_DM_SNAPSHOT=${newcfg_setting}
esac
- cfg_CONFIG_DM_MIRROR=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MIRROR")
- case "$cfg_CONFIG_DM_MIRROR" in
+ local cfg_CONFIG_DM_MIRROR=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MIRROR")
+ case "${cfg_CONFIG_DM_MIRROR}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_DM_MIRROR=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLOCK" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MD" "y"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM" "${cfg_CONFIG_BLK_DEV_DM}" &&
- required_kernel_options+=(CONFIG_BLK_DEV_DM)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM" "${cfg_CONFIG_BLK_DEV_DM}" \
+ && required_kernel_options+=( 'CONFIG_BLK_DEV_DM' )
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_SNAPSHOT" "${cfg_CONFIG_DM_SNAPSHOT}"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MIRROR" "${cfg_CONFIG_DM_MIRROR}"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FILE_LOCKING" "y" &&
- required_kernel_options+=(CONFIG_FILE_LOCKING)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FILE_LOCKING" "y" \
+ && required_kernel_options+=( 'CONFIG_FILE_LOCKING' )
fi
# Make sure multipath modules are enabled in the kernel, if --multipath
if isTrue "${CMD_MULTIPATH}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for multipath support are set ..."
- cfg_CONFIG_DM_MULTIPATH=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MULTIPATH")
- case "$cfg_CONFIG_DM_MULTIPATH" in
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for multipath support are set ..."
+ local cfg_CONFIG_DM_MULTIPATH=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MULTIPATH")
+ case "${cfg_CONFIG_DM_MULTIPATH}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_DM_MULTIPATH=${newcfg_setting}
esac
- cfg_CONFIG_DM_MULTIPATH_RDAC=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MULTIPATH_RDAC")
- case "$cfg_CONFIG_DM_MULTIPATH_RDAC" in
+ local cfg_CONFIG_DM_MULTIPATH_RDAC=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MULTIPATH_RDAC")
+ case "${cfg_CONFIG_DM_MULTIPATH_RDAC}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_DM_MULTIPATH_RDAC=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLOCK" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MD" "y"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM" "${cfg_CONFIG_BLK_DEV_DM}" &&
- required_kernel_options+=(CONFIG_BLK_DEV_DM)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MULTIPATH" "${cfg_CONFIG_DM_MULTIPATH}" &&
- required_kernel_options+=(CONFIG_DM_MULTIPATH)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM" "${cfg_CONFIG_BLK_DEV_DM}" \
+ && required_kernel_options+=( 'CONFIG_BLK_DEV_DM' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DM_MULTIPATH" "${cfg_CONFIG_DM_MULTIPATH}" \
+ && required_kernel_options+=( 'CONFIG_DM_MULTIPATH' )
fi
# Make sure dmraid modules are enabled in the kernel, if --dmraid
if isTrue "${CMD_DMRAID}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for DMRAID support are set ..."
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for DMRAID support are set ..."
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLOCK" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MD" "y"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM" "${cfg_CONFIG_BLK_DEV_DM}" &&
- required_kernel_options+=(CONFIG_BLK_DEV_DM)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM" "${cfg_CONFIG_BLK_DEV_DM}" \
+ && required_kernel_options+=( 'CONFIG_BLK_DEV_DM' )
fi
# Make sure iSCSI modules are enabled in the kernel, if --iscsi
if isTrue "${CMD_ISCSI}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for iSCSI support are set ..."
- cfg_CONFIG_ISCSI_BOOT_SYSFS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_BOOT_SYSFS")
- case "$cfg_CONFIG_ISCSI_BOOT_SYSFS" in
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for iSCSI support are set ..."
+ local cfg_CONFIG_ISCSI_BOOT_SYSFS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_BOOT_SYSFS")
+ case "${cfg_CONFIG_ISCSI_BOOT_SYSFS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_ISCSI_BOOT_SYSFS=${newcfg_setting}
esac
- cfg_CONFIG_ISCSI_TCP=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_TCP")
- case "$cfg_CONFIG_ISCSI_TCP" in
+ local cfg_CONFIG_ISCSI_TCP=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_TCP")
+ case "${cfg_CONFIG_ISCSI_TCP}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_ISCSI_TCP=${newcfg_setting}
esac
- cfg_CONFIG_SCSI_ISCSI_ATTRS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_ISCSI_ATTRS")
- case "$cfg_CONFIG_SCSI_ISCSI_ATTRS" in
+ local cfg_CONFIG_SCSI_ISCSI_ATTRS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_ISCSI_ATTRS")
+ case "${cfg_CONFIG_SCSI_ISCSI_ATTRS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_SCSI_ISCSI_ATTRS=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_NET" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INET" "y"
- cfg_CONFIG_SCSI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI")
+ local cfg_CONFIG_SCSI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI")
case "${cfg_CONFIG_SCSI}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_SCSI=${newcfg_setting}
@@ -333,18 +332,18 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI" "${cfg_CONFIG_SCSI}"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_LOWLEVEL" "y"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_BOOT_SYSFS" "${cfg_CONFIG_ISCSI_BOOT_SYSFS}" &&
- required_kernel_options+=(CONFIG_ISCSI_BOOT_SYSFS)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_TCP" "${cfg_CONFIG_ISCSI_TCP}" &&
- required_kernel_options+=(CONFIG_ISCSI_TCP)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_ISCSI_ATTRS" "${cfg_CONFIG_SCSI_ISCSI_ATTRS}" &&
- required_kernel_options+=(CONFIG_SCSI_ISCSI_ATTRS)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_BOOT_SYSFS" "${cfg_CONFIG_ISCSI_BOOT_SYSFS}" \
+ && required_kernel_options+=( 'CONFIG_ISCSI_BOOT_SYSFS' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_ISCSI_TCP" "${cfg_CONFIG_ISCSI_TCP}" \
+ && required_kernel_options+=( 'CONFIG_ISCSI_TCP' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_ISCSI_ATTRS" "${cfg_CONFIG_SCSI_ISCSI_ATTRS}" \
+ && required_kernel_options+=( 'CONFIG_SCSI_ISCSI_ATTRS' )
fi
# Make sure Hyper-V modules are enabled in the kernel, if --hyperv
if isTrue "${CMD_HYPERV}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for Hyper-V support are set ..."
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for Hyper-V support are set ..."
# Hyper-V deps
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_X86" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_PCI" "y"
@@ -353,21 +352,21 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERVISOR_GUEST" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_NET" "y"
- cfg_CONFIG_CONNECTOR=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_CONNECTOR")
+ local cfg_CONFIG_CONNECTOR=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_CONNECTOR")
case "${cfg_CONFIG_CONNECTOR}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_CONNECTOR=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_CONNECTOR" "${cfg_CONFIG_CONNECTOR}"
- cfg_CONFIG_NLS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_NLS")
+ local cfg_CONFIG_NLS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_NLS")
case "${cfg_CONFIG_NLS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_NLS=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_NLS" "${cfg_CONFIG_NLS}"
- cfg_CONFIG_SCSI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI")
+ local cfg_CONFIG_SCSI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI")
case "${cfg_CONFIG_SCSI}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_SCSI=${newcfg_setting}
@@ -375,7 +374,7 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI" "${cfg_CONFIG_SCSI}"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_LOWLEVEL" "y"
- cfg_CONFIG_SCSI_FC_ATTRS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_FC_ATTRS")
+ local cfg_CONFIG_SCSI_FC_ATTRS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_FC_ATTRS")
case "${cfg_CONFIG_SCSI_FC_ATTRS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_SCSI_FC_ATTRS=${newcfg_setting}
@@ -384,7 +383,7 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_NETDEVICES" "y"
- cfg_CONFIG_SERIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SERIO")
+ local cfg_CONFIG_SERIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SERIO")
case "${cfg_CONFIG_SERIO}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_SERIO=${newcfg_setting}
@@ -396,28 +395,28 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_X86_64" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HAS_IOMEM" "y"
- cfg_CONFIG_FB=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB")
+ local cfg_CONFIG_FB=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB")
case "${cfg_CONFIG_FB}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_FB=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB" "${cfg_CONFIG_FB}"
- cfg_CONFIG_INPUT=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INPUT")
+ local cfg_CONFIG_INPUT=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INPUT")
case "${cfg_CONFIG_INPUT}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_INPUT=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INPUT" "${cfg_CONFIG_INPUT}"
- cfg_CONFIG_HID=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HID")
+ local cfg_CONFIG_HID=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HID")
case "${cfg_CONFIG_HID}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_HID=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HID" "${cfg_CONFIG_HID}"
- cfg_CONFIG_UIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UIO")
+ local cfg_CONFIG_UIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UIO")
case "${cfg_CONFIG_UIO}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_UIO=${newcfg_setting}
@@ -425,25 +424,25 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UIO" "${cfg_CONFIG_UIO}"
# Hyper-V modules, activate in order!
- cfg_CONFIG_HYPERV=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV")
- case "$cfg_CONFIG_HYPERV" in
+ local cfg_CONFIG_HYPERV=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV")
+ case "${cfg_CONFIG_HYPERV}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_HYPERV=${newcfg_setting}
esac
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV" "${cfg_CONFIG_HYPERV}" &&
- required_kernel_options+=(CONFIG_HYPERV)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV" "${cfg_CONFIG_HYPERV}" \
+ && required_kernel_options+=( 'CONFIG_HYPERV' )
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_UTILS" "${cfg_CONFIG_HYPERV}"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_BALLOON" "${cfg_CONFIG_HYPERV}" &&
- required_kernel_options+=(CONFIG_HYPERV_BALLOON)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_STORAGE" "${cfg_CONFIG_HYPERV}" &&
- required_kernel_options+=(CONFIG_HYPERV_STORAGE)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_NET" "${cfg_CONFIG_HYPERV}" &&
- required_kernel_options+=(CONFIG_HYPERV_NET)
-
- if [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4014 ]
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_BALLOON" "${cfg_CONFIG_HYPERV}" \
+ && required_kernel_options+=( 'CONFIG_HYPERV_BALLOON' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_STORAGE" "${cfg_CONFIG_HYPERV}" \
+ && required_kernel_options+=( 'CONFIG_HYPERV_STORAGE' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_NET" "${cfg_CONFIG_HYPERV}" \
+ && required_kernel_options+=( 'CONFIG_HYPERV_NET' )
+
+ if [ $((${KV_MAJOR} * 1000 + ${KV_MINOR})) -ge 4014 ]
then
- cfg_CONFIG_VSOCKETS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VSOCKETS")
+ local cfg_CONFIG_VSOCKETS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VSOCKETS")
case "${cfg_CONFIG_VSOCKETS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_VSOCKETS=${newcfg_setting}
@@ -455,23 +454,23 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_KEYBOARD" "${cfg_CONFIG_HYPERV}"
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4006 ] &&
+ [ $((${KV_MAJOR} * 1000 + ${KV_MINOR})) -ge 4006 ] &&
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_PCI_HYPERV" "${cfg_CONFIG_HYPERV}"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB_HYPERV" "${cfg_CONFIG_HYPERV}"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HID_HYPERV_MOUSE" "${cfg_CONFIG_HYPERV}"
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4010 ] &&
+ [ $((${KV_MAJOR} * 1000 + ${KV_MINOR})) -ge 4010 ] &&
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UIO_HV_GENERIC" "${cfg_CONFIG_HYPERV}"
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4012 ] &&
+ [ $((${KV_MAJOR} * 1000 + ${KV_MINOR})) -ge 4012 ] &&
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_TSCPAGE" "y"
fi
# Make sure kernel supports Splash, if --splash
if isTrue "${SPLASH}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for Splash support are set ..."
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for Splash support are set ..."
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB_SPLASH" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VT" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_TTY" "y"
@@ -483,7 +482,7 @@ config_kernel() {
# Make sure VirtIO modules are enabled in the kernel, if --virtio
if isTrue "${CMD_VIRTIO}"
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for VirtIO support are set ..."
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for VirtIO support are set ..."
# VirtIO deps
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLOCK" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_CRYPTO" "y"
@@ -501,7 +500,7 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SYSFS" "y"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HAS_IOPORT_MAP" "y"
- cfg_CONFIG_SCSI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI")
+ local cfg_CONFIG_SCSI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI")
case "${cfg_CONFIG_SCSI}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_SCSI=${newcfg_setting}
@@ -509,28 +508,28 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI" "${cfg_CONFIG_SCSI}"
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_LOWLEVEL" "y"
- cfg_CONFIG_DRM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DRM")
+ local cfg_CONFIG_DRM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DRM")
case "${cfg_CONFIG_DRM}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_DRM=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_DRM" "${cfg_CONFIG_DRM}"
- cfg_CONFIG_HW_RANDOM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HW_RANDOM")
+ local cfg_CONFIG_HW_RANDOM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HW_RANDOM")
case "${cfg_CONFIG_HW_RANDOM}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_HW_RANDOM=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HW_RANDOM" "${cfg_CONFIG_HW_RANDOM}"
- cfg_CONFIG_INPUT=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INPUT")
+ local cfg_CONFIG_INPUT=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INPUT")
case "${cfg_CONFIG_INPUT}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_INPUT=${newcfg_setting}
esac
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INPUT" "${cfg_CONFIG_INPUT}"
- cfg_CONFIG_VHOST_NET=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VHOST_NET")
+ local cfg_CONFIG_VHOST_NET=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VHOST_NET")
case "${cfg_CONFIG_VHOST_NET}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_VHOST_NET=${newcfg_setting}
@@ -539,7 +538,7 @@ config_kernel() {
if [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4006 ]
then
- cfg_CONFIG_FW_CFG_SYSFS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FW_CFG_SYSFS")
+ local cfg_CONFIG_FW_CFG_SYSFS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FW_CFG_SYSFS")
case "${cfg_CONFIG_FW_CFG_SYSFS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_FW_CFG_SYSFS=${newcfg_setting}
@@ -547,11 +546,11 @@ config_kernel() {
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FW_CFG_SYSFS" "${cfg_CONFIG_FW_CFG_SYSFS}"
fi
- cfg_CONFIG_VIRTIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO")
- cfg_CONFIG_SCSI_VIRTIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_VIRTIO")
- cfg_CONFIG_VIRTIO_BLK=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_BLK")
- cfg_CONFIG_VIRTIO_NET=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_NET")
- cfg_CONFIG_VIRTIO_PCI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_PCI")
+ local cfg_CONFIG_VIRTIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO")
+ local cfg_CONFIG_SCSI_VIRTIO=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_VIRTIO")
+ local cfg_CONFIG_VIRTIO_BLK=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_BLK")
+ local cfg_CONFIG_VIRTIO_NET=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_NET")
+ local cfg_CONFIG_VIRTIO_PCI=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_PCI")
if \
isTrue "${cfg_CONFIG_VIRTIO}" || \
isTrue "${cfg_CONFIG_SCSI_VIRTIO}" || \
@@ -560,21 +559,21 @@ config_kernel() {
isTrue "${cfg_CONFIG_VIRTIO_PCI}"
then
# If the user has configured VirtIO as built-in, we need to respect that.
- newvirtio_setting="y"
+ local newvirtio_setting="y"
else
- newvirtio_setting=${newcfg_setting}
+ local newvirtio_setting=${newcfg_setting}
fi
# VirtIO modules, activate in order!
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO" "${newvirtio_setting}" &&
- required_kernel_options+=(CONFIG_VIRTIO)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO" "${newvirtio_setting}" \
+ && required_kernel_options+=( 'CONFIG_VIRTIO' )
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_MENU" "y"
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_VIRTIO" "${newvirtio_setting}" &&
- required_kernel_options+=(CONFIG_SCSI_VIRTIO)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_BLK" "${newvirtio_setting}" &&
- required_kernel_options+=(CONFIG_VIRTIO_BLK)
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_NET" "${newvirtio_setting}" &&
- required_kernel_options+=(CONFIG_VIRTIO_NET)
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_VIRTIO" "${newvirtio_setting}" \
+ && required_kernel_options+=( 'CONFIG_SCSI_VIRTIO' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_BLK" "${newvirtio_setting}" \
+ && required_kernel_options+=( 'CONFIG_VIRTIO_BLK' )
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_NET" "${newvirtio_setting}" \
+ && required_kernel_options+=( 'CONFIG_VIRTIO_NET' )
kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VIRTIO_PCI" "${newvirtio_setting}"
if [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4011 ]
@@ -593,7 +592,7 @@ config_kernel() {
if [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -ge 4008 ]
then
- cfg_CONFIG_VSOCKETS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VSOCKETS")
+ local cfg_CONFIG_VSOCKETS=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_VSOCKETS")
case "${cfg_CONFIG_VSOCKETS}" in
y|m) ;; # Do nothing
*) cfg_CONFIG_VSOCKETS=${newcfg_setting}
@@ -611,55 +610,61 @@ config_kernel() {
# Microcode setting, intended for early microcode loading, if --microcode
if [[ -n "${MICROCODE}" ]]
then
- print_info 1 "$(getIndent 1)>> Ensure that required kernel options for early microcode loading support are set ..."
- kconfig_microcode_intel=(CONFIG_MICROCODE_INTEL CONFIG_MICROCODE_INTEL_EARLY)
-
- kconfig_microcode_amd=(CONFIG_MICROCODE_AMD)
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfig_microcode_amd+=(CONFIG_MICROCODE_AMD_EARLY)
-
- kconfigs=(CONFIG_MICROCODE CONFIG_MICROCODE_OLD_INTERFACE)
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfigs+=(CONFIG_MICROCODE_EARLY)
-
- [[ "$MICROCODE" == all ]] && kconfigs+=( ${kconfig_microcode_amd[@]} ${kconfig_microcode_intel[@]} )
- [[ "$MICROCODE" == amd ]] && kconfigs+=( ${kconfig_microcode_amd[@]} )
- [[ "$MICROCODE" == intel ]] && kconfigs+=( ${kconfig_microcode_intel[@]} )
-
- for k in "${kconfigs[@]}"
- do
- cfg=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "$k")
- case "$cfg" in
- y) ;; # Do nothing
- *) cfg='y'
- esac
- kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "$k" "${cfg}"
- done
-
- required_kernel_options+=(CONFIG_MICROCODE)
+ if isTrue "${KERNEL_SUPPORT_MICROCODE}"
+ then
+ print_info 2 "$(get_indent 1)>> Ensure that required kernel options for early microcode loading support are set ..."
+ kconfig_microcode_intel=(CONFIG_MICROCODE_INTEL CONFIG_MICROCODE_INTEL_EARLY)
+
+ kconfig_microcode_amd=(CONFIG_MICROCODE_AMD)
+ [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfig_microcode_amd+=(CONFIG_MICROCODE_AMD_EARLY)
+
+ kconfigs=(CONFIG_MICROCODE CONFIG_MICROCODE_OLD_INTERFACE)
+ [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfigs+=(CONFIG_MICROCODE_EARLY)
+
+ [[ "$MICROCODE" == all ]] && kconfigs+=( ${kconfig_microcode_amd[@]} ${kconfig_microcode_intel[@]} )
+ [[ "$MICROCODE" == amd ]] && kconfigs+=( ${kconfig_microcode_amd[@]} )
+ [[ "$MICROCODE" == intel ]] && kconfigs+=( ${kconfig_microcode_intel[@]} )
+
+ for k in "${kconfigs[@]}"
+ do
+ local cfg=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "$k")
+ case "${cfg}" in
+ y) ;; # Do nothing
+ *) cfg='y'
+ esac
+ kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "$k" "${cfg}"
+ done
+
+ required_kernel_options+=( 'CONFIG_MICROCODE' )
+ else
+ print_info 1 "$(get_indent 1)>> Ignoring --microcode parameter; Architecture does not support microcode loading ..."
+ fi
fi
if [ -f "${KCONFIG_MODIFIED_MARKER}" ]
then
if isTrue "${OLDCONFIG}"
then
- print_info 1 "$(getIndent 1)>> Re-running oldconfig due to changed kernel options ..."
+ print_info 1 "$(get_indent 1)>> Re-running 'make oldconfig' due to changed kernel options ..."
yes '' 2>/dev/null | compile_generic oldconfig kernel 2>/dev/null
else
- print_info 1 "$(getIndent 1)>> Running olddefconfig due to changed kernel options ..."
+ print_info 1 "$(get_indent 1)>> Running 'make olddefconfig' due to changed kernel options ..."
compile_generic olddefconfig kernel 2>/dev/null
fi
else
- print_info 2 "$(getIndent 1)>> genkernel did not need to add/modify any kernel options."
+ print_info 2 "$(get_indent 1)>> genkernel did not need to add/modify any kernel options."
fi
- print_info 2 "$(getIndent 1)>> checking for required kernel options ..."
+ print_info 2 "$(get_indent 1)>> Checking if required kernel options are still present ..."
+ local required_kernel_option=
for required_kernel_option in "${required_kernel_options[@]}"
do
- optval=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "${required_kernel_option}")
+ local optval=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "${required_kernel_option}")
if [ -z "${optval}" ]
then
- gen_die "something went wrong: Required kernel option '${required_kernel_option}' which genkernel tried to set is missing!"
+ gen_die "Something went wrong: Required kernel option '${required_kernel_option}' which genkernel tried to set is missing!"
else
- print_info 2 "$(getIndent 2) - '${required_kernel_option}' is set to '${optval}'"
+ print_info 3 "$(get_indent 2) - '${required_kernel_option}' is set to '${optval}'"
fi
done
}