[PATCH] Fix EFI boot from multipath device (#691794)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If we are booting from multipath, efibootmgr needs to be called on
all constituent devices, much like RAID1 boot would be for it's
mirrored /boot partitions.
---
 booty/bootloaderInfo.py |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 9011886..c1486bf 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -678,13 +678,23 @@ class efiBootloaderInfo(bootloaderInfo):
             log.error("bootdev not found for '%s'" % (bootdisk,))
             return 1
 
-        argv = [ "efibootmgr", "-c" , "-w", "-L",
-                 productName, "-d", "%s" % (bootdev.path,),
-                 "-p", "%s" % (bootpart,),
-                 "-l", "\\EFI\\redhat\\" + self.bootloader ]
-        rc = iutil.execWithRedirect(argv[0], argv[1:], root = instRoot,
-                                    stdout = "/dev/tty5",
-                                    stderr = "/dev/tty5")
+        # if the bootdev is multipath, we need to call efibootmgr on all it's
+        # member devices
+        if isinstance(bootdev, MultipathDevice):
+            bootdevlist = bootdev.parents
+        else:
+            bootdevlist = [bootdev]
+
+        for d in bootdevlist:
+            argv = [ "efibootmgr", "-c" , "-w", "-L",
+                     productName, "-d", "%s" % (d.path,),
+                     "-p", "%s" % (bootpart,),
+                     "-l", "\\EFI\\redhat\\" + self.bootloader ]
+            rc = iutil.execWithRedirect(argv[0], argv[1:], root = instRoot,
+                                        stdout = "/dev/tty5",
+                                        stderr = "/dev/tty5")
+            
+        # return last rc, the API doesn't provide anything better than this
         return rc
 
     def getEfiProductPath(self, productName, force=False):
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux