summaryrefslogtreecommitdiff
path: root/distrib/sparc/miniroot
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-04-13 03:10:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-04-13 03:10:50 +0000
commitf82dd683e5ef6a8b46b91b0be765dc5f67082d84 (patch)
tree34eb47bfbf604e4454c87f71c24289ed324226b0 /distrib/sparc/miniroot
parent8ae3f879a93b9d7b9c8a50eec99c9c337612bc9f (diff)
Use a grizzly sed script to ensure that the rootdev is determined out of
the last possible dmesg block in the buffer; clubbed together by espie
Diffstat (limited to 'distrib/sparc/miniroot')
-rw-r--r--distrib/sparc/miniroot/dot.profile10
1 files changed, 8 insertions, 2 deletions
diff --git a/distrib/sparc/miniroot/dot.profile b/distrib/sparc/miniroot/dot.profile
index c4a09378fd8..af0d5772131 100644
--- a/distrib/sparc/miniroot/dot.profile
+++ b/distrib/sparc/miniroot/dot.profile
@@ -1,4 +1,4 @@
-# $OpenBSD: dot.profile,v 1.20 2002/04/09 20:04:09 deraadt Exp $
+# $OpenBSD: dot.profile,v 1.21 2002/04/13 03:10:49 deraadt Exp $
# $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $
#
# Copyright (c) 1995 Jason R. Thorpe
@@ -43,7 +43,13 @@ set -o emacs # emacs-style command line editing
TERMS="sun vt* pcvt* dumb"
TERM=sun
-rootdisk=`dmesg|grep "^root on"|{ o=;while read x y z t;do o=/dev/$z;done;echo $o;}`
+rootdisk=`dmesg|sed -n -e '/OpenBSD /h' -e '//!H' -e '${
+ g
+ p
+}'|sed -n -e '/^root on \([0-9a-z]*\)/{
+ s//\/dev\/\1/
+ p
+}'`
if [ "X${DONEPROFILE}" = "X" ]; then
DONEPROFILE=YES