summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-04-19 17:56:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-04-19 17:56:04 +0000
commit8ed5d59c554077f36ecf88a31ba5169f6777c709 (patch)
tree9a6cece5666e8f7ce5909f9a299640a8f6d10846
parent90fdb320e64210bdbea1cbe460e0fd5a61de71ad (diff)
If hw.ncpufound > 1, have the install script automatically prefer to use
bsd.mp instead of bsd (using -- mv bsd bsd.sp; mv bsd.mp bsd). anyone who brings up boot.conf is an i386 bigot. tested on almost all platforms that can do this, ok various people
-rw-r--r--distrib/miniroot/install.sh10
-rw-r--r--distrib/miniroot/install.sub5
-rw-r--r--distrib/special/sysctl/sysctl.c4
3 files changed, 16 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 4dcc109433e..c3843d22739 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sh,v 1.167 2009/04/13 02:22:12 krw Exp $
+# $OpenBSD: install.sh,v 1.168 2009/04/19 17:56:01 deraadt Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -348,6 +348,14 @@ IFS=$_oifs
install_sets
+if [ -f /mnt/bsd.mp -a -f /mnt/bsd ]; then
+ if [ $(sysctl -n hw.ncpufound) -gt 1 ]; then
+ echo "Multiprocessor machine; using bsd.mp automatically."
+ mv /mnt/bsd /mnt/bsd.sp
+ mv /mnt/bsd.mp /mnt/bsd
+ fi
+fi
+
# Remount all filesystems in /etc/fstab with the options from /etc/fstab, i.e.
# without any options such as async which may have been used in the first
# mount.
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 9a6053529bd..23a2d7adfc0 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.464 2009/04/19 00:59:39 deraadt Exp $
+# $OpenBSD: install.sub,v 1.465 2009/04/19 17:56:01 deraadt Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2007 Todd Miller, Theo de Raadt, Ken Westerback
@@ -1676,6 +1676,9 @@ md_consoleinfo
# the contents of the other sets, not the other way around.
THESETS="bsd bsd.rd bsd.mp $MDSETS"
DEFAULTSETS="bsd bsd.rd"
+if [ $(sysctl -n hw.ncpufound) -gt 1 ]; then
+ DEFAULTSETS="$DEFAULTSETS bsd.mp"
+fi
for _set in base etc misc comp man game xbase xetc xshare xfont xserv site ; do
[[ $MODE == upgrade && ( $_set == etc || $_set == xetc ) ]] && continue
THESETS="$THESETS ${_set}${VERSION}.tgz"
diff --git a/distrib/special/sysctl/sysctl.c b/distrib/special/sysctl/sysctl.c
index 37be17a0a8b..1cd898c421f 100644
--- a/distrib/special/sysctl/sysctl.c
+++ b/distrib/special/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.2 2009/04/19 00:59:39 deraadt Exp $ */
+/* $OpenBSD: sysctl.c,v 1.3 2009/04/19 17:56:03 deraadt Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt <deraadt@openbsd.org>
@@ -37,6 +37,8 @@ int pint(struct var *);
struct var vars[] = {
{ "hw.disknames", pstring, 2,
{ CTL_HW, HW_DISKNAMES }},
+ { "hw.ncpufound", pint, 2,
+ { CTL_HW, HW_NCPUFOUND }},
};
int nflag;