summaryrefslogtreecommitdiff
path: root/util/grub-mkconfig.in
diff options
context:
space:
mode:
authorMatthew S. Turnbull <sparky@bluefang-logic.com>2018-02-24 17:44:58 -0500
committerDaniel Kiper <daniel.kiper@oracle.com>2018-03-14 13:23:27 +0100
commita698240df0c43278b2d1d7259c8e7a6926c63112 (patch)
tree4f74195201d2f7c1d863a6620559d0265a9a3509 /util/grub-mkconfig.in
parent28b0d19061d66e3633148ac8e44decda914bf266 (diff)
grub-mkconfig/10_linux: Support multiple early initrd images
Add support for multiple, shared, early initrd images. These early images will be loaded in the order declared, and all will be loaded before the initrd image. While many classes of data can be provided by early images, the immediate use case would be for distributions to provide CPU microcode to mitigate the Meltdown and Spectre vulnerabilities. There are two environment variables provided for declaring the early images. * GRUB_EARLY_INITRD_LINUX_STOCK is for the distribution declare images that are provided by the distribution or installed packages. If undeclared, this will default to a set of common microcode image names. * GRUB_EARLY_INITRD_LINUX_CUSTOM is for user created images. User images will be loaded after the stock images. These separate configurations allow the distribution and user to declare different image sets without clobbering each other. This also makes a minor update to ensure that UUID partition labels stay disabled when no initrd image is found, even if early images are present. This is a continuation of a previous patch published by Christian Hesse in 2016: http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00025.html Down stream Gentoo bug: https://bugs.gentoo.org/645088 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Matthew S. Turnbull <sparky@bluefang-logic.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Diffstat (limited to 'util/grub-mkconfig.in')
-rw-r--r--util/grub-mkconfig.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index f8496d28b..35ef583b0 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -147,6 +147,12 @@ if [ x"$GRUB_FS" = xunknown ]; then
GRUB_FS="$(stat -f --printf=%T / || echo unknown)"
fi
+# Provide a default set of stock linux early initrd images.
+# Define here so the list can be modified in the sourced config file.
+if [ "x${GRUB_EARLY_INITRD_LINUX_STOCK}" = "x" ]; then
+ GRUB_EARLY_INITRD_LINUX_STOCK="intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio"
+fi
+
if test -f ${sysconfdir}/default/grub ; then
. ${sysconfdir}/default/grub
fi
@@ -211,6 +217,8 @@ export GRUB_DEFAULT \
GRUB_CMDLINE_NETBSD \
GRUB_CMDLINE_NETBSD_DEFAULT \
GRUB_CMDLINE_GNUMACH \
+ GRUB_EARLY_INITRD_LINUX_CUSTOM \
+ GRUB_EARLY_INITRD_LINUX_STOCK \
GRUB_TERMINAL_INPUT \
GRUB_TERMINAL_OUTPUT \
GRUB_SERIAL_COMMAND \