From: krw Date: Sun, 3 Aug 2008 14:18:00 +0000 (+0000) Subject: Sparc miniroot hasn't worked for a while, since the sed code to find X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8f84877f54b0b0a1f3463ea1c7ccd302282594f7;p=openbsd Sparc miniroot hasn't worked for a while, since the sed code to find the root disk was broken. Simplify and fix said sed code. Problem noted by okan@ and others, diagnosed by deraadt@, sed suggestions from nordin@, jmc@, fgsch@, guenther@. 'get something in before sparc gets done' deraadt@ --- diff --git a/distrib/miniroot/dot.profile b/distrib/miniroot/dot.profile index 7163308b4b1..871c731a538 100644 --- a/distrib/miniroot/dot.profile +++ b/distrib/miniroot/dot.profile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.profile,v 1.7 2007/11/16 21:18:35 krw Exp $ +# $OpenBSD: dot.profile,v 1.8 2008/08/03 14:18:00 krw Exp $ # $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $ # # Copyright (c) 1995 Jason R. Thorpe @@ -36,12 +36,14 @@ umask 022 # emacs-style command line editing set -o emacs -rootdisk=`dmesg|sed -n '/^root on /!d;${s#^root on \([^ ]*\).*#/dev/\1#;p;}'` +# Extract rootdisk from last 'root on wd0a swap on wd0b dump on wd0b' line. +set -- `dmesg | sed -n '/^root on /h;${g;p;}'` +rootdisk=$3 if [ "X${DONEPROFILE}" = "X" ]; then DONEPROFILE=YES - mount -u ${rootdisk:-/dev/rd0a} / + mount -u /dev/${rootdisk:-rd0a} / # set up some sane defaults echo 'erase ^?, werase ^W, kill ^U, intr ^C, status ^T'