From owner-freebsd-embedded@freebsd.org Tue Oct 3 19:25:49 2017 Return-Path: Delivered-To: freebsd-embedded@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B75BE0ECA3 for ; Tue, 3 Oct 2017 19:25:49 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from valery.hibma.org (valery.hibma.org [178.21.114.54]) by mx1.freebsd.org (Postfix) with ESMTP id 936ED10E2 for ; Tue, 3 Oct 2017 19:25:48 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from [IPv6:2001:980:530a:1:6049:88f5:d663:8def] (unknown [IPv6:2001:980:530a:1:6049:88f5:d663:8def]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by valery.hibma.org (Postfix) with ESMTPSA id 6F98F6E0A17 for ; Tue, 3 Oct 2017 21:25:41 +0200 (CEST) From: Nick Hibma Content-Type: multipart/signed; boundary="Apple-Mail=_B6ABDF6A-6894-49CF-8389-66E361D4A002"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Dual NanoBSD partitions on RPi3 - partially solved Date: Tue, 3 Oct 2017 21:25:40 +0200 References: <5484657D-C8C4-4E26-BAC5-B8C10FDA1883@van-laarhoven.org> To: =?utf-8?Q?=E2=80=9CFreeBSD_Embedded_Mailing_List=E2=80=9D?= In-Reply-To: <5484657D-C8C4-4E26-BAC5-B8C10FDA1883@van-laarhoven.org> Message-Id: <6FB4B023-4028-40C5-89EF-74C56ADC00D5@van-laarhoven.org> X-Mailer: Apple Mail (2.3273) X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 19:25:49 -0000 --Apple-Mail=_B6ABDF6A-6894-49CF-8389-66E361D4A002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Just to respond to my own last remark: boot1.efi does not consider the = active flag to select the partition to boot in the MBR partition table, = and just loads loader from the first one. ubldr.bin used for booting = Raspberry Pi 1 devices does work that. Solution: workable, but complicated: If you want to boot from a second root partition, say /dev/mmc0s3a in = our case, you will have to add currdev=3Ddisk0s3a to /boot/loader.conf on the *first* root partition on /dev/mmc0s2a. In = that way 'loader' will load use the second root partition for booting, = despite the fact that it itself was loaded from the first one. Hope this helps anyone fiddling with this stuff. Nick Hibma nick@van-laarhoven.org -- Open Source: We stand on the shoulders of giants. > On 30 Sep 2017, at 23:00, Nick Hibma wrote: >=20 > Right, >=20 > I spent quite some time figuring this out (and learning how to use = U-boot, neat stuff!). The problem was I was trying to create an image to = load on a Raspberry Pi 3, using U-boot and the (crochet) examples. It = kept failing to load my disk image, but did load others, most notably = the RaspBSD one. It failed wiith 'failed to mount ext2 filesystem' in my = case. >=20 > I figured out that I had marked the second partition, the first UFS = one, as active, instead of the FAT partition. I want to mark that = partition active because I need to be able to choose between the second = and third partitions, both UFS root partitions. But the = scan_dev_for_boot_part macro in U-Boot uses fstype to figure out = bootable partitions and tries to open that partition as an ext2 = partition which produces that error. And it only tries boot using EFI = from those bootable partitions and completely forgets about the first = partition on which the EFI stuff is stored in our case. >=20 > I resolved this by changing the mmc_boot macro like so: >=20 > setenv mmc_boot "setenv devtype mmc; setenv distro_bootpart 1; = run scan_dev_for_efi" >=20 > I haven't quite figured out how to switch to the second UFS root = partition yet. I assume that can be done the usual way, by marking the = other partition active. EFI then picks that one I hope. But that's for = some other time. Just wanted to get this solution into the lists. >=20 > Cheers, >=20 > Nick Hibma > nick@van-laarhoven.org >=20 > -- Open Source: We stand on the shoulders of giants. >=20 >=20 >=20 --Apple-Mail=_B6ABDF6A-6894-49CF-8389-66E361D4A002 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 Comment: GPGTools - https://gpgtools.org iQIzBAEBCgAdFiEETFbRZ/gKjBgO10CrH3Ic7sY0duAFAlnT5DQACgkQH3Ic7sY0 duDuNg/+PK7Jc3GQsViMZiB9Qocgf/GOnl0zZxltIA/opuUTcIbAlXw1Wmhicqpc sqAeQk68SSr7AD+Ct3HXmnw/uDpeDhd8UTxv/q7RLzSAGjeXmm3HWcbFXIBw+PZa Cpw4vbxlPbT9KVp2fEQETE1H3SfV7NBy0VbQD5cXrB4FmASgMMacK2H2Tk+h15Ee iYUahekbmn30HP0QPv+vfCpjchZfHGq1Xq6b93H2/qlRq+eWhRtGTf7ssY6lNKVM OOorRZH/8Wg0nXAXdnRtgxnLpuXlvssmJtk6qQJmZu9PvVRAdHj3KuiXAcgHM7Ta pRyhLyy6TAp2Wtlw+nXLvuUs2hAkOlpvDn1JHLA9UAQ1ZGXJw3zRCcDJyiLv5qBM Xl7xWf4s9PmUm+z/dqxlm9NbP8LdU/5epg57wYxXo2NMB9FEvvzu4MhD+Xd/To4g YQZMXWr6Xp8TyzxNB58xRgfTArvS+n5p31qYVIllxTFhWmO8aeIS6FQdx/JVXvHE 3yaBqMeF3Me1ucOdWSaU0UmPqg4x/dn11CZdNd4fxtmB4CH7S3cdfGLd+dxGyTbY 87fu2MzFfynR8pnC150lHA4wZdBcWwbr3NAWCXnKhGpYUypURUMLW1OWnXfAmg9l K+ArF74Hzj/YXEcaqnu0VpTrgdZcHVk+Ajr13+DC6U3TeMdFHBU= =kjLj -----END PGP SIGNATURE----- --Apple-Mail=_B6ABDF6A-6894-49CF-8389-66E361D4A002--