treewide: replace /sbin/sh hashbangs with /bin/sh
[unleashed.git] / usr / src / cmd / svc / milestone / devices-local
blobd7ab944edef2efe4fadea08d5d588e46fe060e8e
1 #!/bin/sh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
23 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
25 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
26 # All rights reserved.
29 # Initiate the device reconfiguration process in case we need some
30 # device links established so that we can successfully perform our
31 # remaining standard mounts.
33 . /lib/svc/share/smf_include.sh
35 smf_is_globalzone || exit $SMF_EXIT_OK
37 svcprop -q -p system/reconfigure system/svc/restarter:default
38 if [ $? -eq 0 ]; then
39 echo 'Configuring devices.' > /dev/msglog 2>&1
40 /usr/sbin/devfsadm >/dev/msglog 2>&1
43 # Rerun soconfig to configure any sockets that use /dev
44 # entries that were just created by devfsadm.
46 /sbin/soconfig -d /etc/sock2path.d >/dev/null 2>&1
49 # Update kernel driver.conf cache.
51 /usr/sbin/devfsadm -I
54 # Establish the default framebuffer name.
56 fbdev=`/usr/sbin/prtconf -F 2>/dev/null`
58 if [ $? -eq 0 ]; then
59 set -- /devices$fbdev*
60 if [ -c $1 ]; then
61 if [ -h /dev/fb ]; then
62 fblink=`ls -l /dev/fb | /usr/bin/awk '{ print $11 }'`
64 if [ "$1" != "$fblink" ]; then
65 rm -f /dev/fb
66 ln -s $1 /dev/fb
68 else
69 rm -f /dev/fb
70 ln -s $1 /dev/fb
75 exit $SMF_EXIT_OK