From c48f8ce892c26060b5ee64e6d6bccd7d2d138c3d Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 15 Jun 2024 15:05:15 +0000 Subject: [PATCH] Install BUILDINFO if available. We already keep /var/db/installed.SHA256 for sysupgrade(8) as a cheap check to not install the same snapshot over and over again. With /mnt/var/db/installed.BUILDINFO we can ensure that we are not installing an older snapshot over a newer snapshot. Intentionally not yet committing the sysupgrade(8) bits so that we exercise the sysupgrade(8) / install.sub interaction as it will happen during the 7.5 -> 7.6 transition. I.e. a newer install.sub getting installed by an older sysupgrade(8). deraadt@ likes it. --- distrib/miniroot/install.sub | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 28144871bca..d73b8037210 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1264 2024/05/12 19:47:14 kn Exp $ +# $OpenBSD: install.sub,v 1.1265 2024/06/15 15:05:15 florian Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -1664,7 +1664,8 @@ install_files() { _get_sets=$resp # Reorder $_get_sets. - _get_sets=$(for s in $ALLSETS; do isin "$s" $_get_sets && echo $s; done) + _get_sets=$(for s in $ALLSETS; do isin "$s" $_get_sets && echo $s; done; + isin "BUILDINFO" $_files && echo "BUILDINFO") # Note which sets didn't verify ok. _unver=$_get_sets @@ -1808,6 +1809,9 @@ install_files() { tar -zxphf - -C /mnt fi ;; + *BUILDINFO) $_unpriv ftp -D Installing -Vmo - "$_fsrc" \ + > "/mnt/var/db/installed.$_f" + ;; *) # Make a backup of the existing ramdisk kernel in the # bsd.rd only download/verify/install case. $UPGRADE_BSDRD && [[ $_f == bsd.rd* ]] && -- 2.20.1