liveusb/creator.py | 7 +++++++
liveusb/gui.py | 3 +++
2 files changed, 10 insertions(+)
New commits:
commit 73541669bbea35f57f2a296986739eac7ff7c940
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 31 13:17:11 2010 -0400
Flush filesystem buffers upon completion (linux only)
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 978cb88..32b885e 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -401,6 +401,10 @@ class LiveUSBCreator(object):
def reset_mbr(self):
pass
+ def flush_buffers(self):
+ """ Flush filesystem buffers """
+ pass
+
class LinuxLiveUSBCreator(LiveUSBCreator):
@@ -837,6 +841,9 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
self.log.info("sha1(%s) = %s" % (device_name, hexdigest))
return hexdigest
+ def flush_buffers(self):
+ self.popen('sync', passive=True)
+
class WindowsLiveUSBCreator(LiveUSBCreator):
diff --git a/liveusb/gui.py b/liveusb/gui.py
index a813546..c0380c3 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -212,6 +212,9 @@ class LiveUSBThread(QtCore.QThread):
# This sometimes causes segfaults in dbus.
#self.live.unmount_device()
+ # Flush all filesystem buffers
+ self.live.flush_buffers()
+
duration = str(datetime.now() - now).split('.')[0]
self.status(_("Complete! (%s)" % duration))