zengxyz / rpms / anaconda

Forked from rpms/anaconda 4 months ago
Clone
fbcaed
From 363ef4269a70772985955b17f309a3c9726af3b5 Mon Sep 17 00:00:00 2001
fbcaed
From: Colin Walters <walters@verbum.org>
fbcaed
Date: Sun, 19 Oct 2014 20:03:53 -0400
fbcaed
Subject: [PATCH 4/5] rpmostreepayload: Handle grub2+EFI layout
fbcaed
fbcaed
We previously assumed if /boot/grub2 exists it's in use, but we
fbcaed
actually need to check for /boot/grub2/grub.cfg, as on EFI the config
fbcaed
file is in /boot/EFI.
fbcaed
---
fbcaed
 pyanaconda/packaging/rpmostreepayload.py | 12 +++++-------
fbcaed
 1 file changed, 5 insertions(+), 7 deletions(-)
fbcaed
fbcaed
diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py
fbcaed
index b5ee16b..e69d695 100644
fbcaed
--- a/pyanaconda/packaging/rpmostreepayload.py
fbcaed
+++ b/pyanaconda/packaging/rpmostreepayload.py
fbcaed
@@ -286,15 +286,13 @@ class RPMOSTreePayload(ArchivePayload):
fbcaed
 
fbcaed
         # And if we're using GRUB2, move its config file, also with a
fbcaed
         # compatibility symlink.
fbcaed
-        boot_grub2 = boot + '/grub2'
fbcaed
-        if os.path.isdir(boot_grub2):
fbcaed
+        boot_grub2_cfg = boot + '/grub2/grub.cfg'
fbcaed
+        if os.path.isfile(boot_grub2_cfg):
fbcaed
             boot_loader = boot + '/loader'
fbcaed
-            orig_grub_cfg = boot_grub2 + '/grub.cfg'
fbcaed
             target_grub_cfg = boot_loader + '/grub.cfg'
fbcaed
-            log.info("Moving %s -> %s", orig_grub_cfg, target_grub_cfg)
fbcaed
-            os.rename(orig_grub_cfg, target_grub_cfg)
fbcaed
-            os.symlink('../loader/grub.cfg', orig_grub_cfg)
fbcaed
-
fbcaed
+            log.info("Moving %s -> %s", boot_grub2_cfg, target_grub_cfg)
fbcaed
+            os.rename(boot_grub2_cfg, target_grub_cfg)
fbcaed
+            os.symlink('../loader/grub.cfg', boot_grub2_cfg)
fbcaed
 
fbcaed
         # OSTree owns the bootloader configuration, so here we give it
fbcaed
         # the argument list we computed from storage, architecture and
fbcaed
-- 
fbcaed
1.8.3.1
fbcaed