Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-02-07 13:36:30 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-07 13:36:30 +0100
commit53cdb607bc9204b69d3f1aac42baea5ddcb94c12 (patch)
treec9a281aaaccd785eb0fb0197edea2f77a0a25fd6 /examples
parent9c7f689dd620739062b8248bc9798a522fc4c7e2 (diff)
Added the ability to check if a harddrive has any mountpoint related to a given parameter.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py6
1 files changed, 5 insertions, 1 deletions
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)