summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-05-17 12:45:01 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-05-17 12:45:01 +0000
commitf3fee73e32782c4cf183f931cbeb06af59d5e63e (patch)
tree1e266f1060332c5b868a36ea5cf9065d45f889ce /distrib/miniroot
parent0457f65df53a2050d902e9f57d86f03d0ff51456 (diff)
Move comment to correct spot.
Suppress 'No such file' error message when grep'ing for '/' mount point in fstab.$ROOTDISK. We are interested in success or failure, not excuses! Check for existance of fstab.$DISK. User may exit disklabel with 'x', especially for non-root disks, and not create the file.
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 23b69c84377..f32450c11fb 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sh,v 1.187 2009/05/11 02:07:47 krw Exp $
+# $OpenBSD: install.sh,v 1.188 2009/05/17 12:45:00 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
@@ -96,8 +96,11 @@ if [[ ! -f /etc/fstab ]]; then
AUTOROOT=n
md_prep_disklabel $DISK
+ # Make sure fstab.$DISK was created.
+ [[ -f fstab.$DISK ]] || { DISK= ; continue ; }
+
# Make sure there is a '/' mount point.
- grep -q " / ffs " fstab.$ROOTDISK || \
+ grep -qs " / ffs " fstab.$ROOTDISK || \
{ DISK= ; echo "'/' must be configured!" ; continue ; }
# Avoid duplicate mount points on different disks.
@@ -106,11 +109,11 @@ if [[ ! -f /etc/fstab ]]; then
{ _rest=$DISK ; DISK= ; break ; }
done <fstab.$DISK
if [[ -z $DISK ]]; then
+ # Allow disklabel(8) to read mountpoint info.
cat fstab.$_rest >/etc/fstab
rm fstab.$_rest
set -- $(grep " $_mp " fstab.*[0-9])
echo "$_pp and $1 can't both be mounted at $_mp."
- # Allow disklabel(8) to read mountpoint info.
continue
fi