All of lore.kernel.org
 help / color / mirror / Atom feed
From: dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [patch RFC 3/6] Change to use linkup function in network scripts
Date: Thu, 08 Nov 2012 11:40:21 +0800	[thread overview]
Message-ID: <20121108034317.455101472@redhat.com> (raw)
In-Reply-To: 20121108034018.789330224@redhat.com

[-- Attachment #1: network-use-linkup-function.patch --]
[-- Type: text/plain, Size: 2613 bytes --]

Update ifup.sh and fcoe-up.sh, use linkup function instead of directly
call ip command.

Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 modules.d/40network/ifup.sh |   17 ++++++-----------
 modules.d/95fcoe/fcoe-up.sh |    3 +--
 2 files changed, 7 insertions(+), 13 deletions(-)

--- dracut.orig/modules.d/40network/ifup.sh
+++ dracut/modules.d/40network/ifup.sh
@@ -84,8 +84,7 @@ do_ipv6auto() {
     echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
     echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
     echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
-    ip link set $netif up
-    wait_for_if_up $netif
+    linkup $netif
 
     [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
 
@@ -96,8 +95,7 @@ do_ipv6auto() {
 do_static() {
     strstr $ip '*:*:*' && load_ipv6
 
-    ip link set $netif up
-    wait_for_if_up $netif
+    linkup $netif
     [ -n "$macaddr" ] && ip link set address $macaddr
     [ -n "$mtu" ] && ip link set mtu $mtu
     if strstr $ip '*:*:*'; then
@@ -147,13 +145,12 @@ if [ -e /tmp/bond.info ]; then
             fi
         done
 
-        ip link set $netif up
+        linkup $netif
 
         for slave in $bondslaves ; do
             ip link set $slave down
             echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
-            ip link set $slave up
-            wait_for_if_up $slave
+            linkup $slave
         done
 
         # add the bits to setup the needed post enslavement parameters
@@ -180,9 +177,8 @@ if [ -e /tmp/bridge.info ]; then
             if [ "$ethname" = "$bondname" ] ; then
                 DO_BOND_SETUP=yes ifup $bondname -m
             else
-                ip link set $ethname up
+                linkup $ethname
             fi
-            wait_for_if_up $ethname
             brctl addif $bridgename $ethname
         done
     fi
@@ -204,9 +200,8 @@ if [ "$netif" = "$vlanname" ] && [ ! -e 
     if [ "$phydevice" = "$bondname" ] ; then
         DO_BOND_SETUP=yes ifup $phydevice -m
     else
-        ip link set "$phydevice" up
+        linkup "$phydevice"
     fi
-    wait_for_if_up "$phydevice"
     ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
 fi
 
--- dracut.orig/modules.d/95fcoe/fcoe-up.sh
+++ dracut/modules.d/95fcoe/fcoe-up.sh
@@ -21,8 +21,7 @@ type ip_to_var >/dev/null 2>&1 || . /lib
 netif=$1
 dcb=$2
 
-ip link set "$netif" up
-wait_for_if_up "$netif"
+linkup "$netif"
 
 netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
 netdriver=${netdriver##*/}

  parent reply	other threads:[~2012-11-08  3:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08  3:40 [patch RFC 0/6] network fixes for link waiting dyoung-H+wXaHxf7aLQT0dZR+AlfA
2012-11-08  3:40 ` [patch RFC 1/6] Move wait for if functions to net lib dyoung-H+wXaHxf7aLQT0dZR+AlfA
     [not found]   ` <20121108034317.171739916-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-11-08  9:50     ` Dave Young
2012-11-08  3:40 ` [patch RFC 2/6] Add function linkup dyoung-H+wXaHxf7aLQT0dZR+AlfA
2012-11-08  3:40 ` dyoung-H+wXaHxf7aLQT0dZR+AlfA [this message]
2012-11-08  3:40 ` [patch RFC 4/6] Wait for link ready before use the interface dyoung-H+wXaHxf7aLQT0dZR+AlfA
2012-11-08  3:40 ` [patch RFC 5/6] Get ifaces for udev rule use dyoung-H+wXaHxf7aLQT0dZR+AlfA
     [not found]   ` <20121108034317.735680044-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-11-29  8:07     ` Dave Young
2012-11-08  3:40 ` [patch RFC 6/6] Wait for interface up at the early stage dyoung-H+wXaHxf7aLQT0dZR+AlfA
     [not found]   ` <20121108034317.844374819-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-11-29  8:09     ` Dave Young
     [not found] ` <20121108034018.789330224-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-11-14  8:49   ` [patch RFC 0/6] network fixes for link waiting Dave Young
     [not found]     ` <50A35B2E.9050206-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-11-14 10:56       ` Harald Hoyer
     [not found]         ` <50A378F0.4030907-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-11-15  1:52           ` Dave Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121108034317.455101472@redhat.com \
    --to=dyoung-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.