Date: Mon, 18 May 2026 18:26:28 +0100
From: Sad Clouds <[email protected]>
Message-ID: <[email protected]>
| This looks like a bug in the bootloader, because this contradicts
| boot(8) man page:
Not really, if it is as I suspect, it is more a (mostly undocumented)
limitation in the protocol between the boot program and the kernel.
The former passes information to the kernel in (for x86 arch anyway) a
bootinfo structure, the root filesystem information is included in
this:
struct btinfo_rootdevice {
struct btinfo_common common;
char devname[16];
};
(The common part is just length/type info). You can find all this in
src/sys/arch/x86/include/bootinfo.h (which should be installed in
/usr/include somewhere, but make sure you find the right one).
Your root filesystem device names are:
NAME=NetBSD-root
or
NAME=NetBSD-diag
both exactly 16 chars long, and once \0 terminated, guess what doesn't
fit in a 16 char array!
For exactly that reason, I name my root partitions (the only thing that
matters) with shorter wedge names, my current one is Test_Root, but if I
were still using my planned root filesys, it would be NBSD_Root. Both
of those with NAME= prepended are just 14 chars, and so fit.
The boot loader itself has no issues, it uses however long the string needs
to be, but that 16 char (\0 included) limit has been set in stone from back
when all you'd see as a device name was "wd0a" or something similar.
So, try shortening your wedge names for anything which can be a root filesys,
and see what happens.
When there is no root device name passed (or no valid one, whichever it is
in this case) the kernel falls back on its rules for detecting which filesys
is the root, and for that, whatever the answer is, it will be the same
every time.
kre