Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-07-08 17:45:25 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-07-08 17:45:25 +0000
commit5ab238569ddfea342cc6e3b5650c52679a9a7f9a (patch)
tree4fe61af639246442af912dd1d0962f114f14745f
parentbc8f6ce4486fe79ffbb838ebeddbb40d72947bd2 (diff)
mixed up the mount of /boot, now correctly mounts /boot before running pacstrap
-rw-r--r--archinstall/lib/installer.py20
-rw-r--r--examples/guided.py4
2 files changed, 13 insertions, 11 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 00e0aed9..ffb0567e 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -7,15 +7,18 @@ from .user_interaction import *
from .profiles import Profile
class Installer():
- def __init__(self, partition, *, profile=None, mountpoint='/mnt', hostname='ArchInstalled'):
+ def __init__(self, partition, boot_partition, *, profile=None, mountpoint='/mnt', hostname='ArchInstalled'):
self.profile = profile
self.hostname = hostname
self.mountpoint = mountpoint
self.partition = partition
+ self.boot_partition = boot_partition
def __enter__(self, *args, **kwargs):
self.partition.mount(self.mountpoint)
+ os.makedirs(f'{self.mountpoint}/boot', exist_ok=True)
+ self.boot_partition.mount(f'{self.mountpoint}/boot')
return self
def __exit__(self, *args, **kwargs):
@@ -39,16 +42,13 @@ class Installer():
log(f'Could not sync mirrors: {sync_mirrors.exit_code}')
def minimal_installation(self):
- self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano wpa_supplicant dialog'.split(' '), debug=True)
+ if (x := self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano wpa_supplicant dialog'.split(' '))):
+ print(list(os.walk(f'{self.mountpoint}/boot')))
+ return x
- def add_bootloader(self, boot_partition):
- log(f'Adding bootloader to {boot_partition}')
- import time
- time.sleep(10000)
- os.makedirs(f'{self.mountpoint}/boot', exist_ok=True)
- boot_partition.mount(f'{self.mountpoint}/boot')
+ 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'))
-
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
loader.write('default arch\n')
loader.write('timeout 5\n')
@@ -72,6 +72,7 @@ class Installer():
if not os.path.basename(real_path) == os.path.basename(self.partition.real_device): continue
entry.write(f'options cryptdevice=PARTUUID={uid}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n')
+ print(list(os.walk(f'{self.mountpoint}/boot')))
return True
break
else:
@@ -82,6 +83,7 @@ class Installer():
if not os.path.basename(real_path) == os.path.basename(self.partition.path): continue
entry.write(f'options root=PARTUUID={uid} rw intel_pstate=no_hwp\n')
+ print(list(os.walk(f'{self.mountpoint}/boot')))
return True
break
raise RequirementError(f'Could not identify the UUID of {self.partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.')
diff --git a/examples/guided.py b/examples/guided.py
index c84b5e56..e2e45539 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -15,9 +15,9 @@ while (disk_password := getpass.getpass(prompt='Enter disk encryption password (
def perform_installation(device, boot_partition):
hostname = input('Desired hostname for the installation: ')
- with archinstall.Installer(device, hostname=hostname) as installation:
+ with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation:
if installation.minimal_installation():
- installation.add_bootloader(boot_partition)
+ installation.add_bootloader()
packages = input('Additional packages aside from base (space separated): ').split(' ')
if len(packages) and packages[0] != '':