Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-02-07 12:52:12 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-07 12:52:12 +0100
commitfa2270a11b833928186727812a3a3f82d18ef5ce (patch)
treeb393e6ef8c46827b2591c1d7e9c9875d75bc41ce /examples/guided.py
parenta618ebd6111de0cab9c0f04449cf1a8483156615 (diff)
Created has_partitions() on BlockDevice's
Diffstat (limited to 'examples/guided.py')
-rw-r--r--examples/guided.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/examples/guided.py b/examples/guided.py
index f55047d9..1e879316 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -96,16 +96,9 @@ archinstall.storage['_guided']['mirrors'] = mirror_regions
# Ask which harddrive/block-device we will install to
harddrive = archinstall.select_disk(archinstall.all_disks())
-while (disk_password := getpass.getpass(prompt='Enter disk encryption password (leave blank for no encryption): ')):
- disk_password_verification = getpass.getpass(prompt='And one more time for verification: ')
- if disk_password != disk_password_verification:
- archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
- continue
- archinstall.storage['_guided']['disk_encryption'] = True
- break
archinstall.storage['_guided']['harddrive'] = harddrive
-print(harddrive)
-if archinstall.has_partitions(harddrive):
+
+if harddrive.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!")
@@ -113,6 +106,14 @@ if archinstall.has_partitions(harddrive):
print('Formatting woop woop!')
exit(1)
+while (disk_password := getpass.getpass(prompt='Enter disk encryption password (leave blank for no encryption): ')):
+ disk_password_verification = getpass.getpass(prompt='And one more time for verification: ')
+ if disk_password != disk_password_verification:
+ archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
+ continue
+ archinstall.storage['_guided']['disk_encryption'] = True
+ break
+
# Ask for a hostname
hostname = input('Desired hostname for the installation: ')