Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Apr 2020 15:32:31 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        bob prohaska <fbsd@www.zefox.net>
Cc:        Jonathan Chen <jonc@chen.org.nz>, freebsd-arm@freebsd.org
Subject:   Re: Booting from USB on RPi3
Message-ID:  <39CD6D0A-AF9B-4E5E-95C9-11E343F02082@yahoo.com>
In-Reply-To: <20200420220756.GC94315@www.zefox.net>
References:  <20200420172512.GA94315@www.zefox.net> <CAJuc1zPzseM4Ez5ixk6LHiVvnXXBZgbxH9Rh2TvJn-qxADJuvg@mail.gmail.com> <20200420220756.GC94315@www.zefox.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2020-Apr-20, at 15:07, bob prohaska <fbsd at www.zefox.net> wrote:

> On Tue, Apr 21, 2020 at 07:31:40AM +1200, Jonathan Chen wrote:
>>=20
>> This is how I got my RPI3 running 12-STABLE to boot off USB. It does
>> require a microSD card with u-boot, and the loader.efi built sometime
>> after Sep 2019 though. However, my root-filesystem (and swap) lives =
on
>> an external USB drive.
>>=20
>> 1. Copy the loader.efi to EFI/BOOT/bootaa64.efi
>>=20
>> 2. Create a text file: EFI/FreeBSD/loader.env, this file contains a
>> one-line directive to loader(8) on where to find a kernel to boot.
>> Mine contains:
>>  rootdev=3Ddisk1p1:
>> The disk entry should be the same as what loader(8) expects with your
>> USB disk setup. Mine has a GPT partitioning scheme, with the root-fs
>> on partition-1.
>>=20
>> 3. All /etc/fstab entries should use symbolic name entries instead of =
da0*. eg:
>> 7:27am# cat /etc/fstab
>> # Device                Mountpoint      FStype  Options         Dump  =
  Pass#
>> /dev/gpt/topaz-root     /               ufs     rw              1     =
  1
>> /dev/gpt/topaz-swap     none            swap    sw              0     =
  0
>>=20
>> Hope this helps.
>> --=20
>=20
> Where is the kernel loading from? I gather it's been long-time
> practice to load the kernel from microSD and then mount the USB
> device as root; it that what you're doing? It appears that using
> usbboot (correctly!) would eliminate that extra step.

Looks to me like the rootdev assignment is controlling
where the kernel is loaded from but the FreeBSD loader
and its loader.env still are found on the microsd card
and used from there.

So if "extra step" means any use of a miscrosd card, then
it would not meet what appear to be your criteria. But if
you are okay with only needing a msdos file system
based microsd card with appropriate materials added
to the msdos file system (no freebsd partitions required),
then it might be okay.

I'm not sure if armv7's without an EFI-like context have
a msdos file system path analogous to EFI/FreeBSD/loader.env
to allow the same sort of rootdev-assignment technique or
not.

If your context is an example of:

QUOTE
in situations where a Pi 3 fails to boot (the latest bootcode.bin =
includes additional bugfixes for the Pi 3B, compared to the boot code =
burned into the BCM2837A0)
END QUOTE

then I'm not sure that you can avoid the microsd card
being involved.

But that would be testable in a normal RPi OS
context: If you can boot Raspbian via USB-only
in the normal USB-only manor, then the problem
is elsewhere for doing so for FreeBSD. Going
the other way: If you can not boot Raspbian via
USB-only, then the microsd card is likely going
to be involved for any OS for that specific RPi3.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39CD6D0A-AF9B-4E5E-95C9-11E343F02082>