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:
parent
b0ca5c9107
commit
13e9953630
|
|
@ -60,7 +60,7 @@ class Installer():
|
||||||
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen')
|
sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen')
|
||||||
|
|
||||||
def minimal_installation(self):
|
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()
|
self.genfstab()
|
||||||
|
|
||||||
with open(f'{self.mountpoint}/etc/fstab', 'a') as fstab:
|
with open(f'{self.mountpoint}/etc/fstab', 'a') as fstab:
|
||||||
|
|
@ -90,7 +90,6 @@ class Installer():
|
||||||
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'))
|
||||||
print('BOOT:', o)
|
|
||||||
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
|
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
|
||||||
loader.write('default arch\n')
|
loader.write('default arch\n')
|
||||||
loader.write('timeout 5\n')
|
loader.write('timeout 5\n')
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
import archinstall, getpass
|
import archinstall, getpass, time
|
||||||
|
|
||||||
# Unmount and close previous runs
|
# Unmount and close previous runs
|
||||||
archinstall.sys_command(f'umount -R /mnt', surpress_errors=True)
|
archinstall.sys_command(f'umount -R /mnt', surpress_errors=True)
|
||||||
archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop', 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())
|
harddrive = archinstall.select_disk(archinstall.all_disks())
|
||||||
while (disk_password := getpass.getpass(prompt='Enter disk encryption password (leave blank for no encryption): ')):
|
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: ')
|
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')
|
archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
|
||||||
continue
|
continue
|
||||||
break
|
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): ')):
|
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: ')
|
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()):
|
if len(aur.strip()):
|
||||||
archinstall.log(' - AUR support provided by yay (https://aur.archlinux.org/packages/yay/)', bg='black', fg='white')
|
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):
|
def perform_installation(device, boot_partition):
|
||||||
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()
|
||||||
|
|
||||||
packages = input('Additional packages aside from base (space separated): ').split(' ')
|
|
||||||
if len(packages) and packages[0] != '':
|
if len(packages) and packages[0] != '':
|
||||||
installation.add_additional_packages(packages)
|
installation.add_additional_packages(packages)
|
||||||
|
|
||||||
profile = input('Any particular profile you want to install: ')
|
|
||||||
if len(profile.strip()):
|
if len(profile.strip()):
|
||||||
installation.install_profile(profile)
|
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..')
|
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:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue