diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-07-09 20:15:18 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-07-09 20:15:18 +0000 |
commit | f6085473a01ef5e6c9ca28021e951dd71f3ce0c0 (patch) | |
tree | 780fbb89110eaf6ee68394bb9cc295473ac09f0c | |
parent | 3e0d32e619e3a744f146ef061b13b0db1e8e9d3a (diff) | |
download | anaconda-f6085473a01ef5e6c9ca28021e951dd71f3ce0c0.tar.gz anaconda-f6085473a01ef5e6c9ca28021e951dd71f3ce0c0.tar.xz anaconda-f6085473a01ef5e6c9ca28021e951dd71f3ce0c0.zip |
fdisk works again; main change is making sure we close the disk devices
before running fdisk so the magic reread partition tables ioctl can work
-rw-r--r-- | dispatch.py | 2 | ||||
-rw-r--r-- | iw/fdisk_gui.py | 13 | ||||
-rw-r--r-- | partitioning.py | 4 | ||||
-rw-r--r-- | textw/fdisk_text.py | 12 |
4 files changed, 22 insertions, 9 deletions
diff --git a/dispatch.py b/dispatch.py index 8df5a7349..7c49e28aa 100644 --- a/dispatch.py +++ b/dispatch.py @@ -55,7 +55,7 @@ installSteps = [ ( "partitionmethodsetup", partitionMethodSetup, ("id.partitions", "dispatch") ), ( "autopartition", ("id.diskset", "id.partitions", "intf", "dispatch") ), ( "autopartitionexecute", doAutoPartition, ("dir", "id.diskset", "id.partitions", "intf")), - ( "fdisk", ("id.useFdisk", "id.diskset", "id.partitions")), + ( "fdisk", ("id.diskset", "id.partitions")), ( "partition", ("id.fsset", "id.diskset", "id.partitions", "intf")), ( "upgrademount", upgradeMountFilesystems, ("intf", "id.upgradeRoot", "id.fsset", "instPath")), diff --git a/iw/fdisk_gui.py b/iw/fdisk_gui.py index 1d59d671d..0b046027f 100644 --- a/iw/fdisk_gui.py +++ b/iw/fdisk_gui.py @@ -13,8 +13,8 @@ class FDiskWindow (InstallWindow): ics.readHTML ("fdisk") def getNext(self): - # reread partitions + self.diskset.refreshDevices() self.partrequests.setFromDisk(self.diskset) return None @@ -29,11 +29,13 @@ class FDiskWindow (InstallWindow): except: # XXX fixme pass + self.ics.readHTML ("fdisk") self.ics.setPrevEnabled (1) self.ics.setNextEnabled (1) # self.ics.setHelpEnabled (1) + def button_clicked (self, widget, drive): zvt = ZvtTerm (80, 24) zvt.set_del_key_swap(TRUE) @@ -63,7 +65,7 @@ class FDiskWindow (InstallWindow): self.ics.setNextEnabled (0) # FDiskWindow tag="fdisk" - def getScreen (self, useFdisk, diskset, partrequests): + def getScreen (self, diskset, partrequests): self.diskset = diskset self.partrequests = partrequests @@ -74,7 +76,12 @@ class FDiskWindow (InstallWindow): box = GtkVButtonBox () label = GtkLabel (_("Select drive to run fdisk on")) - for drive in self.diskset.driveList(): + drives = self.diskset.driveList() + + # close all references we had to the diskset + self.diskset.closeDevices() + + for drive in drives: button = GtkButton (drive) button.connect ("clicked", self.button_clicked, drive) box.add (button) diff --git a/partitioning.py b/partitioning.py index e73d5e730..6e26eb40a 100644 --- a/partitioning.py +++ b/partitioning.py @@ -941,6 +941,10 @@ class DiskSet: self.disks = {} self.openDevices() + def closeDevices (self): + for disk in self.disks.keys(): + del self.disks[disk] + def openDevices (self): if self.disks: return diff --git a/textw/fdisk_text.py b/textw/fdisk_text.py index 14c1ece72..1bf9c8157 100644 --- a/textw/fdisk_text.py +++ b/textw/fdisk_text.py @@ -22,16 +22,16 @@ from translate import _, cat, N_ from constants_text import * class fdiskPartitionWindow: - def __call__(self, screen, useFdisk, diskset, partrequests): - if not useFdisk: - return INSTALL_NOOP - + def __call__(self, screen, diskset, partrequests): choices = [] drives = diskset.disks.keys() drives.sort() for drive in drives: choices.append("%s" %(drive)) + # close all references we had to the diskset + diskset.closeDevices() + button = None while button != "done" and button != "back": (button, choice) = \ @@ -63,7 +63,9 @@ class fdiskPartitionWindow: except: pass - partrequests.setFromDisk(diskset) + + diskset.refreshDevices() + partrequests.setFromDisk(diskset) if button == TEXT_BACK_CHECK: return INSTALL_BACK |