diff options
author | Papoteur <papoteur@mageia.org> | 2018-12-14 19:18:42 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2018-12-14 19:18:42 +0100 |
commit | a3e7fb77d6c8d1a4994b8427b85fa398e2be8bd3 (patch) | |
tree | abf57d339d6a1403e49104f0759f6a6ab40b3fba /backend/raw_write.py | |
parent | 790b0c624000b023d18f32aaa3387de36e24a7ec (diff) | |
download | isodumper-a3e7fb77d6c8d1a4994b8427b85fa398e2be8bd3.tar isodumper-a3e7fb77d6c8d1a4994b8427b85fa398e2be8bd3.tar.gz isodumper-a3e7fb77d6c8d1a4994b8427b85fa398e2be8bd3.tar.bz2 isodumper-a3e7fb77d6c8d1a4994b8427b85fa398e2be8bd3.tar.xz isodumper-a3e7fb77d6c8d1a4994b8427b85fa398e2be8bd3.zip |
Allow writing the label of persistent partition, fixed to "mgalive-persist"
Diffstat (limited to 'backend/raw_write.py')
-rwxr-xr-x | backend/raw_write.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py index b8f307d..d714932 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,25 @@ 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') + # mkfs.ext4 -L mgalive-persist /dev/sdf3 + print("Partition crée") + 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): |