Re: EFI amd64: boot.cfg goes where?

Robert Elz <[email protected]> Mon, 03 Aug 2026 22:14:46 +0700
Newsgroups gmane.os.netbsd.general
Message-ID <[email protected]>
    Date:        Sun, 02 Aug 2026 22:14:59 -0600
    From:        "DTB" <[email protected]>
    Message-ID:  <[email protected]>

  | and then my NetBSD disklabel partition is 128GiB.

That is the source of your problems.   The NetBSD partition must be a
filesystem (FFS generally, though some others might work) not a disk
image, which is what you have if it has a disklabel.    I'd be interested
to know what type that partition is shown as in the GPT, as to the best
of my knowledge, there are no defined types for "disk image" (and having
one would be totally against the goals of GPT).

In ancient MBR partitioning, the small number of partitions (and the
chain lookup required for the add on "extended" partitions) meant that
it made sense for OS's that like multiple partitions to supply their own
labelling scheme inside "their" partition.   With GPT there is no need for
that, the default partition table size (and strictly, according to the
spec, its minimum size - though nothing I have ever seen enforces that)
allows for 128 partitions, and you can easily create a much bigger GPT
with the potential for thousands of partitions if you wanted.

So, start again, create as many GPT parititions as you need for NetBSD.
If you want, you could use your disklabel start block numbers, possibly
in conjunction with the GPT start block number (there's no definition for
a disklabel within a GPT, so whether the disklabel block numbers would be
relative to the start of the drive (unlikely, as that would limit drives
with 512 byte logical sectors to 2GB - though with BIOS partitioning that
is how NetBSD disklabels work) or relative to the start of the GPT partition
is unspecified, so yours could be anything) - and simply make new GPT
partitions (replacing the current NetBSD partition) for each of the
partitions (excl c & if used eg: x86 systems, d) that are in your disklabel,
simply dropping whatever gap you have between the start of the current
partition and the start of the actual (probably root) first partition
within it.   The GPT sizes should be the same as the disklabel sizes.

  | My single ESP is being used for all three operating systems.

That is fine.   I have some drives with one ESP for multiple possible
boots, and others with more than one ESP - it used to be required to have
separate ESPs for different versions of NetBSD's efiboot, as only the
default (UEFI) name was supported for it - now that is no longer a requirement,
we can set BOOTxxxx vars to contain whatever name is desired for the
NetBSD efiboot).

Once you have an actual GPT partition corresponding to the NetBSD rooot
partition, and that is the first NetBSD partition in the GPT (smallest index,
where the blocks are on the drive is irrelevant) or the only NetBSD
partition with the "bootme" attribute set, then efiboot (recent versions)
should find /boot.cfg in that.   With your setup that can't happen, as
efiboot has no idea how to process a disklabel.

And finding boot.cfg in the root partition is lunacy, as one of its tasks
is to specify which partition is to be root ... that needs to be changed
sometime so the boot.cfg file is found in the same ESP as the efiboot
being used.

kre