Skip to content

Commit

Permalink
Create /etc/vconsole.conf before mkinitcpio
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Jan 18, 2024
1 parent f107104 commit 933ab05
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
14 changes: 7 additions & 7 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,10 @@ def mkinitcpio(self, flags: List[str]) -> bool:
try:
SysCommand(f'/usr/bin/arch-chroot {self.target} mkinitcpio {" ".join(flags)}', peek_output=True)
return True
except SysCallError as error:
if error.worker:
log(error.worker._trace_log.decode())
except SysCallError as err:
error('Error generating initramfs')
if err.worker:
log(err.worker._trace_log.decode())
return False

def _get_microcode(self) -> Optional[Path]:
Expand Down Expand Up @@ -693,8 +694,8 @@ def minimal_installation(
# TODO: Use python functions for this
SysCommand(f'/usr/bin/arch-chroot {self.target} chmod 700 /root')

if mkinitcpio and not self.mkinitcpio(['-P']):
error('Error generating initramfs (continuing anyway)')
if mkinitcpio:
self.mkinitcpio(['-P'])

self.helper_flags['base'] = True

Expand Down Expand Up @@ -1191,8 +1192,7 @@ def _config_uki(
uki_dir.mkdir(parents=True, exist_ok=True)

# Build the UKIs
if not self.mkinitcpio(['-P']):
error('Error generating initramfs (continuing anyway)')
self.mkinitcpio(['-P'])

def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False):
"""
Expand Down
22 changes: 12 additions & 10 deletions archinstall/scripts/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def perform_installation(mountpoint: Path):
# Retrieve list of additional repositories and set boolean values appropriately
enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', [])
enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', [])
run_mkinitcpio = not archinstall.arguments.get('uki')
locale_config: locale.LocaleConfiguration = archinstall.arguments['locale_config']
disk_encryption: disk.DiskEncryption = archinstall.arguments.get('disk_encryption', None)

Expand Down Expand Up @@ -142,7 +141,7 @@ def perform_installation(mountpoint: Path):
installation.minimal_installation(
testing=enable_testing,
multilib=enable_multilib,
mkinitcpio=run_mkinitcpio,
mkinitcpio=False,
hostname=archinstall.arguments.get('hostname', 'archlinux'),
locale_config=locale_config
)
Expand All @@ -153,14 +152,6 @@ def perform_installation(mountpoint: Path):
if archinstall.arguments.get('swap'):
installation.setup_swap('zram')

if archinstall.arguments.get("bootloader") == Bootloader.Grub and SysInfo.has_uefi():
installation.add_additional_packages("grub")

installation.add_bootloader(
archinstall.arguments["bootloader"],
archinstall.arguments.get('uki', False)
)

# If user selected to copy the current ISO network configuration
# Perform a copy of the config
network_config: Optional[NetworkConfiguration] = archinstall.arguments.get('network_config', None)
Expand Down Expand Up @@ -202,6 +193,17 @@ def perform_installation(mountpoint: Path):
# After which, this step will set the language both for console and x11 if x11 was installed for instance.
installation.set_keyboard_language(locale_config.kb_layout)

if archinstall.arguments.get("bootloader") == Bootloader.Grub and SysInfo.has_uefi():
installation.add_additional_packages("grub")

installation.add_bootloader(
archinstall.arguments["bootloader"],
archinstall.arguments.get('uki', False)
)

if not archinstall.arguments.get('uki'):
installation.mkinitcpio(['-P'])

if profile_config := archinstall.arguments.get('profile_config', None):
profile_config.profile.post_install(installation)

Expand Down

0 comments on commit 933ab05

Please sign in to comment.