At Fri, 30 May 2025 06:29:49 -0400, Chuck Zmudzinski <frchu...@gmail.com> wrote:
Subject: Re: Xen boot strangeness (Was: Re: [SOLVED] Re: Xen 4.18.5_20250521nb0 
not ELF binary (Was: Re: EFI and Xen))
>
> I am not sure I understand why it is even necessary to do this search for the
> boot device on modern UEFI/GPT partitioned systems.

With the current restriction in Xen multiboot of needing to tell the
kernel where to find the root filesystem, this search is actually
completely bogus for _all_ Xen/multiboot setups.

> Why not just allow the user
> to directly specify the root device and the dump device in the boot.cfg file

Exactly what I've always thought.

> Maybe such simplicity is not possible or so easy with old legacy BIOS booting
> and MBR partitioning and on such systems

No, there's no difference for legacy systems.  The bootloader still
can't automatically pass the "bootdev" to the kernel in "the old way",
The bootloader does still need figure out, or be told how to find and
load /xen and /netbsd.  However the NetBSD kernel also still needs to
know where the root (and optionally dump) partition is, and it has to be
told explicitly on its command line from the string given in /boot.cfg,
so using the idea of "bootdev" instead of being explicit about the
actual root device name is pointless.

On one such legacy system I pass "bootdev=sd0" and it figures out which
partition to use, but in theory this could/should be "root=sd0a" (maybe
with "dump=sd0b").

Using "bootdev=", with all the old baggage of still having to sort out
the root partition from that is pointless -- all it might make easier is
IFF the "device" part in the "boot" command could be copied exactly, but
in my experience that's not what most people seem to do anyway (unless
implicitly, as I do with "sd0", but that's not a copy per se then), so
let's stop using it!  Let's just be specific that we're specifying the
actual root partition device name, as the kernel knows it (i.e. _not_ as
the bootloader might know it).


Chuck, I think only one or two other tests might be useful.

Try using "bootdev=hd2d", i.e.:

menu=Boot normally with Xen:dev hd2d:;load /netbsd-XEN3_DOM0.gz -c 
console=xencons bootdev=hd2d;multiboot /xen.gz dom0_mem=2G dom0_max_vcpus=4 
com1=9600,8n1,0x40c0,16,1:0.0 console=com1 cet=no-ibt pv-l1tf=false

I don't think that will work because "hd2[a-p]" didn't appear in the
list when you typed "?", but it might be worth trying.  (How did you
figure out it should bew "hd2d" anyway?)

That's what I mean by saying "bootdev=" would only be useful if one
could exactly copy the "device" part to it.

Hmmm.... I guess if one told the bootloader to use a GPT partition by
"NAME=label", then one could hopefully tell the NetBSD kernel the same
(but with the "wedge:label" syntax.

Chuck if you have a plain label (not just UUID) on your root partition,
maybe you could try:

menu=Boot normally with Xen:dev NAME=rootlabel;load /netbsd-XEN3_DOM0.gz -c 
console=xencons bootdev=wedge:rootlabel;multiboot /xen.gz dom0_mem=2G 
dom0_max_vcpus=4 com1=9600,8n1,0x40c0,16,1:0.0 console=com1 cet=no-ibt 
pv-l1tf=false

Either way the idea is to tell both the bootloader and the /netbsd
"module" where the root filesystem is -- the "booted device" is just
useless legacy information which allowed legacy users to assume that the
root partition was the literal first partition on a device.

--
                                        Greg A. Woods <gwo...@acm.org>

Kelowna, BC     +1 250 762-7675           RoboHack <wo...@robohack.ca>
Planix, Inc. <wo...@planix.com>     Avoncote Farms <wo...@avoncote.ca>

Attachment: pgpnEObxKsHnp.pgp
Description: OpenPGP Digital Signature

Reply via email to