diff options
author | Matt Wilson <msw@redhat.com> | 2001-06-27 06:27:58 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2001-06-27 06:27:58 +0000 |
commit | 2bba38c5baec17e551edab1b3fbfb62d8f315e5b (patch) | |
tree | cb8bc51e99a07d940ebc583b44e1de73bb8523cc /upgrade.py | |
parent | 08a3c481379fbf7d89894ab44a8805f155e0d0e9 (diff) | |
download | anaconda-2bba38c5baec17e551edab1b3fbfb62d8f315e5b.tar.gz anaconda-2bba38c5baec17e551edab1b3fbfb62d8f315e5b.tar.xz anaconda-2bba38c5baec17e551edab1b3fbfb62d8f315e5b.zip |
break upgrade swap suggestion out into another step and store its findings in
instdata.
Diffstat (limited to 'upgrade.py')
-rw-r--r-- | upgrade.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/upgrade.py b/upgrade.py index a1aff93ae..38689c6dc 100644 --- a/upgrade.py +++ b/upgrade.py @@ -23,6 +23,7 @@ import time import rpm import sys import os.path +import dispatch from flags import flags from partitioning import * from log import log @@ -79,7 +80,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0, oldfsset.mountFilesystems (instPath) # returns None if no more swap is needed -def swapSuggestion(instPath, fsset): +def upgradeSwapSuggestion(dispatch, id, instPath): # mem is in kb -- round it up to the nearest 4Mb mem = iutil.memInstalled(corrected = 0) rem = mem % 16384 @@ -87,18 +88,23 @@ def swapSuggestion(instPath, fsset): mem = mem + (16384 - rem) mem = mem / 1024 + dispatch.skipStep("addswap", 0) + # don't do this if we have more then 512 MB - if mem > 510: return None - + if mem > 510: + dispatch.skipStep("addswap", 1) + return + swap = iutil.swapAmount() / 1024 # if we have twice as much swap as ram, we're safe if swap >= (mem * 2): - return None + dispatch.skipStep("addswap", 1) + return fsList = [] - if fsset.rootOnLoop(): + if id.fsset.rootOnLoop(): space = isys.pathSpaceAvailable("/mnt/loophost") for entry in fsset.entries: @@ -108,7 +114,7 @@ def swapSuggestion(instPath, fsset): info = (entry.mountpoint, entry.device.getDevice(), space) fsList.append(info) else: - for entry in fsset.entries: + for entry in id.fsset.entries: # XXX multifsify if (entry.fsystem.getName() == "ext2" or entry.fsystem.getName() == "ext3"): @@ -125,7 +131,7 @@ def swapSuggestion(instPath, fsset): if (size > suggSize) and (size > (suggestion + 100)): suggMnt = mnt - return (fsList, suggestion, suggMnt) + id.upgradeSwapInfo = (fsList, suggestion, suggMnt) def swapfileExists(swapname): try: |