For UEFI systems, NetBSD utilizes its own boot manager and configuration methods. When installing NetBSD on a UEFI system, the installation process involves creating an EFI system partition and placing the UEFI boot loader there. This setup is typically handled by the installation process itself, especially in newer versions of NetBSD (9.0 and later) which are more automated in terms of recognizing and setting up UEFI boot. [Ref:
https://wiki.netbsd.org/Installation_on_UEFI_systems/]
If you need to manually configure or modify UEFI boot entries in NetBSD, you might have to interact directly with the UEFI firmware settings (via the computer's BIOS setup menu) or use a third-party UEFI boot manager like rEFInd, which can be installed separately and used to manage boot entries across different operating systems.[Ref :
https://mail-index.netbsd.org/netbsd-users/2018/06/02/msg020865.html]
For specific tasks like adding a new boot entry or changing boot order, these actions are typically performed outside of the operating system on most UEFI-equipped systems, directly through the UEFI firmware interface. This approach differs from systems like Linux, where efibootmgr provides a command-line interface to modify the UEFI boot manager entries directly from the operating system.
Also worth reading this discussion:
Hello!
Thank you for your response but unfortunately this is not what I am
looking for :) gpt(8) works with partitions and, yes, it can modify
some attributes. But I'm looking for a utility that can add netbsd
loader into the UEFI boot menu.
Anyway, I have solved the problem by booting into FreeBSD live images
and issuing:
efibootmgr -a -c -l /mnt/EFI/boot/bootx64.efi -L NetBSD
Now I have a "NetBSD" entry along with other OSes in the boot menu.
On Sat, May 4, 2024 at 7:40 PM Martin Neitzel
<neitzel%hackett.marshlabs.gaertner.de@localhost> wrote:
>
> VS> Does NetBSD have efibootmgr or any similar utilities to add/modify
> VS> UEFI boot entries?
>
> apropos(1) doesn't turn up "efibootmgr or any similar utilities"
> as in Free/DragonflyBSD, but gpt(8) may be able to do what you need:
>
> gpt set -l
> gpt set [-a attribute] [-N] [-i index] [-b startsec]
> The set command sets various partition attributes. The -l flag
> lists all available attributes. The -a option specifies which
> attributes to set and may be specified more than once, or the
> attributes can be comma-separated. If the -N option and no -a
> option are specified, all attributes are removed. The -i or the
> -b option specify which entry to update. The possible attributes
> are “biosboot”, “bootme”, “bootonce”, “bootfailed”, “noblockio”,
> and “required”. The biosboot flag is used to indicate which
> partition should be booted by legacy BIOS boot code. See the
> biosboot command for more information. The bootme flag is used
> to indicate which partition should be booted by UEFI boot code.
> The other attributes are for compatibility with FreeBSD and are
> not currently used by NetBSD. They may be used by NetBSD in the
> future.
>
> [Same for NetBSD-8/9/10/current; caveat: I'm pretty clueless about about
> UEFI myself.]
>
> Martin Neitzel