diff options
-rw-r--r-- | fsset.py | 15 | ||||
-rw-r--r-- | upgrade.py | 4 |
2 files changed, 10 insertions, 9 deletions
@@ -988,12 +988,13 @@ class FileSystemSet: space.sort(spaceSort) return space - def hasDirtyFilesystems(self): + def hasDirtyFilesystems(self, mountpoint): if self.rootOnLoop(): entry = self.getEntryByMountPoint('/') - mountLoopbackRoot(entry.device.host[5:], skipMount = 1) + mountLoopbackRoot(entry.device.host[5:], skipMount = 1, + mountpoint = mountpoint) dirty = isys.ext2IsDirty("loop1") - unmountLoopbackRoot(skipMount = 1) + unmountLoopbackRoot(skipMount = 1, mountpoint = mountpoint) if dirty: return 1 for entry in self.entries: @@ -1477,17 +1478,17 @@ def allocateLoopback(file): return None _loopbackRootDevice = None -def mountLoopbackRoot(device, skipMount=0): +def mountLoopbackRoot(device, skipMount=0, mountpoint="/mnt/sysimage"): global _loopbackRootDevice isys.mount(device, '/mnt/loophost', fstype = "vfat") _loopbackRootDevice = allocateLoopback("/mnt/loophost/redhat.img") if not skipMount: - isys.mount(_loopbackRootDevice, '/mnt/sysimage') + isys.mount(_loopbackRootDevice, mountpoint) -def unmountLoopbackRoot(skipMount=0): +def unmountLoopbackRoot(skipMount=0, mountpoint="/mnt/sysimage"): global _loopbackRootDevice if not skipMount: - isys.umount('/mnt/sysimage') + isys.umount(mountpoint) path = '/tmp/' + _loopbackRootDevice isys.makeDevInode(_loopbackRootDevice, path) isys.unlosetup(path) diff --git a/upgrade.py b/upgrade.py index 837fc4255..1f595a9d7 100644 --- a/upgrade.py +++ b/upgrade.py @@ -56,7 +56,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0, diskset.startAllRaid() if rootFs == "vfat": - mountLoopbackRoot(root) + mountLoopbackRoot(root, mountpoint = instPath) else: isys.mount(root, instPath, rootFs) @@ -66,7 +66,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0, oldfsset.add(entry) if rootFs == "vfat": - unmountLoopbackRoot() + unmountLoopbackRoot(mountpoint = instPath) else: isys.umount(instPath) |