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.

This commit is contained in:
Anton Hvornum 2020-07-08 22:51:21 +00:00
parent b0ca5c9107
commit 13e9953630
2 changed files with 27 additions and 8 deletions

View File

@ -60,7 +60,7 @@ class Installer():
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen')
def minimal_installation(self):
self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano wpa_supplicant dialog'.split(' '))
self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano'.split(' '))
self.genfstab()
with open(f'{self.mountpoint}/etc/fstab', 'a') as fstab:
@ -90,7 +90,6 @@ class Installer():
def add_bootloader(self):
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'))
print('BOOT:', o)
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
loader.write('default arch\n')
loader.write('timeout 5\n')

View File

@ -1,10 +1,14 @@
import archinstall, getpass
import archinstall, getpass, time
# Unmount and close previous runs
archinstall.sys_command(f'umount -R /mnt', surpress_errors=True)
archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop', surpress_errors=True)
# Select a harddrive and a disk password
"""
First, we'll ask the user for a bunch of user input.
Not until we're satisfied with what we want to install
will we continue with the actual installation steps.
"""
harddrive = archinstall.select_disk(archinstall.all_disks())
while (disk_password := getpass.getpass(prompt='Enter disk encryption password (leave blank for no encryption): ')):
disk_password_verification = getpass.getpass(prompt='And one more time for verification: ')
@ -12,6 +16,8 @@ while (disk_password := getpass.getpass(prompt='Enter disk encryption password (
archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
continue
break
hostname = input('Desired hostname for the installation: ')
if len(hostname) == 0: hostname = 'ArchInstall'
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: ')
@ -36,16 +42,32 @@ 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')
profile = input('Any particular profile you want to install: ')
packages = input('Additional packages aside from base (space separated): ').split(' ')
"""
Issue a final warning before we continue with something un-revertable.
"""
print(f' ! Formatting {harddrive} in 5...')
time.sleep(1)
print(f' ! Formatting {harddrive} in 4...')
time.sleep(1)
print(f' ! Formatting {harddrive} in 3...')
time.sleep(1)
print(f' ! Formatting {harddrive} in 2...')
time.sleep(1)
print(f' ! Formatting {harddrive} in 1...')
time.sleep(1)
def perform_installation(device, boot_partition):
with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation:
if installation.minimal_installation():
installation.add_bootloader()
packages = input('Additional packages aside from base (space separated): ').split(' ')
if len(packages) and packages[0] != '':
installation.add_additional_packages(packages)
profile = input('Any particular profile you want to install: ')
if len(profile.strip()):
installation.install_profile(profile)
@ -69,8 +91,6 @@ with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
raise OSError('Trying to encrypt the boot partition for petes sake..')
harddrive.partition[0].format('fat32')
hostname = input('Desired hostname for the installation: ')
if disk_password:
# 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: