1 |
commit: 01a319d31fa8dfc6dba903ca202f4a915d49f2dc |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 10 18:20:45 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 10 18:34:33 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=01a319d3 |
7 |
|
8 |
gen_configkernel.sh: determine_kernel_config_file(): Add kconfig containing KERNEL_LOCALVERSION to kconfig candidate list |
9 |
|
10 |
Since we added $ARCH to KERNEL_LOCALVERSION by default, |
11 |
$KV from fresh kernel sources won't match with saved kernel |
12 |
config file anymore which will break kernel upgrades when |
13 |
saved kernel config file was just copied to new kernel |
14 |
version without removing LOV part. |
15 |
|
16 |
WIth this commit we still prefer extracted $KV when looking |
17 |
for kernel config file, however, we will also look for |
18 |
kernel config file where $KV contains KERNEL_LOCALVERSION |
19 |
we are going to use in addition. |
20 |
|
21 |
Bug: https://bugs.gentoo.org/691852 |
22 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
23 |
|
24 |
gen_configkernel.sh | 36 ++++++++++++++++++++++++++++++------ |
25 |
1 file changed, 30 insertions(+), 6 deletions(-) |
26 |
|
27 |
diff --git a/gen_configkernel.sh b/gen_configkernel.sh |
28 |
index 4cfd246..2ff983f 100755 |
29 |
--- a/gen_configkernel.sh |
30 |
+++ b/gen_configkernel.sh |
31 |
@@ -17,17 +17,41 @@ determine_kernel_config_file() { |
32 |
fi |
33 |
else |
34 |
local -a kconfig_candidates |
35 |
- kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ) |
36 |
- kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ) |
37 |
- kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" ) |
38 |
- kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config" ) |
39 |
- kconfig_candidates+=( "${DEFAULT_KERNEL_CONFIG}" ) |
40 |
+ |
41 |
+ local -a gk_kconfig_candidates |
42 |
+ gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ) |
43 |
+ gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ) |
44 |
+ gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" ) |
45 |
+ gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config" ) |
46 |
+ gk_kconfig_candidates+=( "${DEFAULT_KERNEL_CONFIG}" ) |
47 |
|
48 |
if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] |
49 |
then |
50 |
print_info 1 "Default configuration was forced. Will ignore any user kernel configuration!" |
51 |
+ kconfig_candidates=( ${gk_kconfig_candidates[@]} ) |
52 |
else |
53 |
- kconfig_candidates=( "/etc/kernels/${GK_FILENAME_CONFIG}" "/etc/kernels/kernel-config-${ARCH}-${KV}" ${kconfig_candidates[@]} ) |
54 |
+ local -a user_kconfig_candidates |
55 |
+ |
56 |
+ # Always prefer kernel config based on actual $KV reading |
57 |
+ user_kconfig_candidates+=( "/etc/kernels/${GK_FILENAME_CONFIG}" ) |
58 |
+ |
59 |
+ if [ -n "${KERNEL_LOCALVERSION}" -a "${KERNEL_LOCALVERSION}" != "UNSET" ] |
60 |
+ then |
61 |
+ # Look for kernel config based on KERNEL_LOCALVERSION |
62 |
+ # which we are going to use, too. |
63 |
+ # This will allow user to copy previous kernel config file |
64 |
+ # which includes LOV by default to new version when doing |
65 |
+ # kernel upgrade since we add $ARCH to $LOV by default. |
66 |
+ user_kconfig_candidates+=( "/etc/kernels/kernel-config-${VER}.${PAT}.${SUB}${EXV}${KERNEL_LOCALVERSION}" ) |
67 |
+ fi |
68 |
+ |
69 |
+ # Look for genkernel-3.x configs for backward compatibility, too |
70 |
+ user_kconfig_candidates+=( "/etc/kernels/kernel-config-${ARCH}-${KV}" ) |
71 |
+ |
72 |
+ kconfig_candidates=( |
73 |
+ ${user_kconfig_candidates[@]} |
74 |
+ ${gk_kconfig_candidates[@]} |
75 |
+ ) |
76 |
fi |
77 |
|
78 |
local f |