From f95a4b29843c96f3438ff0aa6af13699ce36aef7 Mon Sep 17 00:00:00 2001 From: silvan Date: Wed, 27 Apr 2011 20:06:31 +0200 Subject: [PATCH] Replace ifconfig.* occurrencies with ifcfg- to comply with RedHat and NetworkManager ifcfg-rh plugin --- ChangeLog | 4 ++++ Makefile | 6 ++++-- VERSION | 2 +- postplug.d/20network | 46 +++++++++++++++++++++----------------------- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a8bbac..5f36f9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Changes in version 1.2.4 20110427 +- network: replace ifconfig.* occurencies with ifcfg- to comply with RedHat and NetworkManager ifcfg-rh plugin +--------------------------------------------------------------------------------- + Changes in version 1.2.3 20110319 - sound: don't reprobe when no (PCI) soundcards are available --------------------------------------------------------------------------------- diff --git a/Makefile b/Makefile index 6eeb5f8..f31a528 100644 --- a/Makefile +++ b/Makefile @@ -131,9 +131,11 @@ dist: clean echo "ChangeLog not updated; not releasing" 1>&2;\ exit 1;; \ esac + @mkdir /tmp/$(distdir) + @cp -a * /tmp/$(distdir)/ @rm -f $(dist_archive);\ - tar cf - --exclude=$(PACKAGE)*.bz2 -C .. $(distdir) |\ - bzip2 -9 -c > $(dist_archive) + tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive) + @rm -rf /tmp/$(distdir) @echo "file \`$(dist_archive)' created" dist-rpm: dist diff --git a/VERSION b/VERSION index c075dc8..77904d2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION = 1.2.3 +VERSION = 1.2.4 diff --git a/postplug.d/20network b/postplug.d/20network index 25ef804..a4687d5 100644 --- a/postplug.d/20network +++ b/postplug.d/20network @@ -3,7 +3,7 @@ # network - network plugin for postplug # # Copyright (c) 2004-2007 by Davide Madrisan -# Copyright (c) 2009 by Silvan Calarco +# Copyright (c) 2009-2011 by Silvan Calarco # if [ $UID != 0 ]; then @@ -30,11 +30,11 @@ function wlan_config_auto() { local wlan_interface="$1" - cat > $network_devices/ifconfig.${wlan_interface} << _EOF -IF=${wlan_interface} + cat > $network_devices/ifcfg-${wlan_interface} << _EOF +DEVICE=${wlan_interface} BOOTPROTO=dhcp -ZONE=local ONBOOT=yes +#NM_CONTROLLED=no #WIRELESS_ESSID="" #WIRELESS_MODE=managed #WIRELESS_ENC=s:ENCRYPTIONKEY @@ -48,17 +48,16 @@ function eth_config_auto() { local eth_interface="$1" - cat > $network_devices/ifconfig.${eth_interface} << _EOF -IF=${eth_interface} + cat > $network_devices/ifcfg-${eth_interface} << _EOF +DEVICE=${eth_interface} BOOTPROTO=dhcp -ZONE=local ONBOOT=yes +#NM_CONTROLLED=no _EOF } -# FIXME : add support for 'ZONE=$IF_ZONE' function eth_config() { # eth_config {--enable|--disable|--auto} @@ -93,8 +92,8 @@ function eth_config() { unset IF_IPADDR IF_NETMASK IF_NETWORK IF_BROADCAST DEST_GATEWAY_IF if [ "$action" = "disable" ]; then - cat > $network_devices/ifconfig.${eth_interface} << _EOF -IF=${eth_interface} + cat > $network_devices/ifcfg-${eth_interface} << _EOF +DEVICE=${eth_interface} ONBOOT=no _EOF return @@ -109,9 +108,8 @@ $dialog_backtitle -- "$"Network devices configuration" \ # configure DHCP for this interface if [ $? -eq 0 ]; then - #unset IF_ZONE - cat > $network_devices/ifconfig.${eth_interface} << _EOF -IF=${eth_interface} + cat > $network_devices/ifcfg-${eth_interface} << _EOF +DEVICE=${eth_interface} BOOTPROTO=dhcp ZONE=local ONBOOT=yes @@ -150,14 +148,14 @@ $dialog_backtitle -- "$"Network interface configuration" \ break fi done - cat > $network_devices/ifconfig.${eth_interface} << _EOF -IF=${eth_interface} + cat > $network_devices/ifcfg-${eth_interface} << _EOF +DEVICE=${eth_interface} ONBOOT=yes -ZONE=local IPADDR=$IF_IPADDR NETWORK=$IF_NETWORK NETMASK=$IF_NETMASK BROADCAST=$IF_BROADCAST +#NM_CONTROLLED=no _EOF fi } @@ -232,8 +230,8 @@ _EOF echo "nameserver 127.0.0.1" >> $resolv_conf fi - (cd /etc/sysconfig/network-devices/ && - for sysconfile in $(ls ifconfig.* 2>/dev/null); do + (cd /etc/sysconfig/$network_devices/ && + for sysconfile in $(ls ifcfg-* 2>/dev/null); do . $sysconfile # configure the default gateway using the first # interface not configured with DHCP @@ -256,7 +254,7 @@ for wlan_int in $(cat /proc/net/wireless 2>/dev/null | sed -n '/[a-z]*[0-9]*:/{s /sbin/ifconfig $wlan_int >/dev/null 2>&1 || continue # found interface already configured - [ -e $network_devices/ifconfig.$wlan_int ] && continue + [ -e $network_devices/ifcfg-$wlan_int ] && continue wlan_ints[${#wlan_ints[*]}]="$wlan_int" echo "$wlan_int" >> $postplugnew_file 2>/dev/null @@ -268,7 +266,7 @@ for eth_int in $(cat /proc/net/dev | sed -n '/eth[0-9]*:/{s,:.*,,;p}'); do /sbin/ifconfig $eth_int >/dev/null 2>&1 || continue # found interface already configured - [ -e $network_devices/ifconfig.$eth_int ] && continue + [ -e $network_devices/ifcfg-$eth_int ] && continue eth_ints[${#eth_ints[*]}]="$eth_int" echo "$eth_int" >> $postplugnew_file 2>/dev/null @@ -341,16 +339,16 @@ fi if [ $NETWORK_NEWDEVICE = "dialog" -a $int_newconf -gt 0 ]; then for eth_int in ${eth_ints[*]}; do - [ -r $network_devices/ifconfig.$eth_int ] || continue + [ -r $network_devices/ifcfg-$eth_int ] || continue unset BOOTPROTO - . $network_devices/ifconfig.$eth_int + . $network_devices/ifcfg-$eth_int [ "$BOOTPROTO" = "dhcp" ] && exit done for wlan_int in ${wlan_ints[*]}; do - [ -r $network_devices/ifconfig.$wlan_int ] || continue + [ -r $network_devices/ifcfg-$wlan_int ] || continue unset BOOTPROTO - . $network_devices/ifconfig.$wlan_int + . $network_devices/ifcfg-$wlan_int [ "$BOOTPROTO" = "dhcp" ] && exit done