summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2011-03-15 12:19:38 -0700
committerBrian C. Lane <bcl@redhat.com>2011-03-16 11:48:04 -0700
commita0199361514c8aa12ad4403d2905eb40fade3af2 (patch)
tree1682369e29400b66d0545bf3d16b926fda8e0f29
parentedff9f47fd4cef809dc61d0435bc464a4dd0dced (diff)
downloadanaconda-a0199361514c8aa12ad4403d2905eb40fade3af2.tar.gz
anaconda-a0199361514c8aa12ad4403d2905eb40fade3af2.tar.xz
anaconda-a0199361514c8aa12ad4403d2905eb40fade3af2.zip
Restore stats from original mount on livecd (#683682)
Gather filesystem stats from the original directory instead of from the new partition.
-rw-r--r--pyanaconda/livecd.py36
1 files changed, 14 insertions, 22 deletions
diff --git a/pyanaconda/livecd.py b/pyanaconda/livecd.py
index bc5494008..199f5c5eb 100644
--- a/pyanaconda/livecd.py
+++ b/pyanaconda/livecd.py
@@ -251,6 +251,8 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
# And now let's do the real copies
for tocopy in mountpoints:
device = anaconda.storage.mountpoints[tocopy]
+ source = "%s/%s" % (anaconda.rootPath, tocopy)
+ dest = "/mnt/%s" % (tocopy,)
# FIXME: all calls to wait.refresh() are kind of a hack... we
# should do better about not doing blocking things in the
@@ -258,34 +260,24 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
# time.
wait.refresh()
- log.info("Copying %s/%s to /mnt/%s" % (anaconda.rootPath, tocopy, tocopy))
- copytree("%s/%s" % (anaconda.rootPath, tocopy),
- "/mnt/%s" % (tocopy,),
- True, True, flags.selinux)
- wait.refresh()
- log.info("Removing %s/%s" % (anaconda.rootPath, tocopy))
- shutil.rmtree("%s/%s" % (anaconda.rootPath, tocopy))
- wait.refresh()
-
- # now unmount each fs, collect stat info for the mountpoint, then
- # remove the entire tree containing the mountpoint
- for tocopy in mountpoints:
- device = anaconda.storage.mountpoints[tocopy]
- device.format.teardown()
-
try:
- log.info("Gathering stats on /mnt/%s" % (tocopy,))
- stats[tocopy]= os.stat("/mnt/%s" % (tocopy,))
+ log.info("Gathering stats on %s" % (source,))
+ stats[tocopy]= os.stat(source)
except Exception as e:
log.info("failed to get stat info for mountpoint %s: %s"
- % (tocopy, e))
+ % (source, e))
+
+ log.info("Copying %s to %s" % (source, dest))
+ copytree(source, dest, True, True, flags.selinux)
+ wait.refresh()
- log.info("Removing /mnt/%s" % (tocopy.split("/")[1]))
- shutil.rmtree("/mnt/%s" % (tocopy.split("/")[1]))
+ log.info("Removing %s" % (source,))
+ shutil.rmtree(source)
wait.refresh()
- # now mount all of the filesystems so that post-install writes end
- # up where they're supposed to end up
+ # unmount the target filesystems and remount in their final locations
+ # so that post-install writes end up where they're supposed to end up
+ _setupFilesystems(anaconda.storage.mountpoints, teardown=True)
_setupFilesystems(anaconda.storage.mountpoints,
chroot=anaconda.rootPath)