Moved the output of the current fileformat structure in guided, as well as added an option to supress the log message from format() in order to hide (for users) the some what confusing formating of /dev/null.
This commit is contained in:
parent
acf39296ef
commit
530edb5ece
|
|
@ -143,11 +143,13 @@ class Partition():
|
||||||
else:
|
else:
|
||||||
return f'Partition(path={self.path}, fs={self.filesystem}, mounted={self.mountpoint})'
|
return f'Partition(path={self.path}, fs={self.filesystem}, mounted={self.mountpoint})'
|
||||||
|
|
||||||
def format(self, filesystem, path=None):
|
def format(self, filesystem, path=None, log_formating=True):
|
||||||
if not path:
|
if not path:
|
||||||
path = self.path
|
path = self.path
|
||||||
|
|
||||||
log(f'Formatting {path} -> {filesystem}', level=LOG_LEVELS.Info)
|
if log_formating:
|
||||||
|
log(f'Formatting {path} -> {filesystem}', level=LOG_LEVELS.Info)
|
||||||
|
|
||||||
if filesystem == 'btrfs':
|
if filesystem == 'btrfs':
|
||||||
o = b''.join(sys_command(f'/usr/bin/mkfs.btrfs -f {path}'))
|
o = b''.join(sys_command(f'/usr/bin/mkfs.btrfs -f {path}'))
|
||||||
if b'UUID' not in o:
|
if b'UUID' not in o:
|
||||||
|
|
@ -211,7 +213,7 @@ class Partition():
|
||||||
# We perform a dummy format on /dev/null with the given filesystem-type
|
# We perform a dummy format on /dev/null with the given filesystem-type
|
||||||
# in order to determain if we support it or not.
|
# in order to determain if we support it or not.
|
||||||
try:
|
try:
|
||||||
self.format(self.filesystem, '/dev/null')
|
self.format(self.filesystem, '/dev/null', log_formating=False)
|
||||||
except SysCallError:
|
except SysCallError:
|
||||||
pass # We supported it, but /dev/null is not formatable as expected so the mkfs call exited with an error code
|
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:
|
except UnknownFilesystemFormat as err:
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,10 @@ archinstall.storage['_guided']['harddrive'] = harddrive
|
||||||
|
|
||||||
if harddrive.has_partitions():
|
if harddrive.has_partitions():
|
||||||
archinstall.log(f" ! {harddrive} contains existing partitions", fg='red')
|
archinstall.log(f" ! {harddrive} contains existing partitions", fg='red')
|
||||||
|
for partition in harddrive:
|
||||||
|
if partition.filesystem_supported():
|
||||||
|
archinstall.log(f" {partition}")
|
||||||
|
|
||||||
if (option := input('Do you wish to keep existing partition setup or format the entire disk? (k/f): ')).lower() in ('k', 'keep'):
|
if (option := input('Do you wish to keep existing partition setup or format the entire disk? (k/f): ')).lower() in ('k', 'keep'):
|
||||||
# If we want to keep the existing partitioning table
|
# If we want to keep the existing partitioning table
|
||||||
# Make sure that it's the selected drive mounted under /mnt
|
# Make sure that it's the selected drive mounted under /mnt
|
||||||
|
|
@ -102,10 +106,7 @@ if harddrive.has_partitions():
|
||||||
if harddrive.has_mount_point(archinstall.storage['MOUNT_POINT']) is False:
|
if harddrive.has_mount_point(archinstall.storage['MOUNT_POINT']) is False:
|
||||||
raise archinstall.DiskError(f"The selected drive {harddrive} is not pre-mounted to {archinstall.storage['MOUNT_POINT']}. This is required when keeping a existing partitioning scheme.")
|
raise archinstall.DiskError(f"The selected drive {harddrive} is not pre-mounted to {archinstall.storage['MOUNT_POINT']}. This is required when keeping a existing partitioning scheme.")
|
||||||
|
|
||||||
archinstall.log('Using existing partition table:')
|
archinstall.log('Using existing partition table reported above.')
|
||||||
for partition in harddrive:
|
|
||||||
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