i.emlxsconf revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Use locale C to evaluate extended acsii characters in existing conf file
# Remove address and confidential notice no longer used
{
-e '/^# All rights reserved. This computer program and related /',\
'/^# copyright laws and may subject you to criminal prosecution./d'\
if [ $? -eq 0 ] ; then
fi
}
# Update Copyright in Destination
{
if [ $? -eq 0 ] ; then
fi
}
# Add pci-max-read comment block
{
# pci-max-read: Sets the PCI-X max memory read byte count on the adapter.
#
# This value controls the adapter's max PCI-X memory read count.
# On Sunfire x4100/4200 systems this parameter must be changed to
# 1024 bytes. Currently, this parameter should only be modified on
# Sunfire x4100/4200 systems due to the unique nature of the PCI-X bus
# on these systems, otherwise it should be left as default.
#
# Options: 512, 1024, 2048, 4096
#
# Range: Min:512 Max:4096 Default:2048
#
# *Uncomment this parameter for Sunfire x4100/4200 systems only
#pci-max-read=1024;
PCIMAXREAD
}
# Create sed file to replace old pci-max-read comment
# with new information
#
{
/^# pci-max-read: /{
n
n
/# Uncomment this parameter for Sunfire x4100\/4200 systems only/c\\
\# This value controls the adapter's max PCI-X memory read count.\\
\# On Sunfire x4100/4200 systems this parameter must be changed to \\
\# 1024 bytes. Currently, this parameter should only be modified on \\
\# Sunfire x4100/4200 systems due to the unique nature of the PCI-X bus \\
\# on these systems, otherwise it should be left as default.\\
\#\\
\# Options: 512, 1024, 2048, 4096\\
\#\\
\# Range: Min:512 Max:4096 Default:2048\\
\#\\
\# *Uncomment this parameter for Sunfire x4100/4200 systems only
}
SEDCMDS
}
# pci-max-read may be either new or need updating
{
if [ $? -eq 0 ]; then
# Make sure comment is up to date
if [ $? -eq 0 ] ; then
fi
else
# Add comment block
fi
}
# Add vport comment
{
# vport: Virtual port registration table.
# The enable-npiv must be set to 1.
#
# The vport table may have any number of comma delimited entries.
# Each entry must be of the form:
#
# "PHYS_WWPN:VPORT_WWNN:VPORT_WWPN:VPORT_ID"
#
# PHYS_WWPN = World Wide Port Name of adapter's physical port
# VPORT_WWNN = Desired World Wide Node Name of virtual port
# VPORT_WWPN = Desired World Wide Port Name of virtual port
# VPORT_ID = Desired virtual port id (1 to max vports)
# The port ids must start at 1 and increment by 1
# with no gaps in the count.
#
# Example:
#
# vport="10000000c9123456:28010000c9123456:20010000c9123456:1",
# "10000000c9123456:28020000c9123456:20020000c9123456:2",
# "10000000c9123457:28010000c9123457:20010000c9123457:1",
# "10000000c9123457:28020000c9123457:20020000c9123457:2",
# "10000000c9123457:28030000c9123457:20030000c9123457:3";
#
VPORT_CMT
}
# Create sed script to determine Default comment for num_nodes
# Used by check_num_nodes routine
{
/^# num-nodes: /{
N
N
N
N
s/.*Default:\([0-9]*\).*/\1/p
}
SEDCMDS
}
# Create sed script to replace num_nodes comment block
# Used by check_num_nodes routine
{
/^# num-nodes: /{
a\\
\#
a\\
\# 0 = Indicates auto detect limit of adapter.
n
s/# /#/
n
s/Range: Min:2 Max:512 Default:512/Range: Min:0 Max:4096 Default:0/
n
n
s/num-nodes=512;/num-nodes=0;/
}
SEDCMDS
}
# num-nodes values range and default were modified
# As the old default (512) is still a valid setting we need
# to rely on the comment block to decide to make the change.
# If num-nodes != 512 then no change
# If num-nodes == 512 and no comment block then no change
# If num-nodes == 512 and new comment block then no change
# If num-nodes == 512 and old comment block then make change
{
if [ $? -eq 0 ]; then
if [ $? -eq 0 ] ; then
fi
fi
fi
}
# Create sed script to determine Max in comments for link_speed
# Used by check_link_speed routine
{
/^# link-speed: /{
N
N
N
N
N
N
N
N
N
s/.*Max:\([0-9]*\).*/\1/p
}
SEDCMDS
}
# Create sed script to update speed-link comment block
# Used by check_link_speed routine
{
/^# link-speed: /{
n
n
n
n
n
n
a\\
\# 8 = 8 Gigabaud
n
n
s/Max:4/Max:8/
}
SEDCMDS
}
# link-speed value for range was modified
# Old Max: 4 New Max: 8
{
if [ $? -eq 0 ] ; then
fi
fi
}
add_log_ct ()
# add LOG_CT comment to destination
{
sed -e '/# LOG_FIRMWARE /a\
if [ $? -eq 0 ] ; then
fi
}
add_log_fcsp ()
# add LOG_CT comment to destination
{
sed -e '/# LOG_CT /a\
if [ $? -eq 0 ] ; then
fi
}
# Add new parameters and comment block from src confile
{
newparam=$1
# Special cases - parameters not used or which have been updated
# pci-max-read parameter may be new or need to be updated
# vport parameter is not included in the delivered conf file.
# Check is done against the first line of the vport comment instead.
# to see if comment was already added.
if [ $? -ne 0 ] ;then
fi
else
# Regular parameters
commentblk=""
# Lookup comment and parameter from src conffile
while read confline
do
# Blank line; reset block and resume
commentblk=""
continue
fi
if [ $? -eq 0 ] ; then
# Comment
# Start new comment block or append to existing block.
if [ -z "${commentblk}" ] ; then
commentblk="${confline}"
else
commentblk="${commentblk}\n${confline}"
fi
continue
fi
# Must be a parameter
if [ "${newparam}" = "${param}" ] ; then
else
# Wrong parameter; reset block
commentblk=""
continue
fi
done < $src
fi
}
new_content ()
# look up new parameters and add if needed
# Add the parameter variable to the new_params list.
{
new_params="\
pci-max-read \
linkup-delay \
enable-npiv \
vport-restrict-login \
vport \
enable-auth \
max-xfer-size \
target-mode \
"
for param in $new_params ; do
if [ $? -ne 0 ] ; then
fi
done
}
# Update existing information in destination conffile
{
# Correct spelling issue
-e 's/# LOG_RESERVED 0xfff.0000/# LOG_RESERVED 0xfffc0000/' \
if [ $? -eq 0 ] ; then
fi
:
else
fi
:
else
fi
}
#
# Main --------------------
#
do
if [ ! -f $dest ] ; then
else
# Upgrade destination file
fi
done
exit 0