diff options
Diffstat (limited to 'backend/raw_write.py')
-rwxr-xr-x | backend/raw_write.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py index b8f307d..40a7de4 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -33,6 +33,7 @@ import gettext from subprocess import call, Popen, PIPE import hashlib import gnupg +import time class Dumper(object): @@ -221,9 +222,24 @@ class Dumper(object): self.return_state = True self.finished.set() - def _do_persistence(self, target): + def _do_persistence(self, target, label): p = Popen(["fdisk",target], stdin = PIPE) p.communicate(input=b'n\np\n3\n\n\nw\n') + # exemple mkfs.ext4 -L mgalive-persist /dev/sdf3 + process = Popen(['mkfs.ext4','-L', label, target+"3"]) + working=True + while working: + time.sleep(0.5) + process.poll() + rc=process.returncode + if rc is None: + working=True + else: + process = None + working= False + print(rc) + return rc + def __init__(self): |