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 12:34:39 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-07 12:34:39 +0100
commita618ebd6111de0cab9c0f04449cf1a8483156615 (patch)
tree9a53474639015a379a130df8a4d64d6ba9626241 /examples
parent3e261c4033704a8e95f293ada18043f86ea228a1 (diff)
Adding a check to see if the disk contains a parition table already. has_partitions() TBI
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/guided.py b/examples/guided.py
index f0620b05..f55047d9 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -104,6 +104,15 @@ while (disk_password := getpass.getpass(prompt='Enter disk encryption password (
archinstall.storage['_guided']['disk_encryption'] = True
break
archinstall.storage['_guided']['harddrive'] = harddrive
+print(harddrive)
+if archinstall.has_partitions(harddrive):
+ 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!")
+ else:
+ print('Formatting woop woop!')
+exit(1)
+
# Ask for a hostname
hostname = input('Desired hostname for the installation: ')