Sujet : Re: Pi2 bootcode.bin puzzle
De : bp (at) *nospam* www.zefox.net
Groupes : comp.sys.raspberry-piDate : 31. Mar 2025, 16:34:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsecm5$kil0$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : tin/2.6.4-20241224 ("Helmsdale") (FreeBSD/14.2-STABLE (arm64))
The Natural Philosopher <
tnp@invalid.invalid> wrote:
On 31/03/2025 01:10, bp@www.zefox.net wrote:
The method is to interrupt boot just before the kernel starts.
Next, unload the kernel, set the currdev to disk0s2a, set
the root device to da0s2a, load the kernel again (from the
new root device and boot.
Ugly...
Absolutely agreed!
Setting currdev and rootdev can be done in /boot/loader.conf
on the microSD's FreeBSD, I've asked on the freebsd-arm mailing
list where the unload and load commands should go.
So that is the same as cmdline.txt
Similar, in the sense that loader.conf on FreeBSD permits one to
set variables that are passed as flag options to the kernel on startup.
There are still some problems with usb disk discovery failing,
but this is a big improvement.
I think that is the rootwait switch on the Linux system
https://forums.freebsd.org/threads/how-to-delay-mountroot.92152/
Has some info that might be useful
The disk discovery seems to happen during the bootcode.bin or u-boot
stage. By the time loader starts up, if the usb disk hasn't been found,
loader fails to report its existence in an lsusb query.
There is a variable in loader.conf called
kern.cam.boot_delay
which can be set to wait in milliseconds for the disk to spin up,
but that only affects behavior after bootcode.bin and u-boot are
long gone.
This situation is what prompted me to post earlier about boot managers
for the RPi family. Bootcode.bin seems to do a rather unreliable job
of exploring the system for bootable media. U-boot likewise takes its
cues from bootcode.bin, apparently.
Thanks for writing!
bob prohaska