Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/filesystem.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-12-16 09:00:10 +0000
committerGitHub <noreply@github.com>2021-12-16 09:00:10 +0000
commit7a018415862677c165494decc5d8ad9e06c65fb7 (patch)
tree0d216ce16b2e02f5270560621185db6ea8afee0d /archinstall/lib/disk/filesystem.py
parent3c2e71b4bbfa2168afb54eb70aeecce9064c8435 (diff)
Changed lsblk to blkid where possible (#802)
* Swapped lsblk for blkid * Added a hefty sleep on partprobe() And added a TODO for the future
Diffstat (limited to 'archinstall/lib/disk/filesystem.py')
-rw-r--r--archinstall/lib/disk/filesystem.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index ac970b2a..72be7e70 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -36,6 +36,9 @@ class Filesystem:
def partuuid_to_index(self, uuid):
for i in range(storage['DISK_RETRY_ATTEMPTS']):
self.partprobe()
+ time.sleep(5)
+
+ # TODO: Convert to blkid (or something similar, but blkid doesn't support traversing to list sub-PARTUUIDs based on blockdevice path?)
output = json.loads(SysCommand(f"lsblk --json -o+PARTUUID {self.blockdevice.device}").decode('UTF-8'))
for device in output['blockdevices']:
@@ -127,7 +130,6 @@ class Filesystem:
def partprobe(self):
SysCommand(f'bash -c "partprobe"')
- time.sleep(1)
def raw_parted(self, string: str):
if (cmd_handle := SysCommand(f'/usr/bin/parted -s {string}')).exit_code != 0:
@@ -205,5 +207,9 @@ class Filesystem:
SysCommand(f'bash -c "umount {device}?"')
except:
pass
+
+ self.partprobe()
+ worked = self.raw_parted(f'{device} mklabel {disk_label}').exit_code == 0
self.partprobe()
- return self.raw_parted(f'{device} mklabel {disk_label}').exit_code == 0
+
+ return worked