aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2018-08-04 16:19:46 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2018-08-04 16:25:31 -0700
commitfebc1b12b5b393e918da94b9f1c029f2adcea215 (patch)
treec1f2282171b55da54994072469ccb041c87c269e /gen_cmdline.sh
parentlinuxrc: Add detection of squashfs in initrd root (diff)
downloadgenkernel-febc1b12b5b393e918da94b9f1c029f2adcea215.tar.gz
genkernel-febc1b12b5b393e918da94b9f1c029f2adcea215.tar.bz2
genkernel-febc1b12b5b393e918da94b9f1c029f2adcea215.zip
microcode: add flexability: type & initramfs control
Bug reported that the MICROCODE option did not provide enough flexability, as it enabled both AMD & Intel options by default, and placed both sets of microcode into the initramfs. Existing boolean option MICROCODE is now a string, which takes no/all/amd/intel as inputs, describing which variant of kernel options to enable. Boolean inputs are converted to no/all settings. This option no longer include microcode in initramfs. New option MICROCODE_INITRAMFS, enabled by default, includes the microcode for matching kernel config options (INTEL/AMD) into the initramfs. For users using sys-boot/grub-2.02-r1 or another bootloader that supports multiple initramfs options, this option can be safely disabled. Fixes: https://bugs.gentoo.org/662492 Reported-by: Joerg Schaible <joerg.schaible@gmx.de> Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'gen_cmdline.sh')
-rwxr-xr-xgen_cmdline.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 3d9611f..853723b 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -98,8 +98,9 @@ longusage() {
echo " --mdadm Include MDADM/MDMON support"
echo " --no-mdadm Exclude MDADM/MDMON support"
echo " --mdadm-config=<file> Use file as mdadm.conf in initramfs"
- echo " --microcode Include early microcode support"
- echo " --no-microcode Exclude early microcode support"
+ echo " --microcode[=<type>] Include early microcode support, for 'all'/'amd'/'intel' CPU types"
+ echo " --no-microcode Exclude early microcode support"
+ echo " --microcode-initramfs Include early microcode in initramfs"
echo " --nfs Include NFS support"
echo " --no-nfs Exclude NFS support"
echo " --dmraid Include DMRAID support"
@@ -330,9 +331,20 @@ parse_cmdline() {
print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
;;
--microcode|--no-microcode)
- CMD_MICROCODE=`parse_optbool "$*"`
+ case `parse_optbool "$*"` in
+ 0) CMD_MICROCODE='no' ;;
+ 1) CMD_MICROCODE='all' ;;
+ esac
print_info 2 "CMD_MICROCODE: ${CMD_MICROCODE}"
;;
+ --microcode=*)
+ CMD_MICROCODE="${*#*=}"
+ print_info 2 "CMD_MICROCODE: $CMD_MICROCODE"
+ ;;
+ --microcode-initramfs|--no-microcode-initramfs)
+ CMD_MICROCODE_INITRAMFS=`parse_optbool "$*"`
+ print_info 2 "CMD_MICROCODE_INITRAMFS: ${CMD_MICROCODE_INITRAMFS}"
+ ;;
--nfs|--no-nfs)
CMD_NFS=`parse_optbool "$*"`
print_info 2 "CMD_NFS: ${CMD_NFS}"