redhat-upgrade-tool/SOURCES/0004-Fix-detection-of-grub-...

44 lines
1.6 KiB
Diff

From 798f911a10b502144ca502d5a9063648f17aaaa0 Mon Sep 17 00:00:00 2001
From: Petr Stodulka <pstodulk@redhat.com>
Date: Thu, 30 Jul 2020 16:34:56 +0200
Subject: [PATCH] Fix detection of grub device on UEFI in Boom
Previously Boom has not been able to detect the grub1 device because
of used ESP mountpoint on RHEL 6. That results in state the grub
entry with snapshot has not been bootable as the `root` device was
`None`.
Author: Bryn Reeves <breeves@redhat.com>
---
boom-0.8/boom/legacy.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/boom-0.8/boom/legacy.py b/boom-0.8/boom/legacy.py
index bedf219..53cf939 100644
--- a/boom-0.8/boom/legacy.py
+++ b/boom-0.8/boom/legacy.py
@@ -68,10 +68,19 @@ def _get_grub1_device(force=False):
if __grub1_device and not force:
return __grub1_device
+ # FIX detection of grub device on UEFI on RHEL 6:
+ # the original code cannot detect the device in case of UEFI, because
+ # the ESP mount point is on efi/ . Trimming the 'efi/' prefix doesn't
+ # work as well, as the _loader_map[BOOM_LOADER_GRUB1][2] returns different
+ # device than grub is located in real - e.g. hd(0,0) instead of hd(0,1)
+ # because of that, use the splash.xpm.gz file, which is located on every
+ # x86_64 RHEL 6 system.
+ cfg_path = "grub/splash.xpm.gz"
+
# The grub1 binary
grub_cmd = "grub"
# The command to issue to discover the /boot device
- find_cmd = "find /%s\n" % _loader_map[BOOM_LOADER_GRUB1][2]
+ find_cmd = "find /%s\n" % cfg_path
# Regular expression matching a valid grub device string
find_rgx = r" \(hd\d+,\d+\)"
--
2.25.4