]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Move wait for if functions to net lib
authordyoung@redhat.com <dyoung@redhat.com>
Wed, 12 Dec 2012 04:23:21 +0000 (12:23 +0800)
committerHarald Hoyer <harald@redhat.com>
Fri, 14 Dec 2012 08:08:59 +0000 (09:08 +0100)
net-lib.sh are created for net related functions, move the wait_for_if* to
net-lib.sh naturally.

Signed-off-by: Dave Young <dyoung@redhat.com>
modules.d/40network/dhclient-script.sh
modules.d/40network/net-lib.sh
modules.d/95fcoe/fcoe-up.sh
modules.d/99base/dracut-lib.sh

index 1500fe51bd4a0a75e3a8d64de533baee3c6e06d6..12a67e8b7e1256a406b76b2ef6ba63aaa5ad638a 100755 (executable)
@@ -51,6 +51,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
 export PS4="dhclient.$interface.$$ + "
 exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
 
 # We already need a set netif here
 netif=$interface
index 9b2f29183bc0b05168924af65bc2224ef38235bc..8bab2b60a4a03c8f371afccebe74ef90576f7a00 100644 (file)
@@ -322,3 +322,26 @@ parse_ifname_opts() {
     esac
 
 }
+
+wait_for_if_up() {
+    local cnt=0
+    local li
+    while [ $cnt -lt 200 ]; do
+        li=$(ip -o link show up dev $1)
+        [ -n "$li" ] && return 0
+        sleep 0.1
+        cnt=$(($cnt+1))
+    done
+    return 1
+}
+
+wait_for_route_ok() {
+    local cnt=0
+    while [ $cnt -lt 200 ]; do
+        li=$(ip route show)
+        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        sleep 0.1
+        cnt=$(($cnt+1))
+    done
+    return 1
+}
index d808dd5f4f479a3a38427f727bdba6180ed15d5a..85468ef97397bbab8879bc88a5f2dc57a8e55aa8 100755 (executable)
@@ -16,6 +16,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
 export PS4="fcoe-up.$1.$$ + "
 exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
 
 netif=$1
 dcb=$2
index cc6c7e81205593cb41a3c8f58c4623e104be07a0..127ae429af619d3c4dd6fd87ad8c2d9670763ec8 100755 (executable)
@@ -481,29 +481,6 @@ else
     }
 fi
 
-wait_for_if_up() {
-    local cnt=0
-    local li
-    while [ $cnt -lt 200 ]; do
-        li=$(ip -o link show up dev $1)
-        [ -n "$li" ] && return 0
-        sleep 0.1
-        cnt=$(($cnt+1))
-    done
-    return 1
-}
-
-wait_for_route_ok() {
-    local cnt=0
-    while [ $cnt -lt 200 ]; do
-        li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
-        sleep 0.1
-        cnt=$(($cnt+1))
-    done
-    return 1
-}
-
 # root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
 # root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
 nfsroot_to_var() {