1- import archinstall , getpass
1+ import archinstall , getpass , time
22
33# Unmount and close previous runs
44archinstall .sys_command (f'umount -R /mnt' , surpress_errors = True )
55archinstall .sys_command (f'cryptsetup close /dev/mapper/luksloop' , surpress_errors = True )
66
7- # Select a harddrive and a disk password
7+ """
8+ First, we'll ask the user for a bunch of user input.
9+ Not until we're satisfied with what we want to install
10+ will we continue with the actual installation steps.
11+ """
812harddrive = archinstall .select_disk (archinstall .all_disks ())
913while (disk_password := getpass .getpass (prompt = 'Enter disk encryption password (leave blank for no encryption): ' )):
1014 disk_password_verification = getpass .getpass (prompt = 'And one more time for verification: ' )
1115 if disk_password != disk_password_verification :
1216 archinstall .log (' * Passwords did not match * ' , bg = 'black' , fg = 'red' )
1317 continue
1418 break
19+ hostname = input ('Desired hostname for the installation: ' )
20+ if len (hostname ) == 0 : hostname = 'ArchInstall'
1521
1622while (root_pw := getpass .getpass (prompt = 'Enter root password (leave blank for no password): ' )):
1723 root_pw_verification = getpass .getpass (prompt = 'And one more time for verification: ' )
3642if len (aur .strip ()):
3743 archinstall .log (' - AUR support provided by yay (https://aur.archlinux.org/packages/yay/)' , bg = 'black' , fg = 'white' )
3844
45+ profile = input ('Any particular profile you want to install: ' )
46+ packages = input ('Additional packages aside from base (space separated): ' ).split (' ' )
47+
48+
49+ """
50+ Issue a final warning before we continue with something un-revertable.
51+ """
52+ print (f' ! Formatting { harddrive } in 5...' )
53+ time .sleep (1 )
54+ print (f' ! Formatting { harddrive } in 4...' )
55+ time .sleep (1 )
56+ print (f' ! Formatting { harddrive } in 3...' )
57+ time .sleep (1 )
58+ print (f' ! Formatting { harddrive } in 2...' )
59+ time .sleep (1 )
60+ print (f' ! Formatting { harddrive } in 1...' )
61+ time .sleep (1 )
62+
3963def perform_installation (device , boot_partition ):
4064 with archinstall .Installer (device , boot_partition = boot_partition , hostname = hostname ) as installation :
4165 if installation .minimal_installation ():
4266 installation .add_bootloader ()
4367
44- packages = input ('Additional packages aside from base (space separated): ' ).split (' ' )
4568 if len (packages ) and packages [0 ] != '' :
4669 installation .add_additional_packages (packages )
4770
48- profile = input ('Any particular profile you want to install: ' )
4971 if len (profile .strip ()):
5072 installation .install_profile (profile )
5173
@@ -69,8 +91,6 @@ def perform_installation(device, boot_partition):
6991 raise OSError ('Trying to encrypt the boot partition for petes sake..' )
7092 harddrive .partition [0 ].format ('fat32' )
7193
72- hostname = input ('Desired hostname for the installation: ' )
73-
7494 if disk_password :
7595 # First encrypt and unlock, then format the desired partition inside the encrypted part.
7696 with archinstall .luks2 (harddrive .partition [1 ], 'luksloop' , disk_password ) as unlocked_device :
0 commit comments