diff options
Diffstat (limited to 'bootloader.py')
-rw-r--r-- | bootloader.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/bootloader.py b/bootloader.py index ca5c6e229..eb1edfc3c 100644 --- a/bootloader.py +++ b/bootloader.py @@ -444,6 +444,14 @@ class x86BootloaderInfo(bootloaderInfo): f.close() + if not os.access(instRoot + "/boot/grub/device.map", os.R_OK): + f = open(instRoot + "/boot/grub/device.map", "w+") + f.write("# this device map was generated by anaconda\n") + f.write("(fd0) /dev/fd0\n") + drive = getDiskPart(grubTarget)[0] + f.write("(%s) /dev/%s\n" % (grubbyDiskName(drive), drive)) + f.close() + if self.forceLBA32: forcelba = "--force-lba " else: @@ -470,7 +478,8 @@ class x86BootloaderInfo(bootloaderInfo): os.write(p[1], cmd + '\n') os.close(p[1]) iutil.execWithRedirect('/sbin/grub' , - [ "grub", "--batch", "--no-floppy" ], + [ "grub", "--batch", "--no-floppy", + "--device-map=/boot/grub/device.map" ], stdin = p[0], stdout = "/dev/tty5", stderr = "/dev/tty5", root = instRoot) @@ -674,10 +683,16 @@ def makeInitrd (kernelTag, instRoot): # return (disk, partition number) eg ('hda', 1) def getDiskPart(dev): cut = len(dev) - if dev[-2] in string.digits: - cut = -2 - elif dev[-1] in string.digits: - cut = -1 + if dev[:3] == "rd/" or dev[:4] == "ida/" or dev[:6] == "cciss/": + if dev[-2] == 'p': + cut = -1 + elif dev[-3] == 'p': + cut = -2 + else: + if dev[-2] in string.digits: + cut = -2 + elif dev[-1] in string.digits: + cut = -1 name = dev[:cut] |