Re: Using loader to switch kernel and root device on Pi2

From: bob prohaska <fbsd_at_www.zefox.net>
Date: Wed, 02 Apr 2025 15:22:05 UTC
On Wed, Apr 02, 2025 at 08:15:19AM +0900, 風來散人 wrote:
> Hello all.
> 
> Are we able to utilize /EFI/freebsd/loader.env to specify rootdev? "man
> loader.efi"says "Additional Environment Variable".
> I don't have RPI2 but have RPI4. 

If you have a Pi4 it might be worth trying to use the new Raspberry Pi
boot menu feature. Supposedly it's available on the Pi4 and Pi5, though
I've not been able to invoke it on my Pi5. Somewhat curiously, it isn't
mentioned anywhere in the official documentation, only in what seem to be
credible online reports, such as
https://www.youtube.com/watch?v=Ep19ws3W2KY

> I put 2 freebsd systems on one micro SD
> and I can't switch boot partition by loader.env file.
> The number to assign for disks is question but if I put "rootdev=disk0s3a",
> the third partition on SD card is used.

I put in /boot/loader.conf on the boot device the lines 
currdev="disk0s2a"
and
vfs.root.mountfrom="ufs:/dev/da0s2a"

These names were worked out by using 
lsdev
at the loader prompt on a serial console.

I'm not accquainted with loader.env.

It's possible that the system can't count more than one bootable
partition per physical device. It might be simpler to put the two
bootable system on different physical media, at least to start with.

hth,

bob prohaska