diff options
author | 2019-08-10 20:20:45 +0200 | |
---|---|---|
committer | 2019-08-10 20:34:33 +0200 | |
commit | 01a319d31fa8dfc6dba903ca202f4a915d49f2dc (patch) | |
tree | 81ff8975b52d68600e4bc88750e09730916336e1 /gen_configkernel.sh | |
parent | gen_determineargs.sh: determine_real_args(): Move GK_TIME_START initializatio... (diff) | |
download | genkernel-01a319d31fa8dfc6dba903ca202f4a915d49f2dc.tar.gz genkernel-01a319d31fa8dfc6dba903ca202f4a915d49f2dc.tar.bz2 genkernel-01a319d31fa8dfc6dba903ca202f4a915d49f2dc.zip |
gen_configkernel.sh: determine_kernel_config_file(): Add kconfig containing KERNEL_LOCALVERSION to kconfig candidate list
Since we added $ARCH to KERNEL_LOCALVERSION by default,
$KV from fresh kernel sources won't match with saved kernel
config file anymore which will break kernel upgrades when
saved kernel config file was just copied to new kernel
version without removing LOV part.
WIth this commit we still prefer extracted $KV when looking
for kernel config file, however, we will also look for
kernel config file where $KV contains KERNEL_LOCALVERSION
we are going to use in addition.
Bug: https://bugs.gentoo.org/691852
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_configkernel.sh')
-rwxr-xr-x | gen_configkernel.sh | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 4cfd2468..2ff983fa 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -17,17 +17,41 @@ determine_kernel_config_file() { fi else local -a kconfig_candidates - kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ) - kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ) - kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" ) - kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config" ) - kconfig_candidates+=( "${DEFAULT_KERNEL_CONFIG}" ) + + local -a gk_kconfig_candidates + gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ) + gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ) + gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" ) + gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config" ) + gk_kconfig_candidates+=( "${DEFAULT_KERNEL_CONFIG}" ) if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] then print_info 1 "Default configuration was forced. Will ignore any user kernel configuration!" + kconfig_candidates=( ${gk_kconfig_candidates[@]} ) else - kconfig_candidates=( "/etc/kernels/${GK_FILENAME_CONFIG}" "/etc/kernels/kernel-config-${ARCH}-${KV}" ${kconfig_candidates[@]} ) + local -a user_kconfig_candidates + + # Always prefer kernel config based on actual $KV reading + user_kconfig_candidates+=( "/etc/kernels/${GK_FILENAME_CONFIG}" ) + + if [ -n "${KERNEL_LOCALVERSION}" -a "${KERNEL_LOCALVERSION}" != "UNSET" ] + then + # Look for kernel config based on KERNEL_LOCALVERSION + # which we are going to use, too. + # This will allow user to copy previous kernel config file + # which includes LOV by default to new version when doing + # kernel upgrade since we add $ARCH to $LOV by default. + user_kconfig_candidates+=( "/etc/kernels/kernel-config-${VER}.${PAT}.${SUB}${EXV}${KERNEL_LOCALVERSION}" ) + fi + + # Look for genkernel-3.x configs for backward compatibility, too + user_kconfig_candidates+=( "/etc/kernels/kernel-config-${ARCH}-${KV}" ) + + kconfig_candidates=( + ${user_kconfig_candidates[@]} + ${gk_kconfig_candidates[@]} + ) fi local f |