grub2/0202-10_linux.in-Enable-BLS-configuration-if-new-kernel-p.patch
Peter Jones 3b94406a9e "Minor" bug fixes
CVE-2020-10713
  CVE-2020-14308
  CVE-2020-14309
  CVE-2020-14310
  CVE-2020-14311
  CVE-2020-15705
  CVE-2020-15706
  CVE-2020-15707

Signed-off-by: Peter Jones <pjones@redhat.com>
2020-07-29 13:39:24 -04:00

42 lines
1.5 KiB
Diff

From 1beb2d222a7ace793287211ae3265a95bff09ad5 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 16 Apr 2020 21:11:04 +0200
Subject: [PATCH 202/237] 10_linux.in: Enable BLS configuration if
new-kernel-pkg isn't present
Currently if the the GRUB_ENABLE_BLSCFG option in /etc/default/grub hasn't
been set, the 10_linux script will generate a GRUB configuration that does
not include the blscfg command to populate the menu entries from BLS files.
But on kernel install the /usr/lib/kernel/install.d/20-grub.install script
will only add menuentry commands to the GRUB config file if the old grubby
tool and new-kernel-pkg script are installed.
So a configuration with the GRUB_ENABLE_BLSCFG option will lead to a setup
where new kernel entries are not added. Make a BLS config the default if
that option wasn't set and the new-kernel-pkg script is not present.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub.d/10_linux.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index d5319300e04..b99eaa8f203 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -96,6 +96,11 @@ cat <<EOF
EOF
}
+# Make BLS the default if GRUB_ENABLE_BLSCFG was not set and grubby is not installed.
+if [ -z "${GRUB_ENABLE_BLSCFG}" ] && [ -z "$(which new-kernel-pkg 2> /dev/null)" ]; then
+ GRUB_ENABLE_BLSCFG="true"
+fi
+
if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then
if [ x$dirname = x/ ]; then
if [ -z "${prepare_root_cache}" ]; then
--
2.26.2