Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GRUB boot directory #2130

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,13 @@ def _add_grub_bootloader(

info(f"GRUB boot partition: {boot_partition.dev_path}")

if boot_partition == root_partition and root_partition.mountpoint:
boot_dir = root_partition.mountpoint / 'boot'
elif boot_partition.mountpoint:
boot_dir = boot_partition.mountpoint
else:
raise ValueError('Could not detect boot directory')

command = [
'/usr/bin/arch-chroot',
str(self.target),
Expand All @@ -904,7 +911,7 @@ def _add_grub_bootloader(
add_options = [
'--target=x86_64-efi',
f'--efi-directory={efi_partition.mountpoint}',
f'--boot-directory={boot_partition.mountpoint if boot_partition else "/boot"}',
f'--boot-directory={boot_dir}',
'--bootloader-id=GRUB',
'--removable'
]
Expand Down Expand Up @@ -937,7 +944,7 @@ def _add_grub_bootloader(
try:
SysCommand(
f'/usr/bin/arch-chroot {self.target} '
f'grub-mkconfig -o {boot_partition.mountpoint if boot_partition else "/boot"}/grub/grub.cfg'
f'grub-mkconfig -o {boot_dir}/grub/grub.cfg'
)
except SysCallError as err:
raise DiskError(f"Could not configure GRUB: {err}")
Expand Down