From a156f224a87a02d6b0f9a54eef2ce18e418e5187 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 29 Mar 2021 08:56:41 +0200 Subject: Fixing un-encrypted drives matching on block encrypted. --- archinstall/lib/disk.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'archinstall') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index c1db3dc9..85b08bc0 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -142,7 +142,8 @@ class Partition(): self.target_mountpoint = mountpoint self.filesystem = filesystem self.size = size # TODO: Refresh? - self._encrypted = encrypted + self._encrypted = None + self.encrypted = encrypted self.allow_formatting = False # A fail-safe for unconfigured partitions, such as windows NTFS partitions. if mountpoint: @@ -161,7 +162,7 @@ class Partition(): self.filesystem = fstype if self.filesystem == 'crypto_LUKS': - self._encrypted = True + self.encrypted = True def __lt__(self, left_comparitor): if type(left_comparitor) == Partition: -- cgit v1.2.3-70-g09d2 From 3161cd8afff2def3d4d3057cb028c666c4db55a3 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 29 Mar 2021 09:09:25 +0200 Subject: Fixing rare occation where partitions dissapear just before .format(). --- archinstall/lib/disk.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'archinstall') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 85b08bc0..9afece2e 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -270,6 +270,11 @@ class Partition(): if allow_formatting is None: allow_formatting = self.allow_formatting + # To avoid "unable to open /dev/x: No such file or directory" + start_wait = time.time() + while pathlib.Path(path).exists() is False and time.time() - start_wait < 10: + time.sleep(0.025) + if not allow_formatting: raise PermissionError(f"{self} is not formatable either because instance is locked ({self.allow_formatting}) or a blocking flag was given ({allow_formatting})") -- cgit v1.2.3-70-g09d2