summaryrefslogtreecommitdiff
path: root/distrib/miniroot/install.sub
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-06-21 23:54:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-06-21 23:54:20 +0000
commitc9c83e973c35038d88e6b2f57642d842a8085616 (patch)
tree9301686448d5f95c8bc9394fdd5c37e7e6f0db84 /distrib/miniroot/install.sub
parente16d0ddbfb11715a0335d172965c10c5ee7eb21d (diff)
/var/db/kernel.SHA256 contains the hash of the /bsd kernel. Upon
install or upgrade, set it correctly. diff from rpe, also thanks tb for comments and review
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r--distrib/miniroot/install.sub10
1 files changed, 9 insertions, 1 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 56f460a655a..10443970bf2 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1014 2017/06/03 22:27:41 deraadt Exp $
+# $OpenBSD: install.sub,v 1.1015 2017/06/21 23:54:19 deraadt Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -2633,6 +2633,14 @@ finish_up() {
mv /mnt/bsd.mp /mnt/bsd
fi
+ # Create/update kernel.SHA256 matching the just installed kernel.
+ # Fix path in kernel.SHA256 to ensure it references the kernel as /bsd.
+ (
+ umask 077
+ sha256 -h /mnt/var/db/kernel.SHA256 /mnt/bsd
+ sed -i 's,(/mnt,(,' /mnt/var/db/kernel.SHA256
+ )
+
# Ensure that sysmerge in batch mode is run on reboot.
[[ $MODE == upgrade ]] &&
echo "/usr/sbin/sysmerge -b" >>/mnt/etc/rc.sysmerge