On 2022-02-28 06:30 -08, Andrew Hewus Fresh <and...@afresh1.com> wrote: > On Mon, Feb 28, 2022 at 08:27:13AM +0100, Florian Obser wrote: >> On 2022-02-27 21:33 -08, Andrew Hewus Fresh >> <afre...@zarniwoop.home.hewus.com> wrote: >> > So, sdk@ noticed that sysupgrade didn't get updated for the new logic in >> > the firmware directories. Specifically that the only time we use >> > "snapshots" directory is with -current. The rest of the time, including >> > during -beta we use the version directory. This diff should handle that >> > case, installing the correct firmware for the system we are about to >> > install. >> > >> > This also uses a secret feature of fw_update(8) where if you set "VNAME" >> > in the environment, it uses that instead of asking sysctl to calculate >> > the name of the signify key to use. Probably that could use an >> > improvement, maybe trusting the untrusted comment at the top of the >> > file.. >> > >> > I'm not sure if there's a better way to find the version string from a >> > bsd kernel, so I used the one I knew about. >> >> I think you can just look at _KERNV which is populated thusly: >> >> >> 98 set -A _KERNV -- $(sysctl -n kern.version | >> 99 sed 's/^OpenBSD \([1-9][0-9]*\.[0-9]\)\([^ ]*\).*/\1 >> \2/;q') >> >> $ sysctl kern.version >> kern.version=OpenBSD 7.0-current (GENERIC.MP) #370: Sat Feb 19 10:36:59 MST >> 2022 >> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP >> >> $ set -A _KERNV -- $(sysctl -n kern.version | >> > sed 's/^OpenBSD \([1-9][0-9]*\.[0-9]\)\([^ ]*\).*/\1 \2/;q') >> >> $ echo ${_KERNV[1]} >> -current > > > I don't think so, that is the running kernel, I need the version of the > _new_ kernel. Imagine this situation:
Oh, I missed that bit. There is what(1): $ what bsd bsd: OpenBSD 7.1-beta (GENERIC) #368: Sun Feb 27 20:02:50 MST 2022 -- I'm not entirely sure you are real.