1 |
commit: 1f1a4409da8dcd38aa0ec27f7f07d07ed866bc0b |
2 |
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 27 15:09:30 2016 +0000 |
4 |
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 27 15:09:30 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=1f1a4409 |
7 |
|
8 |
enhance early microcode by actually checking if it will work |
9 |
|
10 |
gen_initramfs.sh | 24 ++++++++++++------------ |
11 |
1 file changed, 12 insertions(+), 12 deletions(-) |
12 |
|
13 |
diff --git a/gen_initramfs.sh b/gen_initramfs.sh |
14 |
index fb74929..1f62f5c 100755 |
15 |
--- a/gen_initramfs.sh |
16 |
+++ b/gen_initramfs.sh |
17 |
@@ -1042,26 +1042,26 @@ create_initramfs() { |
18 |
fi |
19 |
## To early load microcode we need to follow some pretty specific steps |
20 |
## mostly laid out in linux/Documentation/x86/early-microcode.txt |
21 |
- #if CONFIG_MICROCODE=y; then |
22 |
+ if grep -sq '^CONFIG_MICROCODE=y' "${KERNEL_OUTPUTDIR}"/.config; then |
23 |
print_info 1 "early-microcode: >> Preparing..." |
24 |
UCODEDIR="${TMPDIR}/ucode_tmp/kernel/x86/microcode/" |
25 |
mkdir -p "${UCODEDIR}" |
26 |
- #if CONFIG_MICROCODE_INTEL=y; then |
27 |
+ if grep -sq '^CONFIG_MICROCODE_INTEL=y' "${KERNEL_OUTPUTDIR}"/.config; then |
28 |
if [ "$(ls -A /lib/firmware/intel-ucode)" ]; then |
29 |
print_info 1 " >> adding GenuineIntel.bin" |
30 |
cat /lib/firmware/intel-ucode/* > "${UCODEDIR}/GenuineIntel.bin" || gen_die "Failed to concat intel cpu ucode" |
31 |
- #else |
32 |
- #print_info 1 "CONFIG_MICROCODE_INTEL=y set but no ucode available. Please install sys-firmware/intel-microcode[split-ucode]" |
33 |
+ else |
34 |
+ print_info 1 "CONFIG_MICROCODE_INTEL=y set but no ucode available. Please install sys-firmware/intel-microcode[split-ucode]" |
35 |
fi |
36 |
- #fi |
37 |
- #if CONFIG_MICROCODE_AMD=y; then |
38 |
+ fi |
39 |
+ if grep -sq '^CONFIG_MICROCODE_AMD=y' "${KERNEL_OUTPUTDIR}"/.config; then |
40 |
if [ "$(ls -A /lib/firmware/amd-ucode)" ]; then |
41 |
print_info 1 " >> adding AuthenticAMD.bin" |
42 |
cat /lib/firmware/amd-ucode/*.bin > "${UCODEDIR}/AuthenticAMD.bin" || gen_dir "Failed to concat amd cpu ucode" |
43 |
- #else |
44 |
- #print_info 1 "CONFIG_MICROCODE_AMD=y set but no ucode available. Please install sys-firmware/linux-firmware" |
45 |
+ else |
46 |
+ print_info 1 "CONFIG_MICROCODE_AMD=y set but no ucode available. Please install sys-firmware/linux-firmware" |
47 |
fi |
48 |
- #fi |
49 |
+ fi |
50 |
if [ "$(ls -A ${UCODE})" ]; then |
51 |
print_info 1 "early-microcode: >> Creating cpio..." |
52 |
pushd "${TMPDIR}/ucode_tmp" > /dev/null |
53 |
@@ -1070,10 +1070,10 @@ create_initramfs() { |
54 |
print_info 1 "early-microcode: >> Prepending early-microcode to initramfs" |
55 |
cat "${TMPDIR}/ucode.cpio" "${CPIO}" > "${CPIO}.early-microcode" || gen_die "Failed to prepend early-microcode to initramfs" |
56 |
mv -f "${CPIO}.early-microcode" "${CPIO}" || gen_die "Rename failed" |
57 |
- #else |
58 |
- #print_info 1 "CONFIG_MICROCODE=y is set but no microcode found" |
59 |
+ else |
60 |
+ print_info 1 "CONFIG_MICROCODE=y is set but no microcode found" |
61 |
fi |
62 |
- #fi |
63 |
+ fi |
64 |
if isTrue "${WRAP_INITRD}" |
65 |
then |
66 |
local mkimage_cmd=$(type -p mkimage) |