[Pkg-privacy-commits] [tails-installer] 08/08: Unmount the drive before writing in linux
Intrigeri
intrigeri at moszumanska.debian.org
Wed May 24 15:27:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to tag 3.93.1
in repository tails-installer.
commit b7091fee9ee985e7ccbd8509a9ebf0607951b5b1
Author: Martin Briza <mbriza at redhat.com>
Date: Thu Apr 21 17:49:05 2016 +0200
Unmount the drive before writing in linux
---
liveusb/creator.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/liveusb/creator.py b/liveusb/creator.py
index dfd35e4..0c14538 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -359,6 +359,12 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
if update_function:
update_function(0.0)
+ for i in os.listdir('/dev'):
+ dev = os.path.join('/dev/', i)
+ if dev.startswith(os.path.normpath(drive)) and dev != os.path.normpath(drive):
+ umount = subprocess.Popen(['umount', '-f', dev], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ umount.wait()
+
self.log.debug(_('Running'), cmd)
dd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=0, universal_newlines=True)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list