summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--fsset.py33
-rw-r--r--upgrade.py4
3 files changed, 30 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 29ea7005a..4fcf5892a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-21 Chris Lumens <clumens@redhat.com>
+
+ * fsset.py (turnOnSwap): Print out a more descriptive error
+ message if swap partition cannot be mounted (#143000).
+ * upgrade.py (createSwapFile,upgradeMountFilesystems): Likewise.
+
2004-12-21 Jeremy Katz <katzj@redhat.com>
* scripts/mk-images (makeinitrd): Just create /dev
diff --git a/fsset.py b/fsset.py
index 52dcd48d7..8f4704a62 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1341,7 +1341,7 @@ MAILADDR root
if label:
entry.setLabel(label)
- def turnOnSwap (self, chroot):
+ def turnOnSwap (self, chroot, upgrading=False):
for entry in self.entries:
if (entry.fsystem and entry.fsystem.getName() == "swap"
and not entry.isMounted()):
@@ -1350,16 +1350,27 @@ MAILADDR root
self.mountcount = self.mountcount + 1
except SystemError, (num, msg):
if self.messageWindow:
- self.messageWindow(_("Error"),
- _("Error enabling swap device %s: "
- "%s\n\n"
- "This most likely means this "
- "swap partition has not been "
- "initialized."
- "\n\n"
- "Press OK to reboot your "
- "system.")
- % (entry.device.getDevice(), msg))
+ if upgrading:
+ self.messageWindow(_("Error"),
+ _("Error enabling swap device "
+ "%s: %s\n\n"
+ "The /etc/fstab on your "
+ "upgrade partition does not "
+ "reference a valid swap "
+ "partition.\n\n"
+ "Press OK to reboot your "
+ "system.")
+ % (entry.device.getDevice(), msg))
+ else:
+ self.messageWindow(_("Error"),
+ _("Error enabling swap device "
+ "%s: %s\n\n"
+ "This most likely means this "
+ "swap partition has not been "
+ "initialized.\n\n"
+ "Press OK to reboot your "
+ "system.")
+ % (entry.device.getDevice(), msg))
sys.exit(0)
def labelEntry(self, entry, chroot):
diff --git a/upgrade.py b/upgrade.py
index 3a4f2053a..3499ba2b9 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -246,7 +246,7 @@ def createSwapFile(instPath, theFsset, mntPoint, size):
entry.setFormat(1)
theFsset.add(entry)
theFsset.formatEntry(entry, instPath)
- theFsset.turnOnSwap(instPath)
+ theFsset.turnOnSwap(instPath, upgrading=True)
# XXX generalize fstab modification
f = open(fstabPath, "a")
@@ -326,7 +326,7 @@ def upgradeMountFilesystems(intf, rootInfo, oldfsset, instPath):
oldfsset.add(entry)
if flags.setupFilesystems:
- oldfsset.turnOnSwap(instPath)
+ oldfsset.turnOnSwap(instPath, upgrading=True)
# move the old pre-convert db back in case of problems
def resetRpmdb(olddb, instPath):