1 |
commit: ef914100a474196ddb27049fd95ce573ebc4805d |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 29 15:07:14 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 29 15:34:23 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ef914100 |
7 |
|
8 |
gen_configkernel.sh: config_kernel(): Update --microcode kernel options handling |
9 |
|
10 |
- Don't try to set CONFIG_MICROCODE_*EARLY for >= linux-4.4 |
11 |
|
12 |
- Check for CONFIG_MICROCODE_{AMD,INTEL} in sanity check |
13 |
|
14 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
15 |
|
16 |
gen_configkernel.sh | 39 ++++++++++++++++++++++++++++++--------- |
17 |
1 file changed, 30 insertions(+), 9 deletions(-) |
18 |
|
19 |
diff --git a/gen_configkernel.sh b/gen_configkernel.sh |
20 |
index 2ff983f..5a4b5ce 100755 |
21 |
--- a/gen_configkernel.sh |
22 |
+++ b/gen_configkernel.sh |
23 |
@@ -753,20 +753,29 @@ config_kernel() { |
24 |
then |
25 |
if isTrue "${KERNEL_SUPPORT_MICROCODE}" |
26 |
then |
27 |
+ local -a kconfigs_microcode |
28 |
+ local -a kconfigs_microcode_amd |
29 |
+ local -a kconfigs_microcode_intel |
30 |
+ |
31 |
print_info 2 "$(get_indent 1)>> Ensure that required kernel options for early microcode loading support are set ..." |
32 |
- kconfig_microcode_intel=(CONFIG_MICROCODE_INTEL CONFIG_MICROCODE_INTEL_EARLY) |
33 |
+ kconfigs_microcode+=( 'CONFIG_MICROCODE' ) |
34 |
+ kconfigs_microcode+=( 'CONFIG_MICROCODE_OLD_INTERFACE' ) |
35 |
+ [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfigs_microcode+=( 'CONFIG_MICROCODE_EARLY' ) |
36 |
|
37 |
- kconfig_microcode_amd=(CONFIG_MICROCODE_AMD) |
38 |
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfig_microcode_amd+=(CONFIG_MICROCODE_AMD_EARLY) |
39 |
+ # Intel |
40 |
+ kconfigs_microcode_intel+=( 'CONFIG_MICROCODE_INTEL' ) |
41 |
+ [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfigs_microcode_intel+=( 'CONFIG_MICROCODE_INTEL_EARLY' ) |
42 |
|
43 |
- kconfigs=(CONFIG_MICROCODE CONFIG_MICROCODE_OLD_INTERFACE) |
44 |
- [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfigs+=(CONFIG_MICROCODE_EARLY) |
45 |
+ # AMD |
46 |
+ kconfigs_microcode_amd=( 'CONFIG_MICROCODE_AMD' ) |
47 |
+ [ $(($KV_MAJOR * 1000 + ${KV_MINOR})) -le 4003 ] && kconfigs_microcode_amd+=( 'CONFIG_MICROCODE_AMD_EARLY' ) |
48 |
|
49 |
- [[ "$MICROCODE" == all ]] && kconfigs+=( ${kconfig_microcode_amd[@]} ${kconfig_microcode_intel[@]} ) |
50 |
- [[ "$MICROCODE" == amd ]] && kconfigs+=( ${kconfig_microcode_amd[@]} ) |
51 |
- [[ "$MICROCODE" == intel ]] && kconfigs+=( ${kconfig_microcode_intel[@]} ) |
52 |
+ [[ "${MICROCODE}" == all ]] && kconfigs_microcode+=( ${kconfigs_microcode_amd[@]} ${kconfigs_microcode_intel[@]} ) |
53 |
+ [[ "${MICROCODE}" == amd ]] && kconfigs_microcode+=( ${kconfigs_microcode_amd[@]} ) |
54 |
+ [[ "${MICROCODE}" == intel ]] && kconfigs_microcode+=( ${kconfigs_microcode_intel[@]} ) |
55 |
|
56 |
- for k in "${kconfigs[@]}" |
57 |
+ local k |
58 |
+ for k in "${kconfigs_microcode[@]}" |
59 |
do |
60 |
local cfg=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "$k") |
61 |
case "${cfg}" in |
62 |
@@ -777,6 +786,18 @@ config_kernel() { |
63 |
done |
64 |
|
65 |
required_kernel_options+=( 'CONFIG_MICROCODE' ) |
66 |
+ case "${MICROCODE}" in |
67 |
+ amd) |
68 |
+ required_kernel_options+=( 'CONFIG_MICROCODE_AMD' ) |
69 |
+ ;; |
70 |
+ intel) |
71 |
+ required_kernel_options+=( 'CONFIG_MICROCODE_INTEL' ) |
72 |
+ ;; |
73 |
+ all) |
74 |
+ required_kernel_options+=( 'CONFIG_MICROCODE_AMD' ) |
75 |
+ required_kernel_options+=( 'CONFIG_MICROCODE_INTEL' ) |
76 |
+ ;; |
77 |
+ esac |
78 |
else |
79 |
print_info 1 "$(get_indent 1)>> Ignoring --microcode parameter; Architecture does not support microcode loading ..." |
80 |
fi |