Sujet : Re: MicroSD-based USB boot manager for Pi?
De : bp (at) *nospam* www.zefox.net
Groupes : comp.sys.raspberry-piDate : 19. Mar 2025, 17:31:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrerg8$16sn7$2@dont-email.me>
References : 1 2
User-Agent : tin/2.6.4-20241224 ("Helmsdale") (FreeBSD/14.2-STABLE (arm64))
Theo <theom+
news@chiark.greenend.org.uk> wrote:
bp@www.zefox.net wrote:
Is there some sort of USB boot manager for Raspberry Pi versions
that don't have an EEPROM? I'm thinking of armv7 Pi2 and early Pi3.
Bootcode.bin on an otherwise blank msdos microsd partition works,
but seemingly only with a single USB drive connected. A second
USB disk left in place by mistake caused the machine to hang.
Something installed on a microSD that finds and reports bootable
USB drives, defaulting to the last one used, would be ideal.
This video from about 2016 suggests it's already been done:
https://www.youtube.com/watch?v=bNL1pd-rwCU
But, no implementations turned up in a web search. All the boot
manager references I found seemed to involve the Pi4. I'm interested
in using older machines already on hand. As it happens, most of
my machines run FreeBSD which uses u-boot as an intermediate step
but I don't think that matters.
There's no reason why you can't use u-boot as a boot manager for Linux too.
I'm not trying to boot Linux, but rather FreeBSD. The problem seems to be
that bootcode.bin gets stuck if there are two USB drives connected at startup.
Absent that problem, bootcode.bin finds the USB disk and starts u-boot, which
then successfully launches the FreeBSD bootchain to load a kernel from USB.
Many non-Pi Linux boards do this. However it'll only handle the Linux
kernel - if you have different firmware, config.txt etc then u-boot is
unaware of that - it runs too late in the boot process to change those
things. Really u-boot can only change the Device Tree, kernel,
initramfs and kernel environment (variables, command line). U-boot is
running on the CPU, and so can't affect the GPU which is booted first on Pis
1-3.
AIUI, the
kernel=u-boot.bin
line in config.txt tells which binary to load and run from the msdos
partition on the (single) USB disk found if there's nothing visible
on microSD.
EDK2, a UEFI bootloader (similar to a PC BIOS) is also a possibility, but
the same limitations will apply.
There's been some discussion in the FreeBSD lists about using EDK2, but I
believe it's still rather preliminary. I certainly didn't understand much.
At one time it was possible to allow bootcode.bin to start u-boot on the
microSD card and then issue
run bootcmd_usb0
to start the bootchain on a USB drive. That command seems to have been
dropped in the time since from the version of u-boot shipped with FreeBSD.
But, the problem with multiple connected disks remains.
I was hopeful that something like a microsd with grub (or equivalent)
for the Pi1-3 had been developed.
Guess not.
Thanks for writing,
bob prohaska