diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-04-24 01:04:34 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-04-24 01:04:34 +0000 |
commit | 699609200788a70f7a6343856ec4cc6aa56ff488 (patch) | |
tree | 014670ea7de707c466e946f8fd6c640a9e23aacb /distrib | |
parent | ccc7dc43c676d792468c3679070f1e8752d5267e (diff) |
Move bsd.mp juggling into relevant MD files. Make bsd.mp a default
selection on multi-processor machines. Make bsd.mp a sanity check
item on multi-processor machines.
ok deraadt@
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/amd64/common/install.md | 13 | ||||
-rw-r--r-- | distrib/i386/common/install.md | 13 | ||||
-rw-r--r-- | distrib/macppc/ramdisk/install.md | 13 | ||||
-rw-r--r-- | distrib/miniroot/install.sh | 10 | ||||
-rw-r--r-- | distrib/miniroot/install.sub | 10 | ||||
-rw-r--r-- | distrib/mvme88k/ramdisk/install.md | 13 | ||||
-rw-r--r-- | distrib/sparc64/common/install.md | 13 |
7 files changed, 65 insertions, 20 deletions
diff --git a/distrib/amd64/common/install.md b/distrib/amd64/common/install.md index ad6a118b668..fc02e35c3ed 100644 --- a/distrib/amd64/common/install.md +++ b/distrib/amd64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.13 2009/04/12 12:56:01 krw Exp $ +# $OpenBSD: install.md,v 1.14 2009/04/24 01:04:33 krw Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -34,8 +34,19 @@ MDXAPERTURE=2 ARCH=ARCH +NCPU=$(sysctl -n hw.ncpufound) + +((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { + cd /mnt + if [[ -f bsd.mp ]] && ((NCPU > 1)); then + echo "Multiprocessor machine; using bsd.mp instead of bsd." + mv bsd bsd.sp 2>/dev/null + mv bsd.mp bsd + ln -sf bsd bsd.mp + fi + echo Installing boot block... cp /usr/mdec/boot /mnt/boot /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot ${1} diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md index 8e6f0860e36..0b4764c2898 100644 --- a/distrib/i386/common/install.md +++ b/distrib/i386/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.36 2009/04/12 12:56:02 krw Exp $ +# $OpenBSD: install.md,v 1.37 2009/04/24 01:04:33 krw Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -34,8 +34,19 @@ MDXAPERTURE=2 ARCH=ARCH +NCPU=$(sysctl -n hw.ncpufound) + +((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { + cd /mnt + if [[ -f bsd.mp ]] && ((NCPU > 1)); then + echo "Multiprocessor machine; using bsd.mp instead of bsd." + mv bsd bsd.sp 2>/dev/null + mv bsd.mp bsd + ln -sf bsd bsd.mp + fi + echo Installing boot block... # LBA biosboot uses /boot's i-node number. Using 'cat' preserves that # number, so multiboot setups (NTLDR) can work across upgrades. diff --git a/distrib/macppc/ramdisk/install.md b/distrib/macppc/ramdisk/install.md index 6568cccc189..446a8140d20 100644 --- a/distrib/macppc/ramdisk/install.md +++ b/distrib/macppc/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.38 2009/04/12 12:56:02 krw Exp $ +# $OpenBSD: install.md,v 1.39 2009/04/24 01:04:33 krw Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -34,10 +34,21 @@ MDXAPERTURE=2 ARCH=ARCH +NCPU=$(sysctl -n hw.ncpufound) + +((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { local _disk=$1 + cd /mnt + if [[ -f bsd.mp ]] && ((NCPU > 1)); then + echo "Multiprocessor machine; using bsd.mp instead of bsd." + mv bsd bsd.sp 2>/dev/null + mv bsd.mp bsd + ln -sf bsd bsd.mp + fi + [[ $disklabeltype == MBR ]] || return echo -n "Copying 'ofwboot' to the boot partition (${_disk}i)..." diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index abcaab3263d..f800c88b60b 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sh,v 1.170 2009/04/23 23:16:34 deraadt Exp $ +# $OpenBSD: install.sh,v 1.171 2009/04/24 01:04:33 krw 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 @@ -335,14 +335,6 @@ _rootpass="$_password" 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 37a1aca1f41..0780e5aad7e 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.472 2009/04/24 00:15:21 sthen Exp $ +# $OpenBSD: install.sub,v 1.473 2009/04/24 01:04:33 krw 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 @@ -1642,6 +1642,7 @@ finish_up() { cd / md_installboot $ROOTDISK + cd / populateusrlocal @@ -1707,10 +1708,7 @@ md_consoleinfo # Ensure that siteXX.tgz is the *last* set listed so its contents overwrite # 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 +: ${DEFAULTSETS:="bsd bsd.rd"} 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" @@ -1719,7 +1717,7 @@ for _set in base etc misc comp man game xbase xetc xshare xfont xserv site ; do done # Since etc${VERSION}.tgz is not in DEFAULTSETS for upgrades, it can always be # in SANESETS. -SANESETS="bsd base${VERSION}.tgz etc${VERSION}.tgz" +SANESETS="${SANESETS:-bsd} base${VERSION}.tgz etc${VERSION}.tgz" # decide upon an editor : ${EDITOR:=ed} diff --git a/distrib/mvme88k/ramdisk/install.md b/distrib/mvme88k/ramdisk/install.md index a1d7677ba32..158fbde1a0a 100644 --- a/distrib/mvme88k/ramdisk/install.md +++ b/distrib/mvme88k/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.30 2009/04/12 12:56:02 krw Exp $ +# $OpenBSD: install.md,v 1.31 2009/04/24 01:04:33 krw Exp $ # Copyright (c) 1996 The NetBSD Foundation, Inc. # All rights reserved. # @@ -33,8 +33,19 @@ MDTERM=vt100 ARCH=ARCH +NCPU=$(sysctl -n hw.ncpufound) + +((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { + cd /mnt + if [[ -f bsd.mp ]] && ((NCPU > 1)); then + echo "Multiprocessor machine; using bsd.mp instead of bsd." + mv bsd bsd.sp 2>/dev/null + mv bsd.mp bsd + ln -sf bsd bsd.mp + fi + echo "Installing boot block..." cp /mnt/usr/mdec/bootsd /mnt/boot /mnt/usr/mdec/installboot -v /mnt/boot /mnt/usr/mdec/bootxx /dev/r${1}a diff --git a/distrib/sparc64/common/install.md b/distrib/sparc64/common/install.md index 12fda710728..79868da577e 100644 --- a/distrib/sparc64/common/install.md +++ b/distrib/sparc64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.25 2009/04/12 12:56:02 krw Exp $ +# $OpenBSD: install.md,v 1.26 2009/04/24 01:04:33 krw Exp $ # $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $ # # @@ -36,10 +36,21 @@ MDTERM=sun MDXAPERTURE=1 ARCH=ARCH +NCPU=$(sysctl -n hw.ncpufound) + +((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; } md_installboot() { local _rawdev=/dev/r${1}c _prefix + cd /mnt + if [[ -f bsd.mp ]] && ((NCPU > 1)); then + echo "Multiprocessor machine; using bsd.mp instead of bsd." + mv bsd bsd.sp 2>/dev/null + mv bsd.mp bsd + ln -sf bsd bsd.mp + fi + # use extracted mdec if it exists (may be newer) if [ -e /mnt/usr/mdec/bootblk ]; then _prefix=/mnt/usr/mdec |