Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ def find_partition(self, path: Path) -> _PartitionInfo | None:
return part
return None

def get_parent_device_path(self, dev_path: Path) -> Path:
lsblk = get_lsblk_info(dev_path)
return Path(f'/dev/{lsblk.pkname}')

def get_uuid_for_path(self, path: Path) -> str | None:
partition = self.find_partition(path)
return partition.partuuid if partition else None
Expand Down
5 changes: 5 additions & 0 deletions archinstall/lib/disk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def disk_layouts() -> str:
return lsblk_output.model_dump_json(indent=4)


def get_parent_device_path(dev_path: Path) -> Path:
lsblk = get_lsblk_info(dev_path)
return Path(f'/dev/{lsblk.pkname}')


def get_unique_path_for_device(dev_path: Path) -> Path | None:
paths = Path('/dev/disk/by-id').glob('*')
linked_targets = {p.resolve(): p for p in paths}
Expand Down
9 changes: 5 additions & 4 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from archinstall.lib.disk.utils import (
get_lsblk_by_mountpoint,
get_lsblk_info,
get_parent_device_path,
get_unique_path_for_device,
mount,
swapon,
Expand Down Expand Up @@ -1381,7 +1382,7 @@ def _add_grub_bootloader(
else:
info(f'GRUB boot partition: {boot_partition.dev_path}')

parent_dev_path = device_handler.get_parent_device_path(boot_partition.safe_dev_path)
parent_dev_path = get_parent_device_path(boot_partition.safe_dev_path)

add_options = [
'--target=i386-pc',
Expand Down Expand Up @@ -1475,7 +1476,7 @@ def _add_limine_bootloader(

info(f'Limine EFI partition: {efi_partition.dev_path}')

parent_dev_path = device_handler.get_parent_device_path(efi_partition.safe_dev_path)
parent_dev_path = get_parent_device_path(efi_partition.safe_dev_path)

try:
efi_dir_path = self.target / efi_partition.mountpoint.relative_to('/') / 'EFI'
Expand Down Expand Up @@ -1538,7 +1539,7 @@ def _add_limine_bootloader(

config_path = boot_limine_path / 'limine.conf'

parent_dev_path = device_handler.get_parent_device_path(boot_partition.safe_dev_path)
parent_dev_path = get_parent_device_path(boot_partition.safe_dev_path)

if unique_path := get_unique_path_for_device(parent_dev_path):
parent_dev_path = unique_path
Expand Down Expand Up @@ -1635,7 +1636,7 @@ def _add_efistub_bootloader(
loader = '/EFI/Linux/arch-{kernel}.efi'
cmdline = []

parent_dev_path = device_handler.get_parent_device_path(boot_partition.safe_dev_path)
parent_dev_path = get_parent_device_path(boot_partition.safe_dev_path)

cmd_template = (
'efibootmgr',
Expand Down