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-04-03 15:32:06 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-03 15:32:06 +0200
commit2bf947ba055722f58b568fc1c984a298ad230ecb (patch)
treed9199dfa3391a1a447524c246a9583b2781feb00 /archinstall
parent7333fe109ce832dcda1daa7f363e352990e66886 (diff)
This should correct #152. When a newly /boot partition is created with no content or incorrect filesystem (meaning, no file system yet), the .has_content() call will crash due to incorrect fstype. Which means we should be able to skip the check and assume it's safe to format. Because there's no way (?) other OS:es can store something on the boot partition on a broken FS.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 52c6e287..44d46c8b 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -245,9 +245,15 @@ class Partition():
if self.allow_formatting is False:
log(f"Partition {self} is not marked for formatting.", level=LOG_LEVELS.Debug)
return False
- elif self.target_mountpoint == '/boot' and self.has_content():
- log(f"Partition {self} is a boot partition and has content inside.", level=LOG_LEVELS.Debug)
- return False
+ elif self.target_mountpoint == '/boot':
+ try:
+ if self.has_content():
+ log(f"Partition {self} is a boot partition and has content inside.", level=LOG_LEVELS.Debug)
+ return False
+ except SysCallError as err:
+ log(err.message, LOG_LEVELS.Debug)
+ log(f"Partition {self} was identified as /boot but we could not mount to check for content, continuing!", level=LOG_LEVELS.Debug)
+ pass
return True