From owner-freebsd-stable@freebsd.org Fri Feb 19 22:30:10 2021 Return-Path: Delivered-To: freebsd-stable@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 62D72542944 for ; Fri, 19 Feb 2021 22:30:10 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [199.15.120.13]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dj5qj3SX6z3hXk; Fri, 19 Feb 2021 22:30:09 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (draco.over-yonder.net [IPv6:2001:470:1f0f:11ae::5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 4Dj5qY5JLPz1xf; Fri, 19 Feb 2021 16:30:01 -0600 (CST) Received: by draco.over-yonder.net (Postfix, from userid 100) id 4Dj5qY1GQFz3Xw; Fri, 19 Feb 2021 16:30:01 -0600 (CST) Date: Fri, 19 Feb 2021 16:30:01 -0600 From: "Matthew D. Fuller" To: Kurt Jaeger Cc: Warner Losh , David Marec , freebsd-stable Subject: Re: FreeBSD 13/stable and zpool upgrade Message-ID: References: <7c9810fe-6960-0ec7-cab3-2f0c344471f4@lapinbilly.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/2.0.5 (2021-01-21) X-Rspamd-Queue-Id: 4Dj5qj3SX6z3hXk X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of fullermd@over-yonder.net designates 199.15.120.13 as permitted sender) smtp.mailfrom=fullermd@over-yonder.net X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[over-yonder.net]; ARC_NA(0.00)[]; SPAMHAUS_ZRD(0.00)[199.15.120.13:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RBL_DBL_DONT_QUERY_IPS(0.00)[199.15.120.13:from]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:33069, ipnet:199.15.120.0/22, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2021 22:30:10 -0000 On Fri, Feb 19, 2021 at 10:26:15PM +0100 I heard the voice of Kurt Jaeger, and lo! it spake thus: > > We do not need it automated. We need it to be described in enough > detail that we can write that BOOTx64.efi to the proper place. If > there are some steps to find out where to write it etc., fine. > Describe those steps. As a data point, years ago I started dropping a rewrite-bootcode.sh script in /boot on all my systems, 'cuz I could never offhand remember how to do it so I kept putting it off. And I updated a variant of it for EFI. e.g., on one system BIOS-booting system, /boot/rewrite-bootcode.sh: ---------------------------------- #!/bin/sh -x for i in /dev/nda0 /dev/nda1; do gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${i} done ---------------------------------- And on an EFI system, ---------------------------------- #!/bin/sh -ex bd="/mnt/EFI/BOOT" for i in gpt/efi0 gpt/efi1; do mount -t msdosfs /dev/${i} /mnt cp /boot/boot1.efi ${bd}/BOOTX64.EFI echo "BOOTX64.EFI" > ${bd}/STARTUP.NSH umount /mnt done ---------------------------------- Another variant I have on my workstation (which doesn't EFI boot 'cuz DRM, but can, so I'm pretty sure the script works right), --------------------------------- #!/bin/sh cd `dirname $0` SRC="loader.efi" for i in 0 1; do mount /mnt/efi${i} DSTDIR="/mnt/efi${i}/efi/boot" mkdir -p ${DSTDIR} DST="${DSTDIR}/BOOTx64.efi" if(!(cmp ${SRC} ${DST})); then echo "$DST: Updating" cp -p ${SRC} ${DST} else echo "${DST}: Up to date already" fi umount /mnt/efi${i} done --------------------------------- % grep efi /etc/fstab /dev/gpt/nefi0 /mnt/efi0 msdosfs rw,noauto,-g0,-m770 0 0 /dev/gpt/nefi1 /mnt/efi1 msdosfs rw,noauto,-g0,-m770 0 0 --------------------------------- (and yes, when I wrote these, just _figuring_ _out_ WTF EFI wanted and where it wanted it was _incredibly_ frustrating...) Of course, those all take manual setup for each system, to know the devices or labels, and with EFI, to either manually mount or setup fstab entries for whatever partition[s] apply. But at least I get to do it once, when I setup the system, and presumably know what I just did, rather than trying to remember years later while sitting at the console of a system I need to finish the update of and get back up and running. This way I know I can just `cd /boot ; ./rew` after installworld and be done with it :) -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.