From owner-freebsd-arm@freebsd.org Tue Apr 21 18:34:54 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B07872B4646 for ; Tue, 21 Apr 2020 18:34:54 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-20.consmr.mail.gq1.yahoo.com (sonic313-20.consmr.mail.gq1.yahoo.com [98.137.65.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 496C0Y3bWYz3LCG for ; Tue, 21 Apr 2020 18:34:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: nrpQKloVM1kLeJAMRffcHxy4TAgnODN3M5fB_BsCJkWid8g3QO62wdwB9r43raD Xk1i0J12kCnIh8ZZi9NvBCl6r0QdaENvff8nIvJPaE4ENLHkJldmCwEaAxx4b3JoX3Gfr5FBfT9z Kh.dOQycmKKBoKGO88idOToTMbfleC_DRv46WcSfp2y2K2Ep8UwB1nLwFQyfswOuupfecPEFetWW UTy9ZeG2YDi1ZrR5QbsXSDanJuVGSeBJq7TbhUQfcs0u67Gqvby.NwAYWzUTJuSKxt3vPchXHUj0 4kBFhvVLxcYTA63bUPxUzukI5Ur5TVIiC22.53Lbqn3o56ELYa7iMCP83A2vFnZjdE2ZJfCloGy8 t5VUO8A44F8XRBndmEwx5fI80GLSzVg0P0tSEFPCmnjYJBF99USJJ8Q95t.ZrwnNU2S_mhBfVbPE 4_amtqRc9VbhxbPWjgFJiAWvgEyYzjCfrO.msPOVg_B2MaXRADC_55BPD5Rf3oZmsFRwW0cC0t6a h0OWj0RMF3EwyA8JU8tAIE1GF1UO00JyOdF8yZEjKwhw2IeDerwHt6VEurxkwG_Fq882FZ0SPJfM 9yiCUKhiPPvhBfHjWeomxpWvHLoshHGe0R639JBbkliE6guimyB37r00lbHpZ40rjN.0ztC7M.Yw u9pqf1upyfRIBYV5QHvVjSGDCHgrqR6609znRy.Jb8wPx7_T1xjh_Cqbhm.t.LDP8LKVoirECzK1 D1OlugcRMKtWgPL8Fcru9u3XSCAiMhoTybmdZG6uE203cQCOVyylwZT4CjZ5QaE5iOtPe5_5_03t nhflCMPcJ0X1OFU7wB820V9wA7flfhMorhkzGhfH3aFPY83Ss..08Qb6QbMoUOyEGChk6haFQeeq 6ZVJotAmswSVvWBsRespJ3AftMLZZbQKu8nI5r0N_tvoZXhfyLEGWKB0IqoR1bqN3VblR2.r5vmP FxyPINSSr3XLXemLJn5Rr5mTApRoe7LTqUVTU6IXFuS_dTeU_Vq3obIdEkIGhxvFnJMRmufwt3fb YeeaX6Ethq_C1ckYxT3FCZ8hIfketUY2flEe8Rm.QR.K8JRymFeBA5c4be2unsN0pRw8F6MqjJz6 5ICnp3xy7nd.gd4Ll.E4YukhiuD6vKZ61kHb1uU_Mkfxqyp7.QdPTYPq9TDB4HO4EGf1YS8xb1l6 2zaADrgyhyDV6QqqSYpr2_Bmm2NdiWDp6ccRvyCSbTc0hV6hX5O1UllwtUz2E97mwQWzIddN0C0J Dqi96T5PB_xnC9lH.uYGU_lpUlxayL0RPZ6ZCvaLbeOtx3jZ81BMpedrUaFexlSv0bNq3ZSWzzun KdRR8Vhw4uhqHf4r35HLoGOKOztMK30YJdKypMQuaznFC75BNHXD1IH4G3UGhT6vKb2uioPihhd6 Pc_6JqI4WzGmCh.Uf.VWqQeo- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Tue, 21 Apr 2020 18:34:51 +0000 Received: by smtp429.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 2343a2e60d9e669a2d9f3a2a1863ad1c; Tue, 21 Apr 2020 18:34:49 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Booting from USB on RPi3 From: Mark Millard In-Reply-To: <20200421180528.GB96994@www.zefox.net> Date: Tue, 21 Apr 2020 11:34:48 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <29E271DA-7E32-43EE-A029-4B9C35C1D1E9@yahoo.com> References: <20200420172512.GA94315@www.zefox.net> <20200420220756.GC94315@www.zefox.net> <39CD6D0A-AF9B-4E5E-95C9-11E343F02082@yahoo.com> <20200421180528.GB96994@www.zefox.net> To: bob prohaska X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 496C0Y3bWYz3LCG X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.47 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.982,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[83.65.137.98.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[ip: (2.09), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.67), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 18:34:54 -0000 On 2020-Apr-21, at 11:05, bob prohaska 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 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)