diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-07-10 06:40:18 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-07-10 06:40:18 +0000 |
commit | 58000433bade032050f8162186c6f17ac16b1d81 (patch) | |
tree | 4f41257d673b14eca2e6579df97186988937e1dc /fsset.py | |
parent | 59fc1c2d9bd840c4b651fe76b895f3bcfd6ab179 (diff) | |
download | anaconda-58000433bade032050f8162186c6f17ac16b1d81.tar.gz anaconda-58000433bade032050f8162186c6f17ac16b1d81.tar.xz anaconda-58000433bade032050f8162186c6f17ac16b1d81.zip |
set active partition
Diffstat (limited to 'fsset.py')
-rw-r--r-- | fsset.py | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -555,6 +555,46 @@ class FileSystemSet: (bootDev.device, N_("First sector of boot partition")) ] + # set active partition on disks + # if an active partition is set, leave it alone; if none set + # set either our boot partition or the first partition on the drive active + def setActive(self, diskset): + bootDev = self.bootloaderChoices(diskset)[1][0] + + for drive in diskset.disks.keys(): + foundActive = 0 + bootPart = None + disk = diskset.disks[drive] + part = disk.next_partition() + while part: + if not part.is_active(): + part = disk.next_partition(part) + continue + + if not part.is_flag_available(parted.PARTITION_BOOT): + foundActive = 1 + part = None + continue + + if part.get_flag(parted.PARTITION_BOOT): + foundActive = 1 + part = None + continue + + if not bootPart: + bootPart = part + + if partitioning.get_partition_name(part) == bootDev: + bootPart = part + + part = disk.next_partition(part) + + if bootPart and not foundActive: + bootPart.set_flag(parted.PARTITION_BOOT, 1) + + if bootPart: + del bootPart + def formatSwap (self, chroot): for entry in self.entries: if (not entry.fsystem or not entry.fsystem.getName() == "swap" |