1051N/A# The contents of this file are subject to the terms of the
1051N/A# Common Development and Distribution License (the "License").
1051N/A# You may not use this file except in compliance with the License.
1051N/A# See the License for the specific language governing permissions
1051N/A# and limitations under the License.
1051N/A# When distributing Covered Code, include this CDDL HEADER in each
1051N/A# If applicable, add the following below this CDDL HEADER, with the
1051N/A# fields enclosed by brackets "[]" replaced with your own identifying
1051N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1051N/A# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
1051N/A# Use is subject to license terms.
1051N/A# Convert datalink configuration into a series of dladm(1M) commands and
1051N/A# keep them in an upgrade script. This script will then be run in the
1051N/A# that script is run during manifest-import which is too late for
2976N/A # Try the alternate location.
2976N/A # Strip off comments, then each remaining line defines an
2976N/A # aggregation the admnistrator configured on the old system.
2976N/A # Each line corresponds to one dladm command that is appended
2650N/A cat $ORIG | grep '^[^#]' | while read line; do
2976N/A echo $line | while read aggr_index rest
2976N/A dladm_string="dladm create-aggr -P $policy -l \
2976N/A if [ "${mac}" != "auto" ]; then
1051N/A dladm_string="$dladm_string -u $mac"
1105N/A while [ $i -le "${nports}" ]; do
1105N/A device=`echo $ports | cut -d, -f$i`
1051N/A # the port number, so get rid of it if it is
1051N/A device=`echo $device | cut -d/ -f1`
1051N/A dladm_string="$dladm_string -d $device"
2976N/A dladm_string="$dladm_string $aggr_index"
2976N/A ${PKG_INSTALL_ROOT}/$UPGRADE_SCRIPT
2976N/A # no longer needed, get rid of it.
1345N/A # Strip off comments, then each remaining line lists properties
1345N/A # the administrator configured for a particular interface.
1345N/A # Each line includes several properties, but we can only set
1345N/A # one property per dladm invocation.
1345N/A cat $ORIG | grep '^[^#]' | while read line; do
1345N/A echo $line | while read link rest
1345N/A linkprop=`echo $rest | cut -d";" -f1`
1345N/A rest=`echo $rest | cut -d";" -f2-`
2324N/A echo dladm set-linkprop -p $linkprop $link >> \
2324N/A ${PKG_INSTALL_ROOT}/$UPGRADE_SCRIPT
2324N/A # no longer needed, get rid of it
1265N/A# Convert (hostname|hostname6|dhcp).xxx and zonecfg vlan entries
1345N/Afor iftype in hostname hostname6 dhcp
2324N/Azones=`zoneadm list -c | grep -v global`
1777N/A zif=`zonecfg -z $zone info net | grep physical | \
2324N/Afor ifname in $host_ifs $zone_ifs
phys=`echo $ifname | sed "s/[0-9]*$//"`
devnum=`echo $ifname | sed "s/$phys//g"`
if [ "$phys$devnum" != $ifname -o \
-n "`echo $devnum | tr -d '[0-9]'`" ]; then
echo "skipping invalid interface $ifname"
vid=`expr $devnum / 1000`
inst=`expr $devnum % 1000`
if [ "$vid" != "0" ]; then
echo dladm create-vlan -l $phys$inst -v $vid \
$ifname >> ${PKG_INSTALL_ROOT}/$UPGRADE_SCRIPT
if [ "$vid" != "1" ]; then
# If default PVID VLAN 1 is in use then warn
# the user and force PVID to zero.
echo "Warning: default VLAN tag set to 0 on $ifname"
echo dladm set-linkprop -p default_tag=0 \
$ifname >> ${PKG_INSTALL_ROOT}/$UPGRADE_SCRIPT
# Change permissions of public IKE certificates and CRLs
# that may have been incorrectly created as private
# PKCS#11 hints files must be left root-only readable.
# Make sure this files starts with "30 82"
if dd if=$file count=2 bs=1 2>
/dev/null | cat -v | \
# Change group and permissions of
/etc/dladm/*.conf config files.
#
secobj.conf changes permissions and group. The rest only change the group.
chgrp netadm ${DLADM_FILES}