10Sstevel@tonic-gate#!/sbin/sh
20Sstevel@tonic-gate#
30Sstevel@tonic-gate# CDDL HEADER START
40Sstevel@tonic-gate#
50Sstevel@tonic-gate# The contents of this file are subject to the terms of the
60Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
70Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
80Sstevel@tonic-gate# with the License.
90Sstevel@tonic-gate#
100Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
110Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
120Sstevel@tonic-gate# See the License for the specific language governing permissions
130Sstevel@tonic-gate# and limitations under the License.
140Sstevel@tonic-gate#
150Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
160Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
170Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
180Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
190Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
200Sstevel@tonic-gate#
210Sstevel@tonic-gate# CDDL HEADER END
220Sstevel@tonic-gate#
230Sstevel@tonic-gate
240Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate# Use is subject to license terms.
260Sstevel@tonic-gate
270Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
280Sstevel@tonic-gate
290Sstevel@tonic-gate#
300Sstevel@tonic-gate# basic setup
310Sstevel@tonic-gate#
320Sstevel@tonic-gateGRUBDISKMAP=/var/run/solaris_grubdisk.map
330Sstevel@tonic-gate
34*316Svikram/bin/rm -f "$GRUBDISKMAP"
35*316Svikram/bin/touch "$GRUBDISKMAP"
36*316Svikram/sbin/biosdev 2> /dev/null | while read diskno diskpath
370Sstevel@tonic-gate    do
38*316Svikram	devname=`/bin/ls -l /dev/rdsk/*p0 | /bin/grep $diskpath | /bin/nawk '{ print $9 }'`
39*316Svikram	ctdname=`echo $devname | /bin/sed "s#/dev/rdsk/##" | /bin/sed "s#p0##"`
40*316Svikram	grubdisk=`echo $diskno | /bin/sed "s/0x8//"`
410Sstevel@tonic-gate	echo "$grubdisk $ctdname $diskpath" >> "$GRUBDISKMAP"
420Sstevel@tonic-gate    done
430Sstevel@tonic-gate
440Sstevel@tonic-gate# cleanup
45