diff options
author | Chris Lumens <clumens@redhat.com> | 2009-03-04 13:28:38 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-03-04 15:37:05 -0500 |
commit | 5addce7900be1341f6c22e5bd1af150c07002c95 (patch) | |
tree | 12100a90b141af07791c599c9276f89ef5ca94bb /booty | |
parent | d899dad616076a9c6183306c4cdcf442405c3190 (diff) | |
download | anaconda-5addce7900be1341f6c22e5bd1af150c07002c95.tar.gz anaconda-5addce7900be1341f6c22e5bd1af150c07002c95.tar.xz anaconda-5addce7900be1341f6c22e5bd1af150c07002c95.zip |
Adapt getPhysicalDevices to the new storage code.
Diffstat (limited to 'booty')
-rw-r--r-- | booty/x86.py | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/booty/x86.py b/booty/x86.py index a84519b13..b9c12cdd3 100644 --- a/booty/x86.py +++ b/booty/x86.py @@ -46,15 +46,9 @@ class x86BootloaderInfo(efiBootloaderInfo): # Accepted values for "device" are raid1 md devices (i.e. "md0"), # physical disks ("hda"), and real partitions on physical disks # ("hda1"). Volume groups/logical volumes are not accepted. - # - # XXX this has internal anaconda-ish knowledge. ick. - import isys - import lvm - - if string.split(device, '/', 1)[0] in map (lambda vg: vg[0], - lvm.vglist()): + if string.split(device, '/', 1)[0] in map (lambda x: x.name, self.storage.lvs + self.storage.vgs): return [] - + if device.startswith("mapper/luks-"): return [] @@ -316,26 +310,26 @@ class x86BootloaderInfo(efiBootloaderInfo): if os.access(instRoot + "/boot/grub/device.map", os.R_OK): os.rename(instRoot + "/boot/grub/device.map", instRoot + "/boot/grub/device.map.rpmsave") - if 1: # 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") - devs = usedDevs.keys() - usedDevs = {} - for dev in devs: - drive = fsset.getDiskPart(dev)[0] - if usedDevs.has_key(drive): - continue - usedDevs[drive] = 1 - devs = usedDevs.keys() - devs.sort() - for drive in devs: - # XXX hack city. If they're not the sort of thing that'll - # be in the device map, they shouldn't still be in the list. - if not drive.startswith('md'): - f.write("(%s) /dev/%s\n" % (self.grubbyDiskName(drive), - drive)) - f.close() - + + f = open(instRoot + "/boot/grub/device.map", "w+") + f.write("# this device map was generated by anaconda\n") + devs = usedDevs.keys() + usedDevs = {} + for dev in devs: + drive = fsset.getDiskPart(dev)[0] + if usedDevs.has_key(drive): + continue + usedDevs[drive] = 1 + devs = usedDevs.keys() + devs.sort() + for drive in devs: + # XXX hack city. If they're not the sort of thing that'll + # be in the device map, they shouldn't still be in the list. + if not drive.startswith('md'): + f.write("(%s) /dev/%s\n" % (self.grubbyDiskName(drive), + drive)) + f.close() + sysconf = '/etc/sysconfig/grub' if os.access (instRoot + sysconf, os.R_OK): self.perms = os.stat(instRoot + sysconf)[0] & 0777 |