net-install revision 9b5bf10ab04b9be5564d70a57980cfb68b6372e7
#
# 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
#
#
#
NET_NWAM_FMRI="svc:/network/physical:nwam"
NET_UNDEFINED_STRING_PROP="\"\""
{
case $net_install_addrtype in
cmd=$cmd"-a local=$net_install_addr $net_install_name"
;;
dhcp)
dhcpwait=""
fi
cmd="$IPADM create-addr -T dhcp $dhcpwait $net_install_name"
;;
interface_id=""
fi
state=""
state="-p stateless=$net_install_stateless"
fi
state="-p stateful=$net_install_stateful"
else
state=$state",stateful=$net_install_stateful"
fi
fi
;;
esac
if [ $? -ne 0 ]; then
return $SMF_EXIT_ERR_FATAL
fi
if [ $ipv6_interface == 1 ]; then
details="-inet6 default"
else
details="default"
fi
details="$details $net_install_route -ifp $ifp"
if [ $? -ne 0 ]; then
err=$?
return $SMF_EXIT_ERR_FATAL
fi
if [ $? -ne 0 ]; then
err=$?
return $SMF_EXIT_ERR_FATAL
fi
if [ $? -ne 0 ]; then
err=$?
return $SMF_EXIT_ERR_FATAL
fi
fi
return $SMF_EXIT_OK
}
{
#
# Retrieve the mandatory interface name property value. If
# the value is empty, then no interface is configured.
#
return $SMF_EXIT_OK
fi
#
# Retrieve the mandatory address type property value. The two
# valid values are "static" and "dhcp".
#
msg="No \"address_type\" property defined in the "
return $SMF_EXIT_ERR_CONFIG
fi
;;
*)
return $SMF_EXIT_ERR_CONFIG
;;
esac
#
# Retrieve the static address property value. The address property
# only applies to static address type configurations. If not
# configuring a static address, then the property should still have
# its default value of 0.0.0.0/0.
#
msg="Warning: static address ignored "
fi
else
msg="Error: static address required in the "
return $SMF_EXIT_ERR_CONFIG
fi
fi
else
msg="Error: static address required in the "
return $SMF_EXIT_ERR_CONFIG
fi
fi
#
# Retrieve the optional DHCP wait property value.
#
msg="Warning: DHCP wait value ignored in the "
fi
else
fi
fi
#
# Retrieve the optional default route property value.
#
fi
fi
return $?
}
{
#
# Retrieve the mandatory interface name property value. If
# the value is empty, then no interface is configured.
#
return $SMF_EXIT_OK
fi
#
# Retrieve the mandatory address type property value. The two
# valid values are "static" and "addrconf".
#
msg="No \"address_type\" property defined in the "
return $SMF_EXIT_ERR_CONFIG
fi
;;
*)
return $SMF_EXIT_ERR_CONFIG
;;
esac
#
# Retrieve the static address property value. The address property
# only applies to static address type configurations. If not
# configuring a static address, then the property should still have
# its default value of ::0/0.
#
msg="Warning: static address ignored in the "
fi
else
msg="Error: static address required in the "
return $SMF_EXIT_ERR_CONFIG
fi
fi
else
msg="Error: static address required in the "
return $SMF_EXIT_ERR_CONFIG
fi
fi
#
# Retrieve the optional interface id property value. The
# property only applies to addrconf address type configurations.
# If configuring a static address, then the property should still
# have its default value of ::0/0.
#
msg="Warning: interface id value ignored in "
else
fi
fi
fi
#
# Retrieve the optional stateless property value. The property
# only applies to addrconf address type configurations. If
# configuring a static address, then the property should still
# have its default value of "yes".
#
yes)
;;
no)
msg="Warning: stateless value ignored in the "
else
fi
;;
*)
return $SMF_EXIT_ERR_CONFIG
;;
esac
fi
#
# Retrieve the optional stateful property value. The property
# only applies to addrconf address type configurations. If
# configuring a static address, then the property should still
# have its default value of "yes".
#
yes)
;;
no)
msg="Warning: stateless value ignored in the "
else
fi
;;
*)
return $SMF_EXIT_ERR_CONFIG
;;
esac
fi
#
# Retrieve the optional default route property value.
#
fi
fi
return $?
}
{
vout=`$SVCCFG -s $NET_INSTALL_FMRI validate 2>&1`
msg="Validation errors in $NET_INSTALL_FMRI:\n$vout"
return $SMF_EXIT_ERR_CONFIG
fi
errs=0
ifcnt=0
do
pg=`$SVCPROP -p $intf $NET_INSTALL_FMRI`
if [ $? -eq 0 ]; then
if service_is_enabled $NET_NWAM_FMRI; then
msg="NWAM enabled. Install static "
else
else
fi
if [ $? -ne $SMF_EXIT_OK ]; then
#
# Last error wins.
#
ecode=$?
else
fi
fi
fi
done
if [ $net_install_debug -eq 1 ]; then
"configuring interfaces on behalf of install"
fi
"behalf of install"
fi
fi
return $ecode
}
#
# after the intial install. The service will disable itself after processing
# the install defined property values.
#
# When the non-global shared-IP stack zone boots, it tries to bring up this
# service as well. We just want to exit successfully.
#
if smf_is_nonglobalzone; then
exit $SMF_EXIT_OK
fi
fi
net_process_install || exit $?
exit $SMF_EXIT_OK