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