Booting from USB on RPI3
bob prohaska
fbsd at www.zefox.net
Thu Apr 23 16:21:55 UTC 2020
On Wed, Apr 22, 2020 at 10:28:29PM +0200, Georg Lindenberg wrote:
>
> Uboot will run bootcmd, unless you hit a key. Then it will enter the shell.
>
> You can track down bootcmd (env print bootcmd):
>
> bootcmd=distro_bootcmd
> distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}
> boot_targets=mmc0 mmc1 usb0 pxe dhcp
>
> So, in this loop, usb0 is in third place. :-/ mmc will boot first.
>
> U-Boot> env print bootcmd_usb0
> bootcmd_usb0=devnum=0; run usb_boot
>
For some reason I can't use run usb_boot, it's necessary to use
U-Boot> usb reset
resetting USB...
Bus usb at 7e980000: scanning bus usb at 7e980000 for devices... 8 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
U-Boot> run bootcmd_usb0
Device 0: Vendor: Initio Rev: 1.06 Prod: MHT2040AH
Type: Hard Disk
Capacity: 38154.3 MB = 37.2 GB (78140160 x 512)
... is now current device
Scanning usb 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc at 7e300000.blk...
Scanning disk usb_mass_storage.lun0...
Found 6 disks
BootOrder not defined
^^^^^^^^^^^^^^^^^^^^^ this is trouble if it includes microsd devices
EFI boot manager: Cannot load any image
^^^^^^^^^^^^^^^^^^^^^ more bad news
687984 bytes read in 402 ms (1.6 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
^^^^^^^^^^^^^^^^ not sure about this
Next comes a couple screens of linefeeds, then:
Consoles: EFI console
Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk1p1:
FreeBSD/arm64 EFI loader, Revision 1.1
(Thu Apr 16 06:59:37 UTC 2020 root at releng1.nyi.freebsd.org)
Command line arguments: loader.efi
Image base: 0x39e91000
EFI version: 2.80
EFI Firmware: Das U-Boot (rev 8217.4096)
Console: comconsole (0)
Load Path: /efi\boot\bootaa64.efi
Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x0)/UsbClass(0x424,0x9514,0x9,0x0,0x2)/UsbClass(0x2109,0x2811,0x9,0x0,0x1)/UsbClass(0x13fd,0x1040,0x0,0x0,0x0)/HD(1,0x01,0,0x81f,0x18fa8)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x0)/UsbClass(0x424,0x9514,0x9,0x0,0x2)/UsbClass(0x2109,0x2811,0x9,0x0,0x1)/UsbClass(0x13fd,0x1040,0x0,0x0,0x0)/HD(1,0x01,0,0x81f,0x18fa8)
Setting currdev to disk1p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x0)/UsbClass(0x424,0x9514,0x9,0x0,0x2)/UsbClass(0x2109,0x2811,0x9,0x0,0x1)/UsbClass(0x13fd,0x1040,0x0,0x0,0x0)/HD(2,0x01,0,0x197c7,0x4a6bb39)
Setting currdev to disk1p2:
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
Loading kernel...
/boot/kernel/kernel text=0x9b804c data=0x192958 data=0x0+0x3a21fe syms=[0x8+0x10f740+0x8+0x134f85]
Loading configured modules...
/boot/kernel/umodem.ko text=0x2100 text=0x1390 data=0x6e0+0x10 syms=[0x8+0xf48+0x8+0xb6e]
can't find '/boot/entropy'
Hit [Enter] to boot immediately, or any other key for command prompt.
Type '?' for a list of commands, 'help' for more detailed help.
It's unclear where the kernel loaded from, but at this point a
listing of /boot reports the files on the USB disk, not microSD.
The image is from a 12.1 snapshot. /firstboot has been renamed
no.firstboot, might that be significant?
It looks as if loader is confused about what disk it's on:
OK show rootdev
variable 'rootdev' not found
OK
Running show reports, among many other things:
currdev=disk1p2:
kernel=kernel
kernel_options=
kernel_path=/boot/kernel
kernelname=/boot/kernel/kernel
kernels_autodetect=YES
loaddev=disk1p2:
^ the colon looks a little odd
The loaddev would make sense if mmcsd is device 0, I'm not sure that's true.
What's the simplest way to inform loader on the usb device it's actually
_on_ the usb device. I've tried setting rootdev=da0s2a, didn't work.
Thanks for reading, and all your help!
bob prohaska
More information about the freebsd-arm
mailing list