Skip to content

Commit ebcb5ae

Browse files
committed
Fixed a bug where minimal_installation() didn't return anything.
1 parent ef7ebfc commit ebcb5ae

3 files changed

Lines changed: 32 additions & 21 deletions

File tree

archinstall/lib/installer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def minimal_installation(self):
8585
mkinit.write('HOOKS=(base udev autodetect modconf block encrypt filesystems keyboard fsck)\n')
8686
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} mkinitcpio -p linux')
8787

88+
return True
89+
8890
def add_bootloader(self):
8991
log(f'Adding bootloader to {self.boot_partition}')
9092
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))

examples/guided.py

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,30 @@
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+
1639
def 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

5461
with 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:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="archinstall",
8-
version="2.0.3rc21",
8+
version="2.0.3rc20",
99
author="Anton Hvornum",
1010
author_email="anton@hvornum.se",
1111
description="Arch Linux installer - guided, templates etc.",

0 commit comments

Comments
 (0)