Blame SOURCES/0145-Make-grub2-switch-to-blscfg-to-generate-BLS-fragment.patch

8631a2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8631a2
From: Javier Martinez Canillas <javierm@redhat.com>
8631a2
Date: Wed, 11 Apr 2018 12:39:59 +0200
8631a2
Subject: [PATCH] Make grub2-switch-to-blscfg to generate BLS fragment for
8631a2
 rescue kernel
8631a2
8631a2
If a rescue image is available, it should have a BootLoaderSpec fragment.
8631a2
8631a2
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
8631a2
---
8631a2
 util/grub-switch-to-blscfg.in | 4 ++++
8631a2
 1 file changed, 4 insertions(+)
8631a2
8631a2
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
f6e916
index c59299ffa..bc28053cd 100644
8631a2
--- a/util/grub-switch-to-blscfg.in
8631a2
+++ b/util/grub-switch-to-blscfg.in
8631a2
@@ -243,6 +243,10 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do
8631a2
     fi
8631a2
 done
8631a2
 
8631a2
+if [[ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]]; then
8631a2
+    mkbls "0-rescue-${MACHINE_ID}" "0" >"${blsdir}/${MACHINE_ID}-0-rescue.conf"
8631a2
+fi
8631a2
+
8631a2
 GENERATE=0
8631a2
 if grep '^GRUB_ENABLE_BLSCFG=.*' "${etcdefaultgrub}" \
8631a2
         | grep -vq '^GRUB_ENABLE_BLSCFG="*true"*\s*$' ; then