zengxyz / rpms / anaconda

Forked from rpms/anaconda 4 months ago
Clone
Blob Blame History Raw
From 363ef4269a70772985955b17f309a3c9726af3b5 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Sun, 19 Oct 2014 20:03:53 -0400
Subject: [PATCH 4/5] rpmostreepayload: Handle grub2+EFI layout

We previously assumed if /boot/grub2 exists it's in use, but we
actually need to check for /boot/grub2/grub.cfg, as on EFI the config
file is in /boot/EFI.
---
 pyanaconda/packaging/rpmostreepayload.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py
index b5ee16b..e69d695 100644
--- a/pyanaconda/packaging/rpmostreepayload.py
+++ b/pyanaconda/packaging/rpmostreepayload.py
@@ -286,15 +286,13 @@ class RPMOSTreePayload(ArchivePayload):
 
         # And if we're using GRUB2, move its config file, also with a
         # compatibility symlink.
-        boot_grub2 = boot + '/grub2'
-        if os.path.isdir(boot_grub2):
+        boot_grub2_cfg = boot + '/grub2/grub.cfg'
+        if os.path.isfile(boot_grub2_cfg):
             boot_loader = boot + '/loader'
-            orig_grub_cfg = boot_grub2 + '/grub.cfg'
             target_grub_cfg = boot_loader + '/grub.cfg'
-            log.info("Moving %s -> %s", orig_grub_cfg, target_grub_cfg)
-            os.rename(orig_grub_cfg, target_grub_cfg)
-            os.symlink('../loader/grub.cfg', orig_grub_cfg)
-
+            log.info("Moving %s -> %s", boot_grub2_cfg, target_grub_cfg)
+            os.rename(boot_grub2_cfg, target_grub_cfg)
+            os.symlink('../loader/grub.cfg', boot_grub2_cfg)
 
         # OSTree owns the bootloader configuration, so here we give it
         # the argument list we computed from storage, architecture and
-- 
1.8.3.1