The original post: /r/linux by /u/Java_enjoyer07 on 2024-09-29 08:16:53.

I found a little Trick when trying to dualboot OpenBSD when making a custom entry i couldnt find the EFI path since unknown file System but rage quitting after setting the root of the ESP booted OpenBSD this moment it hit me.

Using GRUB as a UEFI Frontend for OpenBSD Booting

Instead of making GRUB handle the full boot process for OpenBSD, you can use it as a simple frontend that hands off control to the UEFI bootloader. This is particularly useful because it eliminates the need to find the specific path to the EFI file, which can sometimes be tricky.

How it works:

GRUB lets you specify the root of the EFI partition where the OpenBSD bootloader resides.

After setting the correct root, GRUB can simply exit, handing control back to UEFI.

UEFI, which is already configured with the OpenBSD bootloader, will automatically boot OpenBSD.

This method doesn’t change the boot order, and GRUB serves as a frontend, making UEFI boot the system without having to manually specify the EFI file path.

GRUB Configuration: In your /etc/grub.d/40_custom file, add the following entry:

menuentry “OpenBSD” { set root=(hd0,6) # Replace (hd0,6) with the correct partition for OpenBSD’s EFI exit # Return to UEFI, which will boot OpenBSD }

Explanation:

set root=(hd0,6): This sets the root to the partition where the OpenBSD EFI loader is located. You should replace (hd0,6) with the actual partition that holds the OpenBSD EFI loader.

exit: Instead of chainloading or directly booting the EFI file, this exits GRUB, returning control to the UEFI firmware. Since UEFI already knows how to boot OpenBSD from that partition, it will handle the boot process automatically.

Benefits:

You avoid the hassle of locating the exact EFI file path.

GRUB becomes a simple interface for managing your boot options without having to configure complex boot paths.

UEFI handles the actual booting, ensuring a more straightforward and error-free boot process.