Booting from USB on RPI3

bob prohaska fbsd at www.zefox.net
Thu Apr 23 22:41:10 UTC 2020


On Fri, Apr 24, 2020 at 09:31:09AM +1200, Jonathan Chen wrote:
> On Fri, 24 Apr 2020 at 09:26, bob prohaska <fbsd at www.zefox.net> wrote:
> >
> > On Fri, Apr 24, 2020 at 08:32:54AM +1200, Jonathan Chen wrote:
> > > On Fri, 24 Apr 2020 at 08:22, Mark Millard <marklmi at yahoo.com> wrote:
> > > [...]
> > > > The RPi3 will not start to boot from a gpt partitioned
> > > > media. So picking gpt labeling as the example is somewhat
> > > > misleading for single-media booting. glabel based
> > > > labeling would be more realistic for the context.
> > >
> > > The OP is attempting to boot off an external USB drive via loader.env.
> > > So it's the external drive's partitioning system that is of interest.
> >
> > The USB drive on my system was written with dd using
> >  FreeBSD-13.0-CURRENT-arm64-aarch64-RPI3-20200409-r359731.img
> > It's been resized to fill the hard disk and given a swap partition.
> > Gpart reports
> > bob at www:~ % gpart show da0
> > =>      63  78140097  da0  MBR  (37G)
> >         63      2016       - free -  (1.0M)
> >       2079    102312    1  fat32lba  [active]  (50M)
> >     104391  78035769    2  freebsd  (37G)
> >
> 
> This is consistent with what your boot messages are showing. Your
> loader.env should have rootdev=disk1p2:
> 
I've added /boot/loader.env and tried to boot again. After loading
the kernel I stopped at the loader prompt:

Hit [Enter] to boot immediately, or any other key for command prompt.

Type '?' for a list of commands, 'help' for more detailed help.
OK  show rootdev
variable 'rootdev' not found
OK more /boot/loader.env
*** FILE /boot/loader.env BEGIN ***
rootdev=disk1p2:
*** FILE /boot/loader.env END ***

It's pretty clear loader is looking at USB.

> Your current boot failure is due to the contents of /etc/fstab. What
> do you have in there?

Only what was supplied by the snapshot image file:

# Custom /etc/fstab for FreeBSD embedded images
/dev/ufs/rootfs   /       ufs     rw      1       1
/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0
tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0

At the loader prompt /boot is populated, apparently from USB,
but /dev is empty. It may be crude, but would replacing
/dev/ufs/rootfs
with
/dev/da0s2a
work for now? I.e., would it become meaningful by the
time the kernel needs to know where it lives? I expected that to
happen automatically, but since /etc/fstab will have to be edited
anyway to turn on swap it's relatively easy. 

Thanks for reading!

bob prohaska

 



More information about the freebsd-arm mailing list