[PATCH f16-branch] Copy all of live filesystem to target (#746844)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Brian C. Lane" <bcl@xxxxxxxxxx>

Instead of depending on currentSize to be correct just copy the whole
live filesystem over to the target.
---
 pyanaconda/livecd.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/livecd.py b/pyanaconda/livecd.py
index 199f5c5..c55689f 100644
--- a/pyanaconda/livecd.py
+++ b/pyanaconda/livecd.py
@@ -152,7 +152,8 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
         readamt = 1024 * 1024 * 8 # 8 megs at a time
         size = self.anaconda.storage.liveImage.format.currentSize * 1024 * 1024
         copied = 0
-        while copied < size:
+        done = False
+        while not done:
             try:
                 buf = os.read(osfd, readamt)
                 written = os.write(rootfd, buf)
@@ -174,8 +175,13 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
                     copied = 0
                     continue
 
-            if (written < readamt) and (written < len(buf)):
-                raise RuntimeError, "error copying filesystem!"
+            if (written < readamt):
+                # Either something went wrong with the write
+                if (written < len(buf)):
+                    raise RuntimeError, "error copying filesystem!"
+                else:
+                    # Or we're done
+                    done = True
             copied += written
             progress.set_fraction(pct = copied / float(size))
             progress.processEvents()
-- 
1.7.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux