summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2023-12-13 17:50:24 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2023-12-13 17:50:24 +0000
commit64f2f29e43834ec3a7dd4ca24c36b2f2781f0bfe (patch)
tree4259b94f62c7c2d62c3e30187c151bf21efc4a80 /usr.sbin
parent918a6b9e436f91c2332228d5cfa3dcb15ac539e6 (diff)
Match what reorder_kernel is doing and use kern.osversion to find out whether
we are running an MP kernel or not. based on a reworked submission from kris at devtty dot one via deraadt@ input and ok robert@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syspatch/syspatch.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 4eacb6205e0..b825d96b393 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.167 2020/12/07 21:19:28 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.168 2023/12/13 17:50:23 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -34,7 +34,7 @@ usage()
apply_patch()
{
- local _edir _file _files _patch=$1 _rc=0 _s _upself=false
+ local _edir _file _files _kernel _patch=$1 _rc=0 _s _upself=false
[[ -n ${_patch} ]]
_edir=${_TMP}/${_patch}
@@ -45,7 +45,8 @@ apply_patch()
echo "Installing patch ${_patch##${_OSrev}-}"
install -d ${_edir} ${_PDIR}/${_patch}
- (($(sysctl -n hw.ncpufound) > 1)) &&
+ _kernel=$(sysctl -n kern.osversion)
+ [[ ${_kernel%#*} == "GENERIC.MP" ]] &&
_s="-s @usr/share/relink/kernel/GENERIC/.*@@g" ||
_s="-s @usr/share/relink/kernel/GENERIC.MP/.*@@g"
_files="$(tar -xvzphf ${_TMP}/syspatch${_patch}.tgz -C ${_edir} \