There is a small window of mixed version sets at the newvers tagging
from release to beta, likely due to the way currently mirrors are
clearing the previous and syncing during that automatically (not
signalled).  There will be another one from beta to release and new
version for snaps too.

At these times sysupgrade(8) picks the old sets from partial
incompletely "deleted" version sets breaking the snapshot upgrades,
instead of the latter correct new version ones which are a complete

This results in failure to upgrade to a valid snapshot on the mirrors,
and users having to wait a new snapshot fanout without mixed sets and
checksum files containing both versions (incompletely the older).

It can be fixed by adjusting the sysupgrade(8) script to narrow the
sets version to the current new version of the snapshot sets.

Here is how it looks on the mirrors during that period:

before (contains one version, normal)

during (two versions, older incomplete, picked and failing)

after (one version again, normal)

during (same as i386, probably affecting other arches too)

The script uses SHA256 for picking up the list of sets, and it picks
the incomplete one and fails.  With the change it picks the complete
one and finishes successfully.  I have not tested on newvers rolling
locally, so try to proof-reason about it yourself too.

Let me know if you need clarification around the beta release / snap
conditions or the logic of the proposed change, adjust accordingly /
test as you will.  Pardon the primitive diff-ing by hand.

Here is the proposed narrowing version sets as a unified diff:

$ diff -u $(dirname `which sysupgrade`)/sysupgrade{,.nv}

--- /usr/sbin/sysupgrade  Tue Sep 26 13:35:56 2023
+++ /usr/sbin/sysupgrade.nv   Tue Sep 26 13:36:14 2023
@@ -121,7 +121,11 @@
 if $RELEASE && [[ ${_KERNV[1]} == '-beta' ]]; then
+    if ! $SNAP; then
    NEXT_VERSION=$(echo ${_KERNV[0]} + 0.1 | bc)
+    else
+    fi

 if $SNAP; then
@@ -136,9 +140,12 @@
 echo "Fetching from ${URL}"
 unpriv -f SHA256.sig ftp -N sysupgrade -Vmo SHA256.sig ${URL}SHA256.sig


 read _LINE <SHA256.sig
 case ${_LINE} in
 *\ ${_KEY})    SIGNIFY_KEY=/etc/signify/${_KEY} ;;
@@ -156,9 +163,9 @@
    exit 0

-# INSTALL.*, bsd*, *.tgz
+# INSTALL.*, bsd*, *${_NV}.tgz
 SETS=$(sed -n -e 's/^SHA256 (\(.*\)) .*/\1/' \
-    -e '/^INSTALL\./p;/^bsd/p;/\.tgz$/p' SHA256)
+    -e '/^INSTALL\./p;/^bsd/p;/'${_NV}'\.tgz$/p' SHA256)


Reply via email to