summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fsset.py7
-rw-r--r--upgrade.py31
2 files changed, 26 insertions, 12 deletions
diff --git a/fsset.py b/fsset.py
index 3cad41c90..4d5963055 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1254,13 +1254,14 @@ class FileSystemSet:
return space
def hasDirtyFilesystems(self, mountpoint):
+ ret = []
if self.rootOnLoop():
entry = self.getEntryByMountPoint('/')
mountLoopbackRoot(entry.device.host[5:], skipMount = 1,
mountpoint = mountpoint)
dirty = isys.ext2IsDirty("loop1")
unmountLoopbackRoot(skipMount = 1, mountpoint = mountpoint)
- if dirty: return 1
+ if dirty: return [ "loop" ]
for entry in self.entries:
# XXX - multifsify, virtualize isdirty per fstype
@@ -1269,9 +1270,9 @@ class FileSystemSet:
if isys.ext2IsDirty(entry.device.getDevice()):
log("%s is a dirty ext2 partition" % entry.device.getDevice())
- return 1
+ ret.append(entry.device.getDevice())
- return 0
+ return ret
def umountFilesystems(self, instPath, ignoreErrors = 0):
# XXX remove special case
diff --git a/upgrade.py b/upgrade.py
index 87d0a81f6..2c9897737 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -49,6 +49,15 @@ def findExistingRoots(intf, id, chroot):
return rootparts
+def getDirtyDevString(dirtyDevs):
+ ret = ""
+ for dev in dirtyDevs:
+ if dev != "loop":
+ ret = "/dev/%s\n" % (dev,)
+ else:
+ ret = "%s\n" % (dev,)
+ return ret
+
def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
raiseErrors = 0, warnDirty = 0, readOnly = 0):
(root, rootFs) = rootInfo
@@ -72,20 +81,24 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
else:
isys.umount(instPath)
- if not allowDirty and oldfsset.hasDirtyFilesystems(instPath):
+ dirtyDevs = oldfsset.hasDirtyFilesystems(instPath)
+ if not allowDirty and dirtyDevs != []:
import sys
diskset.stopAllRaid()
intf.messageWindow(_("Dirty Filesystems"),
- _("One or more of the filesystems for your Linux system "
- "was not unmounted cleanly. Please boot your Linux "
- "installation, let the filesystems be checked, and "
- "shut down cleanly to upgrade."))
+ _("The following filesystems for your Linux system "
+ "were not unmounted cleanly. Please boot your "
+ "Linux installation, let the filesystems be "
+ "checked and shut down cleanly to upgrade.\n"
+ "%s" %(getDirtyDevString(dirtyDevs),)))
sys.exit(0)
- elif warnDirty and oldfsset.hasDirtyFilesystems():
+ elif warnDirty and dirtyDevs != []:
rc = intf.messageWindow(_("Dirty Filesystems"),
- _("One or more filesystems for your Linux system "
- "was not unmounted cleanly. Would you like to mount "
- "them anyway?"), type = "yesno")
+ _("The following filesystems for your Linux "
+ "system were not unmounted cleanly. Would "
+ "you like to mount them anyway?\n"
+ "%s" % (getDirtyDevString(dirtyDevs,))),
+ type = "yesno")
if rc == 0:
return -1