Skip to content

Commit

Permalink
Fix broken path
Browse files Browse the repository at this point in the history
  • Loading branch information
svartkanin committed Sep 4, 2023
1 parent 81ef09c commit 2c4149e
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,18 +887,13 @@ def _add_grub_bootloader(
except SysCallError as err:
raise DiskError(f"Could not install GRUB to {self.target}{boot_partition.mountpoint}: {err}")
else:
device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)

if not device:
raise ValueError(f'Can not find block device: {boot_partition.safe_dev_path}')

try:
cmd = f'/usr/bin/arch-chroot' \
f' {self.target}' \
f' grub-install' \
f' --debug' \
f' --target=i386-pc' \
f' --recheck {device.device_info.path}'
f' --recheck {boot_partition.dev_path}'

SysCommand(cmd, peek_output=True)
except SysCallError as err:
Expand All @@ -923,10 +918,6 @@ def _add_limine_bootloader(
# partition before the format.
root_uuid = get_lsblk_info(root_partition.safe_dev_path).uuid

device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
if not device:
raise ValueError(f'Can not find block device: {boot_partition.safe_dev_path}')

def create_pacman_hook(contents: str):
HOOK_DIR = "/etc/pacman.d/hooks"
SysCommand(f"/usr/bin/arch-chroot {self.target} mkdir -p {HOOK_DIR}")
Expand All @@ -940,6 +931,8 @@ def create_pacman_hook(contents: str):
f' cp' \
f' /usr/share/limine/BOOTX64.EFI' \
f' /boot/EFI/BOOT/'

SysCommand(cmd, peek_output=True)
except SysCallError as err:
raise DiskError(f"Failed to install Limine BOOTX64.EFI on {boot_partition.dev_path}: {err}")

Expand Down Expand Up @@ -972,7 +965,7 @@ def create_pacman_hook(contents: str):
f' {self.target}' \
f' limine' \
f' bios-install' \
f' {device.device_info.path}'
f' {boot_partition.dev_path}'

SysCommand(cmd, peek_output=True)
except SysCallError as err:
Expand Down Expand Up @@ -1062,13 +1055,8 @@ def _add_efistub_bootloader(
debug(f'Root partition is an encrypted device identifying by PARTUUID: {root_partition.partuuid}')
kernel_parameters.append(f'root=PARTUUID={root_partition.partuuid} rw rootfstype={root_partition.safe_fs_type.value} {" ".join(self._kernel_params)}')

device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)

if not device:
raise ValueError(f'Unable to find block device: {boot_partition.safe_dev_path}')

cmd = f'efibootmgr ' \
f'--disk {device.device_info.path} ' \
f'--disk {boot_partition.dev_path} ' \
f'--part {boot_partition.safe_dev_path} ' \
f'--create ' \
f'--label "{label}" ' \
Expand Down

0 comments on commit 2c4149e

Please sign in to comment.