[PATCH] Support for bootloader on md raid devices.

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

 



In f10, for /boot on md raid 1 we used to have only option to install
bootloader on partition but in fact, we installed on MBR. In f11 we added
option to instal to MBR in UI, and we are still installing on MBR for both
options.  In rhel 5 we are always installing bootloader on MBR too.  Also
grub-install /dev/md0 installs on MBR, so maybe this is not something we want
to do at all, but in that case, we should probably remove the option to install
bootloader on /dev/md0 raid device from UI.

Two issues:

* The patch assumes that 'mdX' bootloader target is md raid 1 device with members
being partitions. Intel bios raid using mdraid (or whole-disk md devices in general?)
need to be handled/considered.

* If we allow (start to do) installing on md raid partitions, upgrade should be
patched to count with this possibility. A little problem is that up to f11
boot=/dev/md0 we write into /etc/sysconfig/grub or grub.conf means that
bootloader was installed on mbr, and after patching it would mean that it is on
raid device (partitions).
---
 booty/x86.py |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/booty/x86.py b/booty/x86.py
index 3890e69..8527442 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -112,14 +112,13 @@ class x86BootloaderInfo(efiBootloaderInfo):
 
         for bootDev in bootDevs:
             cmds = []
-            gtPart = self.getMatchingPart(bootDev, grubTarget)
-            gtDisk = self.grubbyPartitionName(getDiskPart(gtPart, self.storage)[0])
+            gtDisk = self.grubbyPartitionName(getDiskPart(bootDev, self.storage)[0])
             bPart = self.grubbyPartitionName(bootDev)
             cmd = "root %s\n" % (bPart,)
 
             stage1Target = gtDisk
             if target == "partition":
-                stage1Target = self.grubbyPartitionName(gtPart)
+                stage1Target = bPart
 
             cmd += "install %s%s/stage1 d %s %s/stage2 p %s%s/grub.conf" % \
                 (args, grubPath, stage1Target, grubPath, bPart, grubPath)
@@ -155,7 +154,8 @@ class x86BootloaderInfo(efiBootloaderInfo):
                 if grubTarget[-2] == 'p' or \
                         (grubTarget[-2].isdigit() and grubTarget[-3] == 'p'):
                     target = "partition"
-        elif grubTarget[-1].isdigit() and not path.startswith('md'):
+        # NOTE: this includes also mdX grub targets
+        elif grubTarget[-1].isdigit():
             target = "partition"
 
         f = open(cf, "w+")
@@ -362,15 +362,6 @@ class x86BootloaderInfo(efiBootloaderInfo):
 
         return 0
 
-    def getMatchingPart(self, bootDev, target):
-        bootName, bootPartNum = getDiskPart(bootDev, self.storage)
-        devices = self.getPhysicalDevices(target)
-        for device in devices:
-            name, partNum = getDiskPart(device, self.storage)
-            if name == bootName:
-                return device
-        return devices[0]
-
     def grubbyDiskName(self, name):
         return "hd%d" % self.drivelist.index(name)
 
-- 
1.6.0.6

_______________________________________________
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