NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: EFI amd64: boot.cfg goes where?



On Mon Aug 3, 2026 at 5:22 PM MDT, RVP wrote:
On Tue, 4 Aug 2026, Robert Elz wrote:

 | On Sun, 2 Aug 2026, DTB wrote:
 |
 | > My boot.cfg is just
 | >>>  root NAME=NETBSD
 | >>>  boot NAME=NETBSD:netbsd
 | >
 |
 | That syntax isn't right. See boot.cfg(5) for examples.

The syntax is OK, boot.cfg just shows a more complex example
using a menu so the user can select what to boot.   If that's
not desired it doesn't need to be used.
[...]
So, `boot=...' and `root=...' in boot.cfg -- if on their own lines ie. not
as part of a `menu=...' line.

I went back over everything and made it a little further. I liked the
sound of having a menu to be able to break into the boot prompt and boot
single user and such, so I tweaked the example in boot.cfg(5) to work
with my system:

root=hd0d
menu=Boot:rndseed /etc/entropy-file; boot hd0d:netbsd
menu=Boot single-user:rndseed /etc/entropy-file; boot hd0d:netbsd -s
menu=Boot prompt:prompt
default=1
timeout=3
clear=1

This is still meant to work with the following (abridged) GPT structure:
-----
index  contents
   1  GPT part - EFI System
   4  GPT part - NetBSD FFSv1/FFSv2
   5  GPT part - NetBSD swap

This booted the kernel but no matter what I tried, while the kernel
wisely chose dk4 as the dump device, it chose dk0 as root, which is the
msdosfs ESP.

True, but, `bootme' also causes problems if attached to the wrong partition:

https://www.unitedbsd.com/d/1301-efi-installation-latitude-e4310

When you said this I read the article and figured I might as well try
setting the bootme attribute on GPT index 4:

# gpt set -i 4 -a bootme wd0

So I went to verify the change:

# gpt show wd0

But there was no difference in output! Shocked, I consulted the man
page for gpt(8), and realized "gpt show" does not by default show
partition attributes. I then tried:

# gpt show -a wd0

Which showed that partition 4 had the bootme attribute... but so did
partition 1, the ESP! Per your hyperlinked UnitedBSD forum answer,
...The EFI ESP should not be flagged bootme.

I fixed that like so:

# gpt unset -i 1 -a bootme wd0

And now my system boots successfully! Thank you for your help! My next
steps will probably be trying-and-erring to make my boot.cfg look a
little nicer. I am a little curious as to how my NetBSD rootfs at GPT
partition 4 is called hd0d by the booter as I thought hd0d would be the
third partition; it goes hd0a, hd0b, and then hd0c is the whole drive,
right?

:3 <3 -3



Home | Main Index | Thread Index | Old Index