dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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