1313 continue
1414 break
1515
16+ while (root_pw := getpass .getpass (prompt = 'Enter root password (leave blank for no password): ' )):
17+ root_pw_verification = getpass .getpass (prompt = 'And one more time for verification: ' )
18+ if root_pw != root_pw_verification :
19+ archinstall .log (' * Passwords did not match * ' , bg = 'black' , fg = 'red' )
20+ continue
21+ break
22+
23+ users = {}
24+ while 1 :
25+ new_user = input ('Any additional users to install (leave blank for no users): ' )
26+ if not len (new_user .strip ()): break
27+ new_user_passwd = getpass .getpass (prompt = f'Password for user { new_user } : ' )
28+ new_user_passwd_verify = getpass .getpass (prompt = f'Enter password again for verification: ' )
29+ if new_user_passwd != new_user_passwd_verify :
30+ archinstall .log (' * Passwords did not match * ' , bg = 'black' , fg = 'red' )
31+ continue
32+
33+ users [new_user ] = new_user_passwd
34+
35+ aur = input ('Would you like AUR support? (leave blank for no): ' )
36+ if len (aur .strip ()):
37+ archinstall .log (' - AUR support provided by yay (https://aur.archlinux.org/packages/yay/)' , bg = 'black' , fg = 'white' )
38+
1639def perform_installation (device , boot_partition ):
17- hostname = input ('Desired hostname for the installation: ' )
1840 with archinstall .Installer (device , boot_partition = boot_partition , hostname = hostname ) as installation :
1941 if installation .minimal_installation ():
2042 installation .add_bootloader ()
@@ -27,28 +49,13 @@ def perform_installation(device, boot_partition):
2749 if len (profile .strip ()):
2850 installation .install_profile (profile )
2951
30- while 1 :
31- new_user = input ('Any additional users to install (leave blank for no users): ' )
32- if not len (new_user .strip ()): break
33- new_user_passwd = getpass .getpass (prompt = f'Password for user { new_user } : ' )
34- new_user_passwd_verify = getpass .getpass (prompt = f'Enter password again for verification: ' )
35- if new_user_passwd != new_user_passwd_verify :
36- archinstall .log (' * Passwords did not match * ' , bg = 'black' , fg = 'red' )
37- continue
38-
39- installation .user_create (new_user , new_user_passwd )
40-
41- while (root_pw := getpass .getpass (prompt = 'Enter root password (leave blank for no password): ' )):
42- root_pw_verification = getpass .getpass (prompt = 'And one more time for verification: ' )
43- if root_pw != root_pw_verification :
44- archinstall .log (' * Passwords did not match * ' , bg = 'black' , fg = 'red' )
45- continue
52+ for user , password in users .items ():
53+ installation .user_create (user , password )
54+
55+ if root_pw :
4656 installation .user_set_pw ('root' , root_pw )
47- break
4857
49- aur = input ('Would you like AUR support? (leave blank for no): ' )
5058 if len (aur .strip ()):
51- archinstall .log (' - AUR support provided by yay (https://aur.archlinux.org/packages/yay/)' , bg = 'black' , fg = 'white' )
5259 installation .add_AUR_support ()
5360
5461with archinstall .Filesystem (harddrive , archinstall .GPT ) as fs :
@@ -62,6 +69,8 @@ def perform_installation(device, boot_partition):
6269 raise OSError ('Trying to encrypt the boot partition for petes sake..' )
6370 harddrive .partition [0 ].format ('fat32' )
6471
72+ hostname = input ('Desired hostname for the installation: ' )
73+
6574 if disk_password :
6675 # First encrypt and unlock, then format the desired partition inside the encrypted part.
6776 with archinstall .luks2 (harddrive .partition [1 ], 'luksloop' , disk_password ) as unlocked_device :
0 commit comments