diff options
author | Papoteur <papoteur@mageia.org> | 2018-12-14 19:18:42 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2018-12-15 15:58:21 +0100 |
commit | 81829df4a093f8f3648483f52ae8de683e0becfa (patch) | |
tree | 9f49792410c1b9e5a930dcd43fba6d1e3d36725e /backend/raw_write.py | |
parent | 790b0c624000b023d18f32aaa3387de36e24a7ec (diff) | |
download | isodumper-81829df4a093f8f3648483f52ae8de683e0becfa.tar isodumper-81829df4a093f8f3648483f52ae8de683e0becfa.tar.gz isodumper-81829df4a093f8f3648483f52ae8de683e0becfa.tar.bz2 isodumper-81829df4a093f8f3648483f52ae8de683e0becfa.tar.xz isodumper-81829df4a093f8f3648483f52ae8de683e0becfa.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 | 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): |