From nobody Sun Apr 10 03:39:06 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9DCAA1A9AEED for ; Sun, 10 Apr 2022 03:39:13 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (www.zefox.net [50.1.20.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "www.zefox.com", Issuer "www.zefox.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kbd5D3ycRz4YjH for ; Sun, 10 Apr 2022 03:39:12 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (localhost [127.0.0.1]) by www.zefox.net (8.16.1/8.15.2) with ESMTPS id 23A3d7EX057467 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 9 Apr 2022 20:39:07 -0700 (PDT) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.16.1/8.15.2/Submit) id 23A3d7FF057466; Sat, 9 Apr 2022 20:39:07 -0700 (PDT) (envelope-from fbsd) Date: Sat, 9 Apr 2022 20:39:06 -0700 From: bob prohaska To: Mark Millard Cc: freebsd-arm@freebsd.org, bob prohaska Subject: Re: Updating RPi boot materials, was Re: RPI4 panic on boot with -current Message-ID: <20220410033906.GA57250@www.zefox.net> References: <20220409015321.GA52002@www.zefox.net> <20220409154433.GB55458@www.zefox.net> <1B2DD49C-96AD-4586-B9A7-F6D8386D4DE0@yahoo.com> <20220409221742.GB56550@www.zefox.net> <05CFCC3A-EE32-468A-9BDD-9A6104F572EE@yahoo.com> List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Kbd5D3ycRz4YjH X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of fbsd@www.zefox.net has no SPF policy when checking 50.1.20.27) smtp.mailfrom=fbsd@www.zefox.net X-Spamd-Result: default: False [0.29 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; WWW_DOT_DOMAIN(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.981]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zefox.net]; AUTH_NA(1.00)[]; R_SPF_NA(0.00)[no SPF record]; NEURAL_SPAM_MEDIUM(0.37)[0.373]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MLMMJ_DEST(0.00)[freebsd-arm]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7065, ipnet:50.1.16.0/20, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_WWW(0.50)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Apr 09, 2022 at 05:22:49PM -0700, Mark Millard wrote: > > > So how are pkg or other such to deal with updating such generally > > bootable media? I don't think they can be expected to update alien media. There are lots of platform-specific ports for u-boot. Why not match the install target to the named platform? If folks go to the trouble of creating a port for a platform it's little extra work to add the pathnames. What you're talking about seems far more ambitious. > > I should have explicitly noted: How likely is that that I'd happen > to always do FreeBSD updates on a aarch64 RPi* instead of one of > the other systems, especially the faster ones? Is pkg to notice and > update RPi* boot materials because the updated system could also > boot an aarch64 RPi*? > Presumably you'd cross compile a package for the intended target and then install the package on the running target. The platform details would be part of the package. If the target is RPi3 and you're compiling on Cavium, the RPi3 paths would be part of the package. The Cavium won't be running the pkg install, but I don't think that's possible in any case. Both pkg and make install work on the host they're running on, no? > This better illustrates what I'm referring to when I reference pkg > and the like identifying contexts and handling a variety of them. > Should it be checking if it happens to be running on a RPi* and > behave differently than it would on other types of systems (same > boot media)? > That's the admin's discretion. He knows what the target architecture is and the media being written. > > Or: Say that the RPi* has a msdosfs on its USB device that is > > able to be used for booting. But that, at the time, there is > > also a microsd card present that capable of being used for > > booting, at least for the RPi* firmware and u-boot.bin stages. > > What sort of activity is pkg supposed to do to identify the > > context? How would pkg even identify, say, which way FreeBSD > > had been booted? > > I'd suggest this is an unrealistic scenario. Pkg can know what files it's supposed to update, the admin has to make those files accessible. If the wrong paths are mounted, that's a wetware problem. > > The early stages of RPi* booting are outside FreeBSD's direct > > control and there are a lot of possibilities. > > Yes, too many. The admin has to constrain them. > > Nothing in FreeBSD says that /boot/msdos should exist or be the > > mount point used as far as I know. It is just something that the > > snapshot/PRERELEASE/BETA/RC/RELEASE images happen to currently, > > do by the free choice of the author(s) involved. > > But it does exist and is useful. Why not use it? > > In fact, if you tried to use bsdinstall to set up a RPi* > > context, it would not set up something like the > > snapshots/PRERELEASEs/BETAs/RCs/RELEASEs as far as I > > know. > > Can it work at all? I always prefered the installer whose man page said it was "greaty in need of death". > > Nothing says that RPi*'s have to be set up the same as the > > snapshot/PRERELEASE/BETA/RC/RELEASE images. The potential > > differences in question are not part of FreeBSD. > > But in practice they are, and it's useful for most folks. > > Another common convention is /boot/efi (especially when the > > msdosfs invovled has the FreeBSD efi boot loader as well). > > FreeBSD does now have some predefined behavior for this > > convention. > > Curiously, my Pi4 has an empty /boot/efi, but I've never tampered with it. > > What if nothing is mounted to /boot/msdos or to /boot/efi > > at the time (say, disabled in /etc/fstab)? How much analysis > > of the context is pkg or such to do and adjust for? > > Just report "path not found" and list what was expected. > > The FreeBSD loader.efi has the same sort of "there is no > > fixed place for it" issue. Other than the /boot/efi use, > > there is no automatic update of loader.efi either. This is > > largely because the copy used to boot is not in a FreeBSD > > UFS/ZFS file system at all --but in some msdosfs file > > system, possibly with a special partition type. > My plea is not for adaptability, but acceptance of convention. Identify a platform and a location then put that info in the port install target. Let convention be set by the image. If you got this far, thanks for reading! bob prohaska