diff options
-rw-r--r-- | dispatch.py | 6 | ||||
-rw-r--r-- | fsset.py | 6 | ||||
-rw-r--r-- | packages.py | 3 | ||||
-rw-r--r-- | partitioning.py | 27 |
4 files changed, 37 insertions, 5 deletions
diff --git a/dispatch.py b/dispatch.py index 8c1ad0620..a484b6371 100644 --- a/dispatch.py +++ b/dispatch.py @@ -68,9 +68,9 @@ installSteps = [ ("upgradeswapsuggestion", upgradeSwapSuggestion, ("dispatch", "id", "instPath")), ("addswap", ("intf", "id.fsset", "instPath", "id.upgradeSwapInfo")), - ("partitiondone", partitioningComplete, ("dispatch", "id.bootloader", - "id.fsset", "id.diskset", - "id.partitions")), + ("partitiondone", partitioningComplete, ("id.bootloader", "id.fsset", + "id.diskset", "id.partitions", + "intf", "instPath", "dir")), ("upgrademigfind", upgradeMigrateFind, ("dispatch", "id.partitions")), ("upgrademigratefs", ("id.fsset", "id.partitions")), ("bootloadersetup", bootloaderSetupChoices, ("dispatch", "id.bootloader", @@ -461,7 +461,11 @@ class FileSystemSet: def __init__(self): self.messageWindow = None self.progressWindow = None + self.mountcount = 0 self.reset() + + def isActive(self): + return self.mountcount != 0 def registerMessageWindow(self, method): self.messageWindow = method @@ -660,6 +664,7 @@ class FileSystemSet: and not entry.isMounted()): try: entry.mount(chroot) + self.mountcount = self.mountcount + 1 except SystemError, (errno, msg): if self.messageWindow: self.messageWindow(_("Error"), @@ -764,6 +769,7 @@ class FileSystemSet: continue try: entry.mount(instPath) + self.mountcount = self.mountcount + 1 except SystemError, (errno, msg): if raiseErrors: raise SystemError, (errno, msg) diff --git a/packages.py b/packages.py index 343aa8710..5c648bbb8 100644 --- a/packages.py +++ b/packages.py @@ -312,7 +312,8 @@ def turnOnFilesystems(dir, thefsset, diskset, upgrade, instPath): if flags.setupFilesystems: if not upgrade.get(): thefsset.setActive(diskset) - diskset.savePartitions () + if not thefsset.isActive(): + diskset.savePartitions () thefsset.checkBadblocks(instPath) thefsset.formatSwap(instPath) thefsset.turnOnSwap(instPath) diff --git a/partitioning.py b/partitioning.py index 59bced11a..08855127e 100644 --- a/partitioning.py +++ b/partitioning.py @@ -1334,7 +1334,19 @@ def doEditPartitionByRequest(intf, requestlist, part): % (get_partition_name(part))) -def partitioningComplete(dispatch, bl, fsset, diskSet, partitions): +def partitioningComplete(bl, fsset, diskSet, partitions, intf, instPath, dir): + if dir == DISPATCH_BACK and fsset.isActive(): + rc = intf.messageWindow(_("Installation cannot continue."), + _("The partitioning options you have chosen " + "have already been activated. You can " + "no longer return to the disk editing " + "screen. Would you like to continue " + "with the installation process?"), + type = "yesno") + if rc == 0: + sys.exit(0) + return DISPATCH_FORWARD + fsset.reset() for request in partitions.requests: # XXX improve sanity checking @@ -1343,6 +1355,19 @@ def partitioningComplete(dispatch, bl, fsset, diskSet, partitions): continue entry = request.toEntry(partitions) fsset.add (entry) + if iutil.memInstalled() > isys.EARLY_SWAP_RAM: + return + rc = intf.messageWindow(_("Low Memory"), + _("As you don't have much memory in this " + "machine, we need to turn on swap space " + "immediately. To do this we'll have to " + "write your new partition table to the disk " + "immediately. Is that okay?"), "okcancel") + if rc: + fsset.setActive(diskSet) + diskSet.savePartitions () + fsset.formatSwap(instPath) + fsset.turnOnSwap(instPath) def queryFormatPreExisting(intf): rc = intf.messageWindow(_("Format?"), |