summaryrefslogtreecommitdiff
path: root/distrib/miniroot/install.sh
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2002-08-27 02:18:35 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2002-08-27 02:18:35 +0000
commitd71d3c5bf15deab4d17e12ff71c512971209f5e7 (patch)
tree4684b898cc2501f4957f411e639e199c16f0f9bf /distrib/miniroot/install.sh
parent328ad47a817dfc7cd096e0ee96077f0ab3d6762c (diff)
Move general partitioning advice from machine dependant per disk
routine to install.sh so it is displayed only once. Strongly advise /, /tmp, /var, /usr and /home have their own disk partitions as requested by deraadt@. Rather than rely on users not re-selecting an already initialized disk, just allow them to choose from un-initialized disks. Move get_root invocation into install.sub as both install.sh and upgrade.sh did it first thing. Remove the 'workaround' to a 'vnode aliasing bug' that came in with the initial import of upgrade.sh from NetBSD. ok millert@. Rework verbiage in a few places. Clean up logic around looping through disk units by handling root disk better.
Diffstat (limited to 'distrib/miniroot/install.sh')
-rw-r--r--distrib/miniroot/install.sh50
1 files changed, 30 insertions, 20 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index acea93e652c..c7e56c62146 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sh,v 1.112 2002/08/25 02:13:09 krw Exp $
+# $OpenBSD: install.sh,v 1.113 2002/08/27 02:18:34 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -83,31 +83,41 @@ MODE=install
# include common subroutines and initialization code
. install.sub
-# If /etc/fstab already exists we skip disk initialization, but we still
-# need to know the root disk.
-if [ -f /etc/fstab ]; then
- get_rootdisk
-else
+# If /etc/fstab already exists we skip disk initialization
+if [ ! -f /etc/fstab ]; then
# Install the shadowed disktab file; lets us write to it for temporary
# purposes without mounting the miniroot read-write.
[ -f /etc/disktab.shadow ] && cp /etc/disktab.shadow /tmp/disktab.shadow
- while : ; do
- if [ -z "$ROOTDISK" ]; then
- # Get ROOTDISK and default ROOTDEV
- get_rootdisk
- DISK=$ROOTDISK
- echo "${ROOTDEV} /" > $FILESYSTEMS
- else
- cat << __EOT
+ cat << __EOT
+
+
+You must now initialize the disks you want to use for OpenBSD. During this
+initialization process it is strongly recommended that you create disk
+parititions for the following filesystems:
+
+ /, /tmp, /var, /usr, /home
-Now you can select another disk to initialize. (Do not re-select a disk
-you have already entered information for).
+Some of the security features of OpenBSD rely on these filesystems being
+mounted on separate partitions.
__EOT
- ask_fordev "Which disk do you wish to initialize?" "$DKDEVS"
- [ "$resp" = "done" ] && break
- DISK=$resp
- fi
+
+ # Prevent the user from choosing anything but the default as the
+ # root device. Any attempt to mount '/' anywhere else will
+ # trigger a duplicate mount error.
+ echo "${ROOTDEV} /" > $FILESYSTEMS
+
+ DISK=
+ _DKDEVS=$DKDEVS
+
+ while : ; do
+ _DKDEVS=`rmel "$DISK" $_DKDEVS`
+ [ "$_DKDEVS" ] || break
+
+ ask_fordev "Which disk do you wish to initialize?" "$_DKDEVS"
+ [ "$resp" = "done" ] && break
+
+ DISK=$resp
# Deal with disklabels, including editing the root disklabel
# and labeling additional disks. This is machine-dependent since