From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 43AE2138334 for ; Sat, 10 Aug 2019 18:34:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6C33CE08D1; Sat, 10 Aug 2019 18:34:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 25208E08D1 for ; Sat, 10 Aug 2019 18:34:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A767D34985A for ; Sat, 10 Aug 2019 18:34:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 29B54471 for ; Sat, 10 Aug 2019 18:34:48 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1565462073.01a319d31fa8dfc6dba903ca202f4a915d49f2dc.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_configkernel.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 01a319d31fa8dfc6dba903ca202f4a915d49f2dc X-VCS-Branch: master Date: Sat, 10 Aug 2019 18:34:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fc7da810-435e-4e4e-822a-f867c32e9ba7 X-Archives-Hash: fc19f4f721e3584748c6faf34b197383 commit: 01a319d31fa8dfc6dba903ca202f4a915d49f2dc Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Aug 10 18:20:45 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sat Aug 10 18:34:33 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=01a319d3 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 gentoo.org> gen_configkernel.sh | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 4cfd246..2ff983f 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