Fixed a bug where minimal_installation() didn't return anything.
This commit is contained in:
parent
ef7ebfc394
commit
ebcb5ae795
|
|
@ -85,6 +85,8 @@ class Installer():
|
||||||
mkinit.write('HOOKS=(base udev autodetect modconf block encrypt filesystems keyboard fsck)\n')
|
mkinit.write('HOOKS=(base udev autodetect modconf block encrypt filesystems keyboard fsck)\n')
|
||||||
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} mkinitcpio -p linux')
|
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} mkinitcpio -p linux')
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def add_bootloader(self):
|
def add_bootloader(self):
|
||||||
log(f'Adding bootloader to {self.boot_partition}')
|
log(f'Adding bootloader to {self.boot_partition}')
|
||||||
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))
|
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,30 @@ while (disk_password := getpass.getpass(prompt='Enter disk encryption password (
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
|
|
||||||
|
while (root_pw := getpass.getpass(prompt='Enter root password (leave blank for no password): ')):
|
||||||
|
root_pw_verification = getpass.getpass(prompt='And one more time for verification: ')
|
||||||
|
if root_pw != root_pw_verification:
|
||||||
|
archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
|
||||||
|
users = {}
|
||||||
|
while 1:
|
||||||
|
new_user = input('Any additional users to install (leave blank for no users): ')
|
||||||
|
if not len(new_user.strip()): break
|
||||||
|
new_user_passwd = getpass.getpass(prompt=f'Password for user {new_user}: ')
|
||||||
|
new_user_passwd_verify = getpass.getpass(prompt=f'Enter password again for verification: ')
|
||||||
|
if new_user_passwd != new_user_passwd_verify:
|
||||||
|
archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
|
||||||
|
continue
|
||||||
|
|
||||||
|
users[new_user] = new_user_passwd
|
||||||
|
|
||||||
|
aur = input('Would you like AUR support? (leave blank for no): ')
|
||||||
|
if len(aur.strip()):
|
||||||
|
archinstall.log(' - AUR support provided by yay (https://aur.archlinux.org/packages/yay/)', bg='black', fg='white')
|
||||||
|
|
||||||
def perform_installation(device, boot_partition):
|
def perform_installation(device, boot_partition):
|
||||||
hostname = input('Desired hostname for the installation: ')
|
|
||||||
with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation:
|
with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation:
|
||||||
if installation.minimal_installation():
|
if installation.minimal_installation():
|
||||||
installation.add_bootloader()
|
installation.add_bootloader()
|
||||||
|
|
@ -27,28 +49,13 @@ def perform_installation(device, boot_partition):
|
||||||
if len(profile.strip()):
|
if len(profile.strip()):
|
||||||
installation.install_profile(profile)
|
installation.install_profile(profile)
|
||||||
|
|
||||||
while 1:
|
for user, password in users.items():
|
||||||
new_user = input('Any additional users to install (leave blank for no users): ')
|
installation.user_create(user, password)
|
||||||
if not len(new_user.strip()): break
|
|
||||||
new_user_passwd = getpass.getpass(prompt=f'Password for user {new_user}: ')
|
|
||||||
new_user_passwd_verify = getpass.getpass(prompt=f'Enter password again for verification: ')
|
|
||||||
if new_user_passwd != new_user_passwd_verify:
|
|
||||||
archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
|
|
||||||
continue
|
|
||||||
|
|
||||||
installation.user_create(new_user, new_user_passwd)
|
if root_pw:
|
||||||
|
|
||||||
while (root_pw := getpass.getpass(prompt='Enter root password (leave blank for no password): ')):
|
|
||||||
root_pw_verification = getpass.getpass(prompt='And one more time for verification: ')
|
|
||||||
if root_pw != root_pw_verification:
|
|
||||||
archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
|
|
||||||
continue
|
|
||||||
installation.user_set_pw('root', root_pw)
|
installation.user_set_pw('root', root_pw)
|
||||||
break
|
|
||||||
|
|
||||||
aur = input('Would you like AUR support? (leave blank for no): ')
|
|
||||||
if len(aur.strip()):
|
if len(aur.strip()):
|
||||||
archinstall.log(' - AUR support provided by yay (https://aur.archlinux.org/packages/yay/)', bg='black', fg='white')
|
|
||||||
installation.add_AUR_support()
|
installation.add_AUR_support()
|
||||||
|
|
||||||
with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
|
with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
|
||||||
|
|
@ -62,6 +69,8 @@ with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
|
||||||
raise OSError('Trying to encrypt the boot partition for petes sake..')
|
raise OSError('Trying to encrypt the boot partition for petes sake..')
|
||||||
harddrive.partition[0].format('fat32')
|
harddrive.partition[0].format('fat32')
|
||||||
|
|
||||||
|
hostname = input('Desired hostname for the installation: ')
|
||||||
|
|
||||||
if disk_password:
|
if disk_password:
|
||||||
# First encrypt and unlock, then format the desired partition inside the encrypted part.
|
# First encrypt and unlock, then format the desired partition inside the encrypted part.
|
||||||
with archinstall.luks2(harddrive.partition[1], 'luksloop', disk_password) as unlocked_device:
|
with archinstall.luks2(harddrive.partition[1], 'luksloop', disk_password) as unlocked_device:
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="archinstall",
|
name="archinstall",
|
||||||
version="2.0.3rc21",
|
version="2.0.3rc20",
|
||||||
author="Anton Hvornum",
|
author="Anton Hvornum",
|
||||||
author_email="anton@hvornum.se",
|
author_email="anton@hvornum.se",
|
||||||
description="Arch Linux installer - guided, templates etc.",
|
description="Arch Linux installer - guided, templates etc.",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue