Added a check in guided to make it more visible that we check for filesystem supportation.
This commit is contained in:
parent
1253982c30
commit
acf39296ef
|
|
@ -113,7 +113,6 @@ class BlockDevice():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class Partition():
|
class Partition():
|
||||||
def __init__(self, path, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False):
|
def __init__(self, path, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False):
|
||||||
if not part_id:
|
if not part_id:
|
||||||
|
|
@ -138,15 +137,6 @@ class Partition():
|
||||||
self.mountpoint = partition_info['target']
|
self.mountpoint = partition_info['target']
|
||||||
self.filesystem = partition_info['fstype']
|
self.filesystem = partition_info['fstype']
|
||||||
|
|
||||||
# We perform a dummy format on /dev/null with the given filesystem-type
|
|
||||||
# in order to determain if we support it or not.
|
|
||||||
try:
|
|
||||||
self.format(self.filesystem, '/dev/null')
|
|
||||||
except SysCallError:
|
|
||||||
pass # We supported it, but /dev/null is not formatable as expected so the mkfs call exited with an error code
|
|
||||||
except UnknownFilesystemFormat as err:
|
|
||||||
raise err
|
|
||||||
|
|
||||||
def __repr__(self, *args, **kwargs):
|
def __repr__(self, *args, **kwargs):
|
||||||
if self.encrypted:
|
if self.encrypted:
|
||||||
return f'Partition(path={self.path}, real_device={self.real_device}, fs={self.filesystem}, mounted={self.mountpoint})'
|
return f'Partition(path={self.path}, real_device={self.real_device}, fs={self.filesystem}, mounted={self.mountpoint})'
|
||||||
|
|
@ -217,6 +207,17 @@ class Partition():
|
||||||
self.mountpoint = target
|
self.mountpoint = target
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def filesystem_supported(self):
|
||||||
|
# We perform a dummy format on /dev/null with the given filesystem-type
|
||||||
|
# in order to determain if we support it or not.
|
||||||
|
try:
|
||||||
|
self.format(self.filesystem, '/dev/null')
|
||||||
|
except SysCallError:
|
||||||
|
pass # We supported it, but /dev/null is not formatable as expected so the mkfs call exited with an error code
|
||||||
|
except UnknownFilesystemFormat as err:
|
||||||
|
raise err
|
||||||
|
return True
|
||||||
|
|
||||||
class Filesystem():
|
class Filesystem():
|
||||||
# TODO:
|
# TODO:
|
||||||
# When instance of a HDD is selected, check all usages and gracefully unmount them
|
# When instance of a HDD is selected, check all usages and gracefully unmount them
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,8 @@ if harddrive.has_partitions():
|
||||||
|
|
||||||
archinstall.log('Using existing partition table:')
|
archinstall.log('Using existing partition table:')
|
||||||
for partition in harddrive:
|
for partition in harddrive:
|
||||||
archinstall.log(f" {partition}")
|
if partition.filesystem_supported():
|
||||||
|
archinstall.log(f" {partition}")
|
||||||
else:
|
else:
|
||||||
print('Formatting woop woop!')
|
print('Formatting woop woop!')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue