Re: [PATCH] Use getDiskPart for efibootmgr (#704378)

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

 



On 05/14/2011 02:28 AM, Brian C. Lane wrote:
Use the standard function for splitting the device name into
name and partition number
-        ind = len(bootdev)
-        try:
-            while (bootdev[ind-1] in string.digits):
-                ind = ind - 1
-        except IndexError:
-            ind = len(bootdev) - 1
-
-        bootdisk = bootdev[:ind]
-        bootpart = bootdev[ind:]
-        if (bootdisk.startswith('ida/') or bootdisk.startswith('cciss/') or
-            bootdisk.startswith('rd/') or bootdisk.startswith('sx8/')):
-            bootdisk = bootdisk[:-1]
+        (bootdisk, bootpart) = getDiskPart(bootdev, self.storage)
+        # getDiskPart returns a 0 indexed partition number
+        bootpart += 1

          argv = [ "efibootmgr", "-c" , "-w", "-L",
-                 productName, "-d", "/dev/%s" % bootdisk,
-                 "-p", bootpart, "-l", "\\EFI\\redhat\\" + self.bootloader ]
+                 productName, "-d", "/dev/%s" % (bootdisk,),
+                 "-p", "%s" % (bootpart,),
+                 "-l", "\\EFI\\redhat\\" + self.bootloader ]
          rc = iutil.execWithRedirect(argv[0], argv[1:], root = instRoot,
                                      stdout = "/dev/tty5",
                                      stderr = "/dev/tty5")

Ack.

Hm, why do you prefer

"/dev/%s" % (bootdisk,) over

"/dev/%s" % bootdisk ?

Ales

_______________________________________________
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