Use the standard function for splitting the device name into
name and partition number
Tested on x86_64 EFI system
Resolves: rhbz#704378
---
booty/bootloaderInfo.py | 20 ++++++--------------
1 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index d9ab62e..5386dab 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -637,22 +637,14 @@ class efiBootloaderInfo(bootloaderInfo):
if not os.access(link, os.R_OK):
os.symlink("../%s" % (self.configfile), link)
- 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")
--
1.7.4.4