On 5/30/2025 4:35 PM, Greg A. Woods wrote: > 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)) >> > ... >> 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").
I would be curious to know what happens if you set bootdev=sd0a instead of bootdev=sd0 on that system. I cannot test the legacy case on my box. I think your arguments to totally ditch the code that tries to find the "booted_partition" would be much stronger if trying sd0a instead of sd0 does not work. That would suggest the code in question serves no useful purpose if its presence does not allow a working configuration when we give the kernel the correct root device with its partition index, such as sd0a. If it does work, however, then I think you would want to show that it still works even if we remove the code that we are saying is too complicated, and then you can argue that we should not have all this complicated code if it serves no useful purpose and does not help users configure their systems in flexible and useful ways.