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-24 15:49:54 +0100
committerGitHub <noreply@github.com>2021-03-24 15:49:54 +0100
commit89a2e1eb2b4f02df2d5ccab4c11f4c9f22dd9b48 (patch)
tree8a286dda739b023f577d404c60678dbb27856329 /archinstall
parent037332a18d2c506d1dd0bef7b3450c8308792f61 (diff)
Fixes an issue with completely empty hard drives
If empty hard drives are being set up for the first time, then `.has_content()`'s `mount` call will fail with `wrong fstype` since there's no filesystem yet. First step in this case is to check for that scenario, then check for content.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index b66aa162..2eef0e82 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -204,6 +204,9 @@ class Partition():
return None
def has_content(self):
+ if not get_filesystem_type(self.path):
+ return False
+
temporary_mountpoint = '/tmp/'+hashlib.md5(bytes(f"{time.time()}", 'UTF-8')+os.urandom(12)).hexdigest()
temporary_path = pathlib.Path(temporary_mountpoint)
@@ -529,4 +532,4 @@ def get_filesystem_type(path):
handle = sys_command(f"blkid -o value -s TYPE {path}")
return b''.join(handle).strip().decode('UTF-8')
except SysCallError:
- return None \ No newline at end of file
+ return None