From owner-freebsd-arm@freebsd.org Thu Apr 23 19:15:08 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 47B0F2C0CC9 for ; Thu, 23 Apr 2020 19:15:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic302-22.consmr.mail.gq1.yahoo.com (sonic302-22.consmr.mail.gq1.yahoo.com [98.137.68.148]) (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 497Rp16wx7z4DDr for ; Thu, 23 Apr 2020 19:15:05 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: te3EwFwVM1kUO5fOPJBA50vgMvnHSoHOOxt8FFrXaVUj3e_qUPBZ1JMuJY8nwAY sU2oeETMtGkrbE4Gp2HnCxwxI.Fr6ACEUAlkaCKcmq4tjI2zkUuf9AsSGGpsFGb6yG2Gkd1CEKpF WoUqRXEqLK7eC5zSaG_rTX5r7ZI5wg7stU0ZVFnRSYa_kVRYNwfhOhDsGU1gAK.dfc6xOEjg.3Ws 3_hevzHafrLj57uCvJy8fGGYr8_fR8KgnKWlr3xeosTEE7iLTdp.uWWdPL4zSY8oJsCAluf1A8qd 9EyPDg6z8JuJs9T8yoiDzpaO_CvNru7QzxxigqAR6anBQKF2h9gxCWMOOLE5Kz1ju0IxqBl4m094 MmvY6LK_OlM1FqARCbEy6TkWJAiCths0uARRiadTVZptbsFGOGrxdpWcW9.KPpdpZAdc6lSFvjkB iwo81vJ7Ohz65_WyRBRWw_UNbqJJhfof1jI6KCnlR3Kk8W87NLWggv6KpDMH0NG90hdic3vT.YdS ZSfziyM9XUH5_NG5c3W4vrinwu_albmaDVRvXV5KThgrfxuazI4uYcgk9CpthsrvXpQzQmroz9RC 1fWvObrOriQaUH9pTiy6Yj9WKUhUyNyv08.gsxXqiHJvSPwu1yHay2_Hh11ljpHx4YCtnCO4F4rA gnvQB4MTXig3.wTQPJqZX1ZgiVLAqotxan7mIDTqnDh4BsWrD1GHXV_iFnNOCh51mG3UcwMc8QSi Wzc6lOGO8Xwo3fS9dKCBKGq2xdXILJe00wb2KOBYtBF8SE4NhWV77TIvQXU8y5.RnSppIxQZ.q.9 HoPLUjhJvslMYR2MVM9OMsjkOgvIDBR7AY3mQ9QAe6e.fuJUZaS_uhY842D6Y18cujJprdvp.ZH4 pNiIRPr3h7C.njwULZ_9j.uFw2NXjUt3kicMYjy.au0M1XP_fnOzRw_BauFP2xKevyEAjrjsH5AP QoRgu6btIV7JM3LD5_Urb1nZaeQZvoC4Vc1p1y67QWQdA3WDOKo7rmv7xlTsgdGBi4ZCpjMbEKaK qri6RnVj8y9o_pV1w.m0t_ABBzfY1F.X1d1XatOD5HX.jVIUL4ATS6gqD.tU0yR0Ew7yVnLAqs4k JVtWjDtdaIg..u7NUJSm4UYygbq09AZ37vw__SYja4W6Lo6oLjE45riGlkl2V_yZ6p3sGgCt.Zkh LlyVAACJroDwFAr73ZGfSgBwo151VQp46R5bNzF04aZCtCsCNoq6PLcLePU0bHK1wm2jYKcSm35O pobBK_svPCshKaFhTqXMIwL9EE.jN8WKRrRaeEl1Sy0YejvrQ7jzpDk938sx84LwNKpJJP1fZmmp UZprTm2AG2pl.REHAp7_489AqXCjG765RjfFcU__hP9Vd7f5SHJ35NyVvqe5MNJA.0GERcayH5ig 2BnNtTt7ZzDuqsynnX2eSSpE- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Thu, 23 Apr 2020 19:15:04 +0000 Received: by smtp431.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 032f4c63dbb0dce5d98e4e8540eb629a; Thu, 23 Apr 2020 19:14:58 +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: <20200423162124.GA3583@www.zefox.net> Date: Thu, 23 Apr 2020 12:14:57 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <9C2E0F98-AF80-4105-B109-B4767AE53FFF@yahoo.com> References: <20200421181224.GC96994@www.zefox.net> <20200423162124.GA3583@www.zefox.net> To: bob prohaska X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 497Rp16wx7z4DDr X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.23 / 15.00]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; 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)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.78)[-0.776,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.954,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.89), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.67), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[148.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[148.68.137.98.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2] 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: Thu, 23 Apr 2020 19:15:08 -0000 On 2020-Apr-23, at 09:21, bob prohaska wrote: > On Wed, Apr 22, 2020 at 10:28:29PM +0200, Georg Lindenberg wrote: >>=20 >> Uboot will run bootcmd, unless you hit a key. Then it will enter the = shell. >>=20 >> You can track down bootcmd (env print bootcmd): >>=20 >> bootcmd=3Ddistro_bootcmd >> distro_bootcmd=3Dfor target in ${boot_targets}; do run = bootcmd_${target} >> boot_targets=3Dmmc0 mmc1 usb0 pxe dhcp >>=20 >> So, in this loop, usb0 is in third place. :-/ mmc will boot first. >>=20 >> U-Boot> env print bootcmd_usb0 >> bootcmd_usb0=3Ddevnum=3D0; run usb_boot >>=20 >=20 > For some reason I can't use run usb_boot, it's necessary to use > U-Boot> usb reset > resetting USB... > Bus usb@7e980000: scanning bus usb@7e980000 for devices... 8 USB = Device(s) found > scanning usb for storage devices... 1 Storage Device(s) found > U-Boot> run bootcmd_usb0 >=20 > Device 0: Vendor: Initio Rev: 1.06 Prod: MHT2040AH =20 > Type: Hard Disk > Capacity: 38154.3 MB =3D 37.2 GB (78140160 x 512) > ... is now current device > Scanning usb 0:1... > Found EFI removable media binary efi/boot/bootaa64.efi > libfdt fdt_check_header(): FDT_ERR_BADMAGIC > Scanning disk mmc@7e300000.blk... > Scanning disk usb_mass_storage.lun0... I ignore the above and start below. > Found 6 disks > BootOrder not defined > ^^^^^^^^^^^^^^^^^^^^^ this is trouble if it includes microsd devices My context has the msdosfs/EFI materials and FreeBSD loader.conf and kernel materials on the microsd card and a gpt partitioned USB SSD with the ufs file sytem on USB (loader.conf directs it there). I'll note things that you marked and how they look in my microsd card based. For the above: Found 7 disks BootOrder not defined I expect that the RPi3 set things up so a microsd card "wins" when present, even without the u-boot BootOrder definition being present. > EFI boot manager: Cannot load any image > ^^^^^^^^^^^^^^^^^^^^^ more bad news EFI boot manager: Cannot load any image So the same as you get for your USB-only experiments. > 687984 bytes read in 402 ms (1.6 MiB/s) > libfdt fdt_check_header(): FDT_ERR_BADMAGIC > ^^^^^^^^^^^^^^^^ not sure about this libfdt fdt_check_header(): FDT_ERR_BADMAGIC So the same as you get for your USB-only experiments. > Next comes a couple screens of linefeeds, then: My binary capture of the serial stream shows escape sequences with [2J [2J and then lots of [?25h interlaced with what follows (for some distance). There are also sub-sequences of a repeating |/-\ sequence mixed in at various points. I'll omit such. > Consoles: EFI console =20 >=20 > Reading loader env vars from /efi/freebsd/loader.env > Setting currdev to disk1p1: =1BS=1Be=1Bt=1Bt=1Bi=1Bn=1Bg=1B =1Bc=1Bu=1Br=1Br=1Bd=1Be=1Bv=1B =1Bt=1Bo=1B= =1Bd=1Bi=1Bs=1Bk=1B0=1Bp=1B1=1B:=1B So that is from the microsd card in my context. > FreeBSD/arm64 EFI loader, Revision 1.1 > (Thu Apr 16 06:59:37 UTC 2020 root@releng1.nyi.freebsd.org) I do not get the above line's content. > Command line arguments: loader.efi > Image base: 0x39e91000 The detailed figures is different in my context. I'll not list it. > EFI version: 2.80 > EFI Firmware: Das U-Boot (rev 8217.4096) > Console: comconsole (0) > Load Path: /efi\boot\bootaa64.efi > Load Device: = /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x0)= /UsbClass(0x424,0x9514,0x9,0x0,0x2)/UsbClass(0x2109,0x2811,0x9,0x0,0x1)/Us= bClass(0x13fd,0x1040,0x0,0x0,0x0)/HD(1,0x01,0,0x81f,0x18fa8) > Trying ESP: = /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x0)= /UsbClass(0x424,0x9514,0x9,0x0,0x2)/UsbClass(0x2109,0x2811,0x9,0x0,0x1)/Us= bClass(0x13fd,0x1040,0x0,0x0,0x0)/HD(1,0x01,0,0x81f,0x18fa8) I'll not show the long lines for the microsd card here. > Setting currdev to disk1p1: S=1Be=1Bt=1Bt=1Bi=1Bn=1Bg=1B =1Bc=1Bu=1Br=1Br=1Bd=1Be=1Bv=1B =1Bt=1Bo=1B = =1Bd=1Bi=1Bs=1Bk=1B0=1Bp=1B1=1B:=1B (So the microsd card device.) > Trying: = /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x0)= /UsbClass(0x424,0x9514,0x9,0x0,0x2)/UsbClass(0x2109,0x2811,0x9,0x0,0x1)/Us= bClass(0x13fd,0x1040,0x0,0x0,0x0)/HD(2,0x01,0,0x197c7,0x4a6bb39) > Setting currdev to disk1p2: (Another long line then:) =1BS=1Be=1Bt=1Bt=1Bi=1Bn=1Bg=1B =1Bc=1Bu=1Br=1Br=1Bd=1Be=1Bv=1B =1Bt=1Bo=1B= =1Bd=1Bi=1Bs=1Bk=1B0=1Bp=1B2=1B:=1B There are no long lines or references to the USB SSD that is present in my context: no examples if disk1p*: matches. Probably because of the gpt partitioning on that drive (and lack of any msdos like file systems). > Loading /boot/defaults/loader.conf > Loading /boot/device.hints > Loading /boot/loader.conf > Loading /boot/loader.conf.local > Loading kernel... > /boot/kernel/kernel text=3D0x9b804c data=3D0x192958 data=3D0x0+0x3a21fe = syms=3D[0x8+0x10f740+0x8+0x134f85] The detailed figures are different in my context. I'll not list them. > Loading configured modules... > /boot/kernel/umodem.ko text=3D0x2100 text=3D0x1390 data=3D0x6e0+0x10 = syms=3D[0x8+0xf48+0x8+0xb6e] The detailed figures are different in my context. I'll not list them. > can't find '/boot/entropy' I have a /boot/entropy file setup that is working so I got: /=1Bb=1Bo=1Bo=1Bt=1B/=1Be=1Bn=1Bt=1Br=1Bo=1Bp=1By=1B = =1Bs=1Bi=1Bz=1Be=1B=3D=1B0=1Bx=1B1=1B0=1B0=1B0=1B > Hit [Enter] to boot immediately, or any other key for command prompt. >=20 >=20 > Type '?' for a list of commands, 'help' for more detailed help. >=20 >=20 > It's unclear where the kernel loaded from, Given the lack of references to any disk0p*: in your sequence, yours came from the USB drive. And if there is only one kernel instance there, it came from that copy. > but at this point a=20 > listing of /boot reports the files on the USB disk, not microSD. > The image is from a 12.1 snapshot. /firstboot has been renamed > no.firstboot, might that be significant?=20 >=20 > It looks as if loader is confused about what disk it's on: >=20 > OK show rootdev > variable 'rootdev' not found > OK=20 Type '?' for a list of commands, 'help' for more detailed help. OK show rootdev variable 'rootdev' not found OK=20 So this appears to be normal for microsd card use as well. > Running show reports, among many other things: > currdev=3Ddisk1p2: > kernel=3Dkernel > kernel_options=3D > kernel_path=3D/boot/kernel > kernelname=3D/boot/kernel/kernel > kernels_autodetect=3DYES > loaddev=3Ddisk1p2: > ^ the colon looks a little odd currdev=3Ddisk0p2: kernel=3Dkernel kernel_options=3D kernel_path=3D/boot/kernel kernelname=3D/boot/kernel/kernel kernels_autodetect=3DYES loaddev=3Ddisk0p2: So this appears to be normal for microsd card use and your is analogous for USB drive use (when there is only one USB drive present). > The loaddev would make sense if mmcsd is device 0, I'm not sure that's = true. "disk0" is apparently reserved for the microsd card slot media, even when there is no media there. "disk1" for the USB disk (when there is only one). "disk1", "disk2", . . . when there are multiple USB disks. The binding of each to which disk might not be stable or might track which USB connection point was used or some such. I've not tested. > What's the simplest way to inform loader on the usb device it's = actually > _on_ the usb device. I've tried setting rootdev=3Dda0s2a, didn't work. da0s2a is FreeBSD notation. This appears to be too early for that and is using a different "name space" that has "diskNpM:" notation. Your disk0p2: is what turns into da0s2 or da0s2a in FreeBSD. This is another stage where having multiple USB drives might not have a stable binding to daN naming. such is one of the reasons that using labeling for identification is recommended: Identification my referencing unique content set up for the purpose. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)