Skip to content

Commit 13e9953

Browse files
committed
removed some non-essnetial packages. re-structured the guided installer to ask for stuff first, then fire away. Tested encrypted/non-encrypted and both works.
1 parent b0ca5c9 commit 13e9953

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

archinstall/lib/installer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def set_locale(self, locale, encoding='UTF-8'):
6060
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen')
6161

6262
def minimal_installation(self):
63-
self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano wpa_supplicant dialog'.split(' '))
63+
self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano'.split(' '))
6464
self.genfstab()
6565

6666
with open(f'{self.mountpoint}/etc/fstab', 'a') as fstab:
@@ -90,7 +90,6 @@ def minimal_installation(self):
9090
def add_bootloader(self):
9191
log(f'Adding bootloader to {self.boot_partition}')
9292
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))
93-
print('BOOT:', o)
9493
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
9594
loader.write('default arch\n')
9695
loader.write('timeout 5\n')

examples/guided.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
import archinstall, getpass
1+
import archinstall, getpass, time
22

33
# Unmount and close previous runs
44
archinstall.sys_command(f'umount -R /mnt', surpress_errors=True)
55
archinstall.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+
"""
812
harddrive = archinstall.select_disk(archinstall.all_disks())
913
while (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

1622
while (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: ')
@@ -36,16 +42,32 @@
3642
if 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+
3963
def 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

Comments
 (0)