xref: /illumos-gate/usr/src/cmd/svc/milestone/devices-local (revision db874c57ae335a07060499f1492b0d0e2593e26c)
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, Version 1.0 only
7# (the "License").  You may not use this file except in compliance
8# with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23#
24# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
28# All rights reserved.
29#
30#
31# ident	"%Z%%M%	%I%	%E% SMI"
32
33# Initiate the device reconfiguration process in case we need some
34# device links established so that we can successfully perform our
35# remaining standard mounts.
36
37if [ `/sbin/zonename` != "global" ]; then
38	exit 0
39fi
40
41. /lib/svc/share/smf_include.sh
42
43svcprop -q -p system/reconfigure system/svc/restarter:default
44if [ $? -eq 0 ]; then
45	echo 'Configuring devices.' > /dev/msglog 2>&1
46	/usr/sbin/devfsadm >/dev/msglog 2>&1
47        if [ -x /usr/ucb/ucblinks -a -f /usr/ucblib/ucblinks.awk ]; then
48                /usr/ucb/ucblinks >/dev/null 2>&1
49        fi
50
51	#
52	# Flush any existing socket mappings since the major numbers of
53	# the device files may have changed.
54	#
55	/usr/bin/awk '/^[^#]/ { print $1, $2, $3 }' /etc/sock2path | \
56		/sbin/soconfig -f /dev/fd/0 >/dev/null 2>&1
57	/sbin/soconfig -f /etc/sock2path >/dev/null 2>&1
58
59	#
60	# Update kernel driver.conf cache.
61	#
62	/usr/sbin/devfsadm -I
63fi
64
65# Establish the default framebuffer name.
66
67fbdev=`/usr/sbin/prtconf -F 2>/dev/null`
68
69if [ $? -eq 0 ]; then
70	set -- /devices$fbdev*
71	if [ -c $1 ]; then
72		rm -f /dev/fb
73		ln -s $1 /dev/fb
74	fi
75fi
76
77# Create any zvol devices
78if [ -x /usr/sbin/zfs ]; then
79	/usr/sbin/zfs volinit || exit $SMF_EXIT_ERR_FATAL
80fi
81
82exit 0
83