Date: Tue, 21 Apr 2020 11:34:48 -0700 From: Mark Millard <marklmi@yahoo.com> To: bob prohaska <fbsd@www.zefox.net> Cc: freebsd-arm <freebsd-arm@freebsd.org> Subject: Re: Booting from USB on RPi3 Message-ID: <29E271DA-7E32-43EE-A029-4B9C35C1D1E9@yahoo.com> In-Reply-To: <20200421180528.GB96994@www.zefox.net> References: <20200420172512.GA94315@www.zefox.net> <CAJuc1zPzseM4Ez5ixk6LHiVvnXXBZgbxH9Rh2TvJn-qxADJuvg@mail.gmail.com> <20200420220756.GC94315@www.zefox.net> <39CD6D0A-AF9B-4E5E-95C9-11E343F02082@yahoo.com> <20200421180528.GB96994@www.zefox.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-Apr-21, at 11:05, bob prohaska <fbsd at www.zefox.net> wrote: > On Mon, Apr 20, 2020 at 03:32:31PM -0700, Mark Millard wrote: >>=20 >>=20 >> On 2020-Apr-20, at 15:07, bob prohaska <fbsd at www.zefox.net> wrote: >>=20 >>> 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. >>=20 >> 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. >>=20 >> So if "extra step" means any use of a miscrosd card, then >> it would not meet what appear to be your criteria.=20 >=20 > My only real criteria is that I be able carry out the steps > needed to make it work 8-). There's nothing intrinsically > wrong with using the microSD card. In some ways it's good.=20 >=20 >> 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. >>=20 >> 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. >>=20 >> If your context is an example of: >>=20 >> 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 >>=20 >> then I'm not sure that you can avoid the microsd card >> being involved. >>=20 >> 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. >>=20 >=20 > I think you're correct that I should test this using > default Raspbian. I originally hoped that setting the > USB boot OTP bit would guide the Pi to boot the msdos=20 > partition on the USB device, exactly as it boots from > the microSD.=20 >=20 > In my case, even with the USB boot OTP bit set the Pi > does not flash the rainbow screen when the microSD > card is absent; it just sits inert on power-up. Only=20 > with a bootable microSD does the Pi seem to do anything.=20 >=20 > In principle having a dual-boot configuration seems desirable: > A microSD-based "repair" installation, which can by default=20 > boot a USB-based "production" installation. It would be > reminiscent of older FreeBSD versions that brought up a boot > manager, allowing dual boot between, in those days, Windows > and FreeBSD. Unfortunately Raspbian can't read UFS, but it > does at least provide a hardware test.=20 >=20 > I expected the boot sequence to hop from microSD msdos partition > to USB msdos partition. If I'm reading right that that's not how=20 > it's presently being done.=20 Cross checking on other things: Which style of partitioning is in use on the USB drive? Same style as on the microsd card(s) that you use for booting? The RPi*'s do not deal with gpt or such for boot media. One thing that I do not know: does the RPi3 boot handle USB hubs (beyond its internal one(s))? In other contexts, I've had access to machines that could only handle direct connections for a USB boot drive, not boot-drives that were off a powered hub. =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?29E271DA-7E32-43EE-A029-4B9C35C1D1E9>