diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2024-06-15 15:05:16 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2024-06-15 15:05:16 +0000 |
commit | 3e0095641cc79b5fcb73ae14ac7697cd67c27b4f (patch) | |
tree | 72cbde2aac07562e77409ac34522cc95b10ae869 | |
parent | 8b3aeb2350fb4e5392eaf7718e0f8e9b9ded1187 (diff) |
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.
-rw-r--r-- | distrib/miniroot/install.sub | 8 |
1 files 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 <rpe@openbsd.org> @@ -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* ]] && |