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.
This commit is contained in:
parent
7333fe109c
commit
2bf947ba05
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue