From 53cdb607bc9204b69d3f1aac42baea5ddcb94c12 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 7 Feb 2021 13:36:30 +0100 Subject: Added the ability to check if a harddrive has any mountpoint related to a given parameter. --- examples/guided.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index a5298328..b6c6dd45 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -96,7 +96,11 @@ archinstall.storage['_guided']['harddrive'] = harddrive if harddrive.has_partitions(): archinstall.log(f" ! {harddrive} contains existing partitions", fg='red') if (option := input('Do you wish to keep existing partition setup or format the entire disk? (k/f): ')).lower() in ('k', 'keep'): - print("We're keeping it!") + # If we want to keep the existing partitioning table + # Make sure that it's the selected drive mounted under /mnt + # That way, we can rely on genfstab and some manual post-installation steps. + if harddrive.has_mount_point(archinstall.storage['MOUNT_POINT']) is False: + raise archinstall.DiskException(f"The selected drive {harddrive} is not pre-mounted to {archinstall.storage['MOUNT_POINT']}. This is required when keeping a existing partitioning scheme.") else: print('Formatting woop woop!') exit(1) -- cgit v1.2.3-54-g00ecf