diff options
author | Matt Wilson <msw@redhat.com> | 2001-06-22 01:37:38 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2001-06-22 01:37:38 +0000 |
commit | 2f877812ad4dde15b825bed82c602e800a1d35ef (patch) | |
tree | c702b993b07e70bda7ef2ae75aa779d2bfd7bfb3 /partitioning.py | |
parent | faec668c85c1c079fa697b5ec5378ad6e4bbf338 (diff) | |
download | anaconda-2f877812ad4dde15b825bed82c602e800a1d35ef.tar.gz anaconda-2f877812ad4dde15b825bed82c602e800a1d35ef.tar.xz anaconda-2f877812ad4dde15b825bed82c602e800a1d35ef.zip |
first pass at getting things in alignment for gui upgrades. Should only affect upgrades, not installs
Diffstat (limited to 'partitioning.py')
-rw-r--r-- | partitioning.py | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/partitioning.py b/partitioning.py index bd30bc591..253e5ef55 100644 --- a/partitioning.py +++ b/partitioning.py @@ -576,7 +576,7 @@ class DiskSet: labels = {} drives = self.disks.keys() - drives.sort + drives.sort() for drive in drives: disk = self.disks[drive] @@ -592,6 +592,69 @@ class DiskSet: return labels + def findExistingRootPartitions(self): + rootparts = [] + + drives = self.disks.keys() + drives.sort() + + mdList = raid.startAllRaid(drives) + + for dev in mdList: + if not fsset.isValidExt2 (dev): + continue + + try: + isys.mount(dev, '/mnt/sysimage', readOnly = 1) + except SystemError, (errno, msg): + intf.messageWindow(_("Error"), + _("Error mounting filesystem on %s: %s") % (dev, msg)) + continue + if os.access ('/mnt/sysimage/etc/fstab', os.R_OK): + rootparts.append ((dev, "ext2")) + isys.umount('/mnt/sysimage') + + raid.stopAllRaid(mdList) + + drives = self.disks.keys() + drives.sort() + + for drive in drives: + disk = self.disks[drive] + part = disk.next_partition () + while part: + if part.fs_type and (part.fs_type.name == "ext2" + or part.fs_type.name == "ext3"): + node = get_partition_name(part) + try: + isys.mount(dev, '/mnt/sysimage') + except SystemError, (errno, msg): + intf.messageWindow(_("Error"), + _("Error mounting filesystem on " + "%s: %s") % (dev, msg)) + part = disk.next_partition(part) + continue + if os.access ('/mnt/sysimage/etc/fstab', os.R_OK): + rootparts.append ((dev, "ext2")) + isys.umount('/mnt/sysimage') + if part.fs_type and (part.fs_type.name == "DOS"): + try: + isys.mount(dev, '/mnt/sysimage', fstype = "vfat", + readOnly = 1) + except: + log("failed to mount vfat filesystem on %s\n" + % dev) + part = disk.next_partition(part) + continue + + if os.access('/mnt/sysimage/redhat.img', os.R_OK): + rootparts.append((dev, "vfat")) + + isys.umount('/mnt/sysimage') + + part = disk.next_partition(part) + return rootparts + def driveList (self): drives = isys.hardDriveDict().keys() drives.sort (isys.compareDrives) |