diff options
author | Bill Nottingham <notting@redhat.com> | 2008-05-20 20:34:46 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2008-05-23 10:57:39 -0400 |
commit | 75f28ad9f1fab4372a024faba967d334ba148c8a (patch) | |
tree | 289f758b81a551d16840326cdbf50d5359981795 /sysconfig | |
parent | ee3a511e55113e998a023789420fa940edc7db71 (diff) | |
download | initscripts-75f28ad9f1fab4372a024faba967d334ba148c8a.tar initscripts-75f28ad9f1fab4372a024faba967d334ba148c8a.tar.gz initscripts-75f28ad9f1fab4372a024faba967d334ba148c8a.tar.bz2 initscripts-75f28ad9f1fab4372a024faba967d334ba148c8a.tar.xz initscripts-75f28ad9f1fab4372a024faba967d334ba148c8a.zip |
Don't try to rename devices - udev rules are the way to go
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 2 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 33 |
2 files changed, 0 insertions, 35 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index c5d03576..bf3ab9ea 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -48,10 +48,8 @@ if [ -n "${HWADDR}" ]; then if [ "${FOUNDMACADDR}" != "${HWADDR}" -a "${FOUNDMACADDR}" != "${MACADDR}" ]; then curdev=`get_device_by_hwaddr ${HWADDR}` if [ -n "$curdev" ]; then - rename_device "${REALDEVICE}" "${HWADDR}" "${curdev}" || { echo $"Device ${DEVICE} has different MAC address than expected, ignoring." exit 1 - } fi fi fi diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 1a170418..a5aa378e 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -181,39 +181,6 @@ do_netreport () ) } -# rename_device() - Rename a network device to something else -# $1 - desired name -# $2 - hardware address to name (no longer used) -# $3 - '/' separated list of devices that are already in use -# (for general calls, use the current device you're trying to -# change to $1) - -rename_device() -{ - local target=${3##*/} - - /sbin/ip link set "$target" name "$1" 2>/dev/null || { - local hw2=`get_hwaddr ${1}` - local nconfig=`get_config_by_hwaddr ${hw2}` - local curdev=`get_device_by_hwaddr ${hw2}` - local dev= - [ -z "${hw2}" ] && return - if [ -n "$nconfig" ]; then - dev=$(. $nconfig ; echo $DEVICE) - oldifs=$IFS - IFS=/ - for device in $3 ; do - [ "$dev" = "$device" ] && unset dev - done - IFS=$oldifs - fi - [ -z "$dev" ] && dev=dev$RANDOM - - rename_device $dev $hw2 "$3/$curdev" - /sbin/ip link set "$target" name $1 2>/dev/null - } -} - # Sets $alias to the device module if $? != 0 is_available () { |