Skip to content

Commit cc7918d

Browse files
authored
Merge branch 'archlinux:master' into master
2 parents cb78e22 + e2e1589 commit cc7918d

File tree

10 files changed

+118
-96
lines changed

10 files changed

+118
-96
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ requirements.txt
3939
/.gitconfig
4040
/actions-runner
4141
/cmd_output.txt
42+
node_modules/
4243
uv.lock

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ repos:
4141
additional_dependencies:
4242
- pydantic
4343
- pytest
44-
- pytest-mock
4544
- cryptography
4645
- textual
4746
- repo: https://github.com/pycqa/pylint

PKGBUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ depends=(
3535
'lvm2'
3636
'f2fs-tools'
3737
'ntfs-3g'
38+
'libfido2'
3839
)
3940
makedepends=(
4041
'python-build'

archinstall/lib/disk/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def _lvm_vol_handle_e2scrub(self, vol_gp: LvmVolumeGroup) -> None:
328328

329329
def _final_warning(self) -> bool:
330330
# Issue a final warning before we continue with something un-revertable.
331-
# We mention the drive one last time, and count from 5 to 0.
331+
# We count down from 5 to 0.
332332
out = tr('Starting device modifications in ')
333333
Tui.print(out, row=0, endl='', clear_screen=True)
334334

archinstall/lib/installer.py

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,7 @@ def _add_grub_bootloader(
13251325
boot_partition: PartitionModification,
13261326
root: PartitionModification | LvmVolume,
13271327
efi_partition: PartitionModification | None,
1328+
uki_enabled: bool = False,
13281329
bootloader_removable: bool = False,
13291330
) -> None:
13301331
debug('Installing grub bootloader')
@@ -1396,6 +1397,37 @@ def _add_grub_bootloader(
13961397
except SysCallError as err:
13971398
raise DiskError(f'Failed to install GRUB boot on {boot_partition.dev_path}: {err}')
13981399

1400+
# Add custom UKI entries if enabled
1401+
if uki_enabled and SysInfo.has_uefi() and efi_partition:
1402+
custom_entries = self.target / 'etc/grub.d/09_custom'
1403+
entries_content = (
1404+
'#!/bin/sh\n'
1405+
'exec tail -n +3 $0\n'
1406+
'# This file provides UKI (Unified Kernel Image) boot entries.\n'
1407+
'# Generated by archinstall. Do not modify the exec tail line above.\n'
1408+
'# Custom entries can be added below.\n\n'
1409+
)
1410+
1411+
uki_entries = []
1412+
for kernel in self.kernels:
1413+
entry = textwrap.dedent(
1414+
f"""
1415+
menuentry "Arch Linux ({kernel}) UKI" {{
1416+
uki /EFI/Linux/arch-{kernel}.efi
1417+
}}
1418+
"""
1419+
)
1420+
uki_entries.append(entry)
1421+
1422+
entries_content += '\n'.join(uki_entries)
1423+
custom_entries.write_text(entries_content)
1424+
custom_entries.chmod(0o755)
1425+
1426+
# Disable 10_linux to prevent broken entries on kernel updates
1427+
linux_script = self.target / 'etc/grub.d/10_linux'
1428+
if linux_script.exists():
1429+
linux_script.chmod(0o644)
1430+
13991431
try:
14001432
self.arch_chroot(
14011433
f'grub-mkconfig -o {boot_dir}/grub/grub.cfg',
@@ -1669,29 +1701,28 @@ def _add_refind_bootloader(
16691701
kernel_params = ' '.join(self._get_kernel_params(root))
16701702

16711703
for kernel in self.kernels:
1672-
for variant in ('', '-fallback'):
1673-
if uki_enabled:
1674-
entry = f'"Arch Linux ({kernel}{variant}) UKI" "{kernel_params}"'
1675-
else:
1676-
if boot_on_root:
1677-
# Kernels are in /boot subdirectory of root filesystem
1678-
if hasattr(root, 'btrfs_subvols') and root.btrfs_subvols:
1679-
# Root is btrfs with subvolume, find the root subvolume
1680-
root_subvol = next((sv for sv in root.btrfs_subvols if sv.is_root()), None)
1681-
if root_subvol:
1682-
subvol_name = root_subvol.name
1683-
initrd_path = f'initrd={subvol_name}\\boot\\initramfs-{kernel}{variant}.img'
1684-
else:
1685-
initrd_path = f'initrd=\\boot\\initramfs-{kernel}{variant}.img'
1704+
if uki_enabled:
1705+
entry = f'"Arch Linux ({kernel}) UKI" "{kernel_params}"'
1706+
else:
1707+
if boot_on_root:
1708+
# Kernels are in /boot subdirectory of root filesystem
1709+
if hasattr(root, 'btrfs_subvols') and root.btrfs_subvols:
1710+
# Root is btrfs with subvolume, find the root subvolume
1711+
root_subvol = next((sv for sv in root.btrfs_subvols if sv.is_root()), None)
1712+
if root_subvol:
1713+
subvol_name = root_subvol.name
1714+
initrd_path = f'initrd={subvol_name}\\boot\\initramfs-{kernel}.img'
16861715
else:
1687-
# Root without btrfs subvolume
1688-
initrd_path = f'initrd=\\boot\\initramfs-{kernel}{variant}.img'
1716+
initrd_path = f'initrd=\\boot\\initramfs-{kernel}.img'
16891717
else:
1690-
# Kernels are at root of their partition (ESP or separate boot partition)
1691-
initrd_path = f'initrd=\\initramfs-{kernel}{variant}.img'
1692-
entry = f'"Arch Linux ({kernel}{variant})" "{kernel_params} {initrd_path}"'
1718+
# Root without btrfs subvolume
1719+
initrd_path = f'initrd=\\boot\\initramfs-{kernel}.img'
1720+
else:
1721+
# Kernels are at root of their partition (ESP or separate boot partition)
1722+
initrd_path = f'initrd=\\initramfs-{kernel}.img'
1723+
entry = f'"Arch Linux ({kernel})" "{kernel_params} {initrd_path}"'
16931724

1694-
config_contents.append(entry)
1725+
config_contents.append(entry)
16951726

16961727
config_path.write_text('\n'.join(config_contents) + '\n')
16971728

@@ -1823,7 +1854,7 @@ def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False, boot
18231854
case Bootloader.Systemd:
18241855
self._add_systemd_bootloader(boot_partition, root, efi_partition, uki_enabled)
18251856
case Bootloader.Grub:
1826-
self._add_grub_bootloader(boot_partition, root, efi_partition, bootloader_removable)
1857+
self._add_grub_bootloader(boot_partition, root, efi_partition, uki_enabled, bootloader_removable)
18271858
case Bootloader.Efistub:
18281859
self._add_efistub_bootloader(boot_partition, root, uki_enabled)
18291860
case Bootloader.Limine:

archinstall/lib/models/application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def json(self) -> BluetoothConfigSerialization:
7878
return {'enabled': self.enabled}
7979

8080
@staticmethod
81-
def parse_arg(arg: dict[str, Any]) -> 'BluetoothConfiguration':
81+
def parse_arg(arg: BluetoothConfigSerialization) -> 'BluetoothConfiguration':
8282
return BluetoothConfiguration(arg['enabled'])
8383

8484

@@ -92,7 +92,7 @@ def json(self) -> PowerManagementConfigSerialization:
9292
}
9393

9494
@staticmethod
95-
def parse_arg(arg: dict[str, Any]) -> 'PowerManagementConfiguration':
95+
def parse_arg(arg: PowerManagementConfigSerialization) -> 'PowerManagementConfiguration':
9696
return PowerManagementConfiguration(
9797
PowerManagement(arg['power_management']),
9898
)
@@ -106,7 +106,7 @@ def json(self) -> PrintServiceConfigSerialization:
106106
return {'enabled': self.enabled}
107107

108108
@staticmethod
109-
def parse_arg(arg: dict[str, Any]) -> 'PrintServiceConfiguration':
109+
def parse_arg(arg: PrintServiceConfigSerialization) -> 'PrintServiceConfiguration':
110110
return PrintServiceConfiguration(arg['enabled'])
111111

112112

archinstall/lib/models/bootloader.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ class Bootloader(Enum):
2020
Refind = 'Refind'
2121

2222
def has_uki_support(self) -> bool:
23-
match self:
24-
case Bootloader.Efistub | Bootloader.Limine | Bootloader.Systemd | Bootloader.Refind:
25-
return True
26-
case _:
27-
return False
23+
return self != Bootloader.NO_BOOTLOADER
2824

2925
def has_removable_support(self) -> bool:
3026
match self:
@@ -82,7 +78,8 @@ def parse_arg(cls, config: dict[str, Any], skip_boot: bool) -> BootloaderConfigu
8278
def get_default(cls) -> BootloaderConfiguration:
8379
bootloader = Bootloader.get_default()
8480
removable = SysInfo.has_uefi() and bootloader.has_removable_support()
85-
return cls(bootloader=bootloader, uki=False, removable=removable)
81+
uki = SysInfo.has_uefi() and bootloader.has_uki_support()
82+
return cls(bootloader=bootloader, uki=uki, removable=removable)
8683

8784
def preview(self) -> str:
8885
text = f'{tr("Bootloader")}: {self.bootloader.value}'

archinstall/lib/models/device.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import builtins
34
import math
45
import uuid
56
from dataclasses import dataclass, field
@@ -772,7 +773,7 @@ class PartitionGUID(Enum):
772773
LINUX_ROOT_X86_64 = '4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709'
773774

774775
@property
775-
def bytes(self) -> bytes:
776+
def bytes(self) -> builtins.bytes:
776777
return uuid.UUID(self.value).bytes
777778

778779

0 commit comments

Comments
 (0)