Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-21 17:25:18 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-21 17:25:18 +0100
commit298ed315318e75fe546144b781e4f9e9031d72db (patch)
tree3baf34f87d8e2c141c6fd63a10c1b41b452da605 /archinstall
parentc8470b81a6f2e8395f74ce0c1168d133fb24b811 (diff)
Added an option to force-flush a blockdevice cache. creating a new Filesystem() now triggers a flush of the cache since all partitions are removed. There shouldn't be any harm in even bypassing the cache, but it's there for a few reasons.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index fe891b28..efe3f50d 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -129,6 +129,9 @@ class BlockDevice():
return True
return False
+ def flush_cache(self):
+ self.part_cache = OrderedDict()
+
class Partition():
def __init__(self, path, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False, autodetect_filesystem=True):
if not part_id:
@@ -366,6 +369,7 @@ class Filesystem():
log(f'Wiping {self.blockdevice} by using partition format {self.mode}', level=LOG_LEVELS.Debug)
if self.mode == GPT:
if self.raw_parted(f'{self.blockdevice.device} mklabel gpt').exit_code == 0:
+ self.blockdevice.flush_cache()
return self
else:
raise DiskError(f'Problem setting the partition format to GPT:', f'/usr/bin/parted -s {self.blockdevice.device} mklabel gpt')