diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2013-03-18 18:29:36 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2013-08-13 16:33:41 -0500 |
commit | 838c9efb36b3b058c5a5b9d0e8c6d4d4789a44b9 (patch) | |
tree | 4d30e9357d1f666ea37186b8a95dbe83c86b4dc8 /net/ccwgroup.sh | |
parent | b2f8ac9382d5dad70181ef803a37f43896f5cb91 (diff) |
Remove gentoo's net.* scripts
It has been determined that it will be best for gentoo's net.* scripts
to be in a separate package to allow independent development.
This package will be called netifrc and maintained by Gentoo.
Diffstat (limited to 'net/ccwgroup.sh')
-rw-r--r-- | net/ccwgroup.sh | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/net/ccwgroup.sh b/net/ccwgroup.sh deleted file mode 100644 index aaf7de6b..00000000 --- a/net/ccwgroup.sh +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright (c) 2007-2008 Roy Marples <roy@marples.name> -# Released under the 2-clause BSD license. - -_config_vars="$_config_vars ccwgroup" - -ccwgroup_depend() -{ - before interface -} - -ccwgroup_load_modules() -{ - # make sure we have ccwgroup support or this is a crap shoot - if [ ! -d /sys/bus/ccwgroup ] ; then - modprobe -q ccwgroup - if [ ! -d /sys/bus/ccwgroup ] ; then - eerror "ccwgroup support missing in kernel" - return 1 - fi - fi - - # verify the specific interface is supported - if [ ! -d /sys/bus/ccwgroup/drivers/$1 ] ; then - modprobe $1 >/dev/null 2>&1 - if [ ! -d /sys/bus/ccwgroup/drivers/$1 ] ; then - eerror "$1 support missing in kernel" - return 1 - fi - fi - - return 0 -} - -ccwgroup_pre_start() -{ - local ccwgroup="$(_get_array "ccwgroup_${IFVAR}")" - [ -z "${ccwgroup}" ] && return 0 - - local ccw_type - eval ccw_type=\${ccwgroup_type_${IFVAR}:-qeth} - - ccwgroup_load_modules ${ccw_type} || return 1 - - einfo "Enabling ccwgroup/${ccw_type} on ${IFACE}" - - set -- ${ccwgroup} - local first=$1; shift - if [ -e /sys/devices/${ccw_type}/${first}/online ]; then - echo "0" >/sys/devices/${ccw_type}/${first}/online - else - echo "${first}$(printf ',%s' "$@")" >/sys/bus/ccwgroup/drivers/${ccw_type}/group - fi - - local var val - for var in $(_get_array "ccwgroup_opts_${IFVAR}") online=1 ; do - val=${var#*=} - var=${var%%=*} - echo "${val}" > /sys/devices/${ccw_type}/${first}/${var} - done - eend $? - - # Now that we've properly configured the device, we can run - # bring the interface up. Common code tried to do this already, - # but it failed because we didn't setup sysfs yet. - _up -} - -ccwgroup_pre_stop() -{ - local path="/sys/class/net/${IFACE}" - - # Erase any existing ccwgroup to be safe - service_set_value ccwgroup_device "" - service_set_value ccwgroup_type "" - - [ ! -L "${path}"/device/driver ] && return 0 - case "$(readlink "${path}"/device/driver)" in - */bus/ccwgroup/*) ;; - *) return 0;; - esac - - local device - device="$(readlink "${path}"/device)" - device=${device##*/} - service_set_value ccwgroup_device "${device}" - device="$(readlink "${path}"/device/driver)" - device=${device##*/} - service_set_value ccwgroup_type "${device}" -} - -ccwgroup_post_stop() -{ - local device="$(service_get_value ccwgroup_device)" - [ -z "${device}" ] && return 0 - local ccw_type="$(service_get_value ccwgroup_type)" - local path="/sys/devices/${ccw_type}/${device}" - - einfo "Disabling ccwgroup/${ccw_type} on ${IFACE}" - if echo "0" >"${path}"/online && - echo "1" >"${path}"/ungroup ; then - # The device doesn't disappear right away which breaks - # restart, or a quick start up, so wait around. - while [ -e "${path}" ] ; do :; done - fi - eend $? -} |