devices-local revision 24492170008a257707ba12f4ae2f2af9bdf925a9
65fea56f17cd614bc8908264df980a62e1931468vboxsync#!/sbin/sh
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# CDDL HEADER START
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# The contents of this file are subject to the terms of the
65fea56f17cd614bc8908264df980a62e1931468vboxsync# Common Development and Distribution License (the "License").
65fea56f17cd614bc8908264df980a62e1931468vboxsync# You may not use this file except in compliance with the License.
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
65fea56f17cd614bc8908264df980a62e1931468vboxsync# or http://www.opensolaris.org/os/licensing.
65fea56f17cd614bc8908264df980a62e1931468vboxsync# See the License for the specific language governing permissions
65fea56f17cd614bc8908264df980a62e1931468vboxsync# and limitations under the License.
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# When distributing Covered Code, include this CDDL HEADER in each
65fea56f17cd614bc8908264df980a62e1931468vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync# If applicable, add the following below this CDDL HEADER, with the
65fea56f17cd614bc8908264df980a62e1931468vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
65fea56f17cd614bc8908264df980a62e1931468vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# CDDL HEADER END
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync# Use is subject to license terms.
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
65fea56f17cd614bc8908264df980a62e1931468vboxsync# All rights reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync#
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync# Initiate the device reconfiguration process in case we need some
65fea56f17cd614bc8908264df980a62e1931468vboxsync# device links established so that we can successfully perform our
65fea56f17cd614bc8908264df980a62e1931468vboxsync# remaining standard mounts.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync. /lib/svc/share/smf_include.sh
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsmf_is_globalzone || exit $SMF_EXIT_OK
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsvcprop -q -p system/reconfigure system/svc/restarter:default
65fea56f17cd614bc8908264df980a62e1931468vboxsyncif [ $? -eq 0 ]; then
65fea56f17cd614bc8908264df980a62e1931468vboxsync echo 'Configuring devices.' > /dev/msglog 2>&1
65fea56f17cd614bc8908264df980a62e1931468vboxsync /usr/sbin/devfsadm >/dev/msglog 2>&1
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync #
65fea56f17cd614bc8908264df980a62e1931468vboxsync # Flush any existing socket mappings since the major numbers of
65fea56f17cd614bc8908264df980a62e1931468vboxsync # the device files may have changed.
65fea56f17cd614bc8908264df980a62e1931468vboxsync #
65fea56f17cd614bc8908264df980a62e1931468vboxsync /usr/bin/awk '/^[^#]/ { print $1, $2, $3 }' /etc/sock2path | \
65fea56f17cd614bc8908264df980a62e1931468vboxsync /sbin/soconfig -f /dev/fd/0 >/dev/null 2>&1
65fea56f17cd614bc8908264df980a62e1931468vboxsync /sbin/soconfig -f /etc/sock2path >/dev/null 2>&1
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync #
65fea56f17cd614bc8908264df980a62e1931468vboxsync # Update kernel driver.conf cache.
65fea56f17cd614bc8908264df980a62e1931468vboxsync #
65fea56f17cd614bc8908264df980a62e1931468vboxsync /usr/sbin/devfsadm -I
65fea56f17cd614bc8908264df980a62e1931468vboxsyncfi
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync# Establish the default framebuffer name.
fbdev=`/usr/sbin/prtconf -F 2>/dev/null`
if [ $? -eq 0 ]; then
set -- /devices$fbdev*
if [ -c $1 ]; then
if [ -h /dev/fb ]; then
fblink=`ls -l /dev/fb | /usr/bin/awk '{ print $11 }'`
if [ "$1" != "$fblink" ]; then
rm -f /dev/fb
ln -s $1 /dev/fb
fi
else
rm -f /dev/fb
ln -s $1 /dev/fb
fi
fi
fi
# Create any zvol devices
if [ -x /usr/sbin/zfs ]; then
/usr/sbin/zfs volinit || exit $SMF_EXIT_ERR_FATAL
#
# Add swap again to allow for swapping to zvols.
#
/sbin/swapadd
fi
exit $SMF_EXIT_OK