Do not use ifenslave
authorCong Wang <xiyou.wangcong@gmail.com>
Tue, 29 May 2012 09:00:33 +0000 (17:00 +0800)
committerHarald Hoyer <harald@redhat.com>
Tue, 29 May 2012 09:18:51 +0000 (11:18 +0200)
ifenslave is an old tool, and could be dropped,
we can use the /sys interface.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
modules.d/40network/ifup.sh
modules.d/40network/module-setup.sh
modules.d/40network/parse-bond.sh

index c03838f..1aaa1a8 100755 (executable)
@@ -156,7 +156,7 @@ if [ -e /tmp/bond.info ]; then
 
         for slave in $bondslaves ; do
             ip link set $slave down
-            ifenslave $bondname $slave
+            echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
             ip link set $slave up
             wait_for_if_up $slave
         done
index f28286c..da58521 100755 (executable)
@@ -75,7 +75,7 @@ installkernel() {
 install() {
     local _arch _i _dir
     dracut_install ip arping tr dhclient
-    dracut_install -o brctl ifenslave
+    dracut_install -o brctl
     inst "$moddir/ifup.sh" "/sbin/ifup"
     inst "$moddir/netroot.sh" "/sbin/netroot"
     inst "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
index 5822685..933ad27 100755 (executable)
@@ -15,7 +15,7 @@
 
 # Check if bond parameter is valid
 if getarg bond= >/dev/null ; then
-    command -v ifenslave >/dev/null 2>&1 || die "No 'ifenslave' installed"
+    :
 fi
 
 # We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup