postinstall revision eae72b5b807baa9116e64502cbb278edf15f3146
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#!/bin/sh
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# CDDL HEADER START
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The contents of this file are subject to the terms of the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Common Development and Distribution License (the "License").
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# You may not use this file except in compliance with the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# or http://www.opensolaris.org/os/licensing.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# See the License for the specific language governing permissions
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# and limitations under the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# When distributing Covered Code, include this CDDL HEADER in each
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# If applicable, add the following below this CDDL HEADER, with the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# fields enclosed by brackets "[]" replaced with your own identifying
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# information: Portions Copyright [yyyy] [name of copyright owner]
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# CDDL HEADER END
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Use is subject to license terms.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy
f38cb554a534c6df738be3f4d23327e69888e634John Wren KennedyPATH="/usr/bin:/usr/sbin:$PATH"; export PATH
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# SUNWcsd postinstall configuration
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# This file supplies /dev links needed in the install miniroot. The link
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# targets are automatically created by devfs as driver attaches.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The prototype_com, prototype_sparc, and prototype_i386 variables defined
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# below each consist of two whitespace-delimited columns, defined as follows:
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# 1. Device Path - Relative (should NOT begin with /) path to the device file
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# to be created. This base is interpreted relative to $BASEDIR (typically /a).
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# 2. Symbolic Link - The symlink to the device path which should be created.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The link should be a relative path to which $BASEDIR can be prepended.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Common driver entries:
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedyprototype_com='
devices/pseudo/arp@0:arp dev/arp
devices/pseudo/clone@0:ibd dev/ibd
devices/pseudo/dld@0:ctl dev/dld
devices/pseudo/icmp@0:icmp dev/icmp
devices/pseudo/icmp@0:icmp dev/rawip
devices/pseudo/icmp6@0:icmp6 dev/icmp6
devices/pseudo/icmp6@0:icmp6 dev/rawip6
devices/pseudo/ip@0:ip dev/ip
devices/pseudo/ip6@0:ip6 dev/ip6
devices/pseudo/rts@0:rts dev/rts
devices/pseudo/tcp@0:tcp dev/tcp
devices/pseudo/tcp6@0:tcp6 dev/tcp6
devices/pseudo/udp@0:udp dev/udp
devices/pseudo/udp6@0:udp6 dev/udp6
devices/pseudo/ipsecah@0:ipsecah dev/ipsecah
devices/pseudo/ipsecesp@0:ipsecesp dev/ipsecesp
devices/pseudo/keysock@0:keysock dev/keysock
devices/pseudo/cn@0:console dev/console
devices/pseudo/cn@0:syscon dev/syscon
devices/pseudo/cn@0:systty dev/systty
devices/pseudo/ksyms@0:ksyms dev/ksyms
devices/pseudo/log@0:conslog dev/conslog
devices/pseudo/log@0:log dev/log
devices/pseudo/mm@0:mem dev/mem
devices/pseudo/mm@0:kmem dev/kmem
devices/pseudo/mm@0:null dev/null
devices/pseudo/mm@0:allkmem dev/allkmem
devices/pseudo/mm@0:zero dev/zero
devices/pseudo/openeepr@0:openprom dev/openprom
devices/pseudo/pm@0:pm dev/pm
devices/pseudo/sad@0:admin dev/sad/admin
devices/pseudo/sad@0:user dev/sad/user
devices/pseudo/sy@0:tty dev/tty
devices/pseudo/sysevent@0:sysevent dev/sysevent
devices/pseudo/sysmsg@0:msglog dev/msglog
devices/pseudo/sysmsg@0:sysmsg dev/sysmsg
devices/pseudo/tl@0:ticots dev/ticots
devices/pseudo/tl@0:ticotsord dev/ticotsord
devices/pseudo/tl@0:ticlts dev/ticlts
devices/pseudo/wc@0:wscons dev/wscons
devices/pseudo/zfs@0:zfs dev/zfs
'
#
# SPARC-specific driver entries:
#
prototype_sparc='
'
#
# Intel-specific driver entries:
#
prototype_i386='
devices/pseudo/conskbd@0:kbd dev/kbd
'
#
# SUNWcsd postinstall implementation
#
# Below this point is the code to process the above $prototype_* maps.
# You should not need to modify any code below this point to configure
# new drivers. You should also not need to add code here to remove
# links created by a previous version of this package. All the links
# can also be created by devfsadm link generators; the reason they
# are also here is for the initial boot (miniroot or diskless client)
# where certain devices must be present to get to the point when
# devfsadm runs.
#
#
# Determine an appropriate place for our private error log file. If $PKGSAV
# is available, use that; otherwise use /tmp or /dev/null. We keep a private
# error log primarily as a debugging facility.
#
errlog=/dev/null
for file in $PKGSAV/SUNWcsd.err /tmp/SUNWcsd.err; do
rm -f $file
if touch $file >/dev/null 2>&1; then
errlog=$file
break
fi
done
eval echo "\"\$prototype_com\"" "\"\$prototype_${ARCH}\"" | \
while read path symlink; do
[ -z "$path" ] && continue # Skip blank lines
#
# The link destination must be specified as an absolute path
# to installf. The source we modify to be relative to the
# destination (each "/" becomes a "../" prefix); thus
# linkdst "dev/foo/bar" yields prefix "../../".
#
lprefix=`echo "$symlink" | sed 's:[^/]*::g;s:/:../:g'`
linksrc="$lprefix$path"
linkdst="/$symlink"
if [ ! -L ${BASEDIR}$linkdst ]; then
echo "add link $linkdst=$linksrc"
ln -s $linksrc ${BASEDIR}$linkdst
fi
done
cat << EOF > ${BASEDIR}/devices/README
Copyright 2002 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
This installation of Solaris uses devfs to provide /devices.
Warning: Do not change the content of this directory or its
subdirectories.
The directory containing this README file is typically hidden
underneath the /devices devfs(7FS) mount point. All content at or
below this directory is an implementation artifact and subject to
incompatible change or removal without notification.
Please reference devfs(7FS) for more information.
EOF
if [ -f ${BASEDIR}/devices/README ]; then
chown root:sys ${BASEDIR}/devices/README
chmod 444 ${BASEDIR}/devices/README
fi
exit 0