xref: /illumos-gate/usr/src/cmd/svc/milestone/devices-local (revision e4f5a11d4a234623168c1558fcdf4341e11769e1)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
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.
8#
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.
13#
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]
19#
20# CDDL HEADER END
21#
22#
23# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24#
25# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
26# All rights reserved.
27#
28
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.
32
33. /lib/svc/share/smf_include.sh
34
35smf_is_globalzone || exit $SMF_EXIT_OK
36
37svcprop -q -p system/reconfigure system/svc/restarter:default
38if [ $? -eq 0 ]; then
39	echo 'Configuring devices.' > /dev/msglog 2>&1
40	/usr/sbin/devfsadm >/dev/msglog 2>&1
41
42	#
43	# Rerun soconfig to configure any sockets that use /dev
44	# entries that were just created by devfsadm.
45	#
46	/sbin/soconfig -f /etc/sock2path >/dev/null 2>&1
47
48	#
49	# Update kernel driver.conf cache.
50	#
51	/usr/sbin/devfsadm -I
52fi
53
54# Establish the default framebuffer name.
55
56fbdev=`/usr/sbin/prtconf -F 2>/dev/null`
57
58if [ $? -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 }'`
63
64			if [ "$1" != "$fblink" ]; then
65				rm -f /dev/fb
66				ln -s $1 /dev/fb
67			fi
68		else
69			rm -f /dev/fb
70			ln -s $1 /dev/fb
71		fi
72        fi
73fi
74
75exit $SMF_EXIT_OK
76