fixed 40network module
authorHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 13:22:33 +0000 (15:22 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 18 May 2009 13:22:33 +0000 (15:22 +0200)
modules.d/40network/ifup
modules.d/40network/install
modules.d/40network/run-dhclient.sh

index 067bdf5..bc0a631 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+set -x
+
+exec >> /ifup.log 2>&1
+
 # bail immediatly if the interface is already up
 [ -f "/net.$1.up" ] && exit 0
 
 
 # spin through the kernel command line, looking for ip= lines
 for p in $(cat /proc/cmdline); do
-    [ "${p%ip=*}" ] || continue
-    p=${p#ip=}
-    case $p in
+    [ "${p%%=*}" = "ip" ] || continue
+    ip=${p#ip=}
+    case $ip in
        none|off) exit 0;; # we were told to not configure anything
        dhcp|on|any) >/net.$1.dhcp; exit 0;; 
        bootp|rarp|both) exit 0;; #dunno how to do this
-       *) echo ${ip#ip=} | \
+       *) echo ${ip} | \
            (IFS=':' read client server gw netmask hostname device autoconf
                if [ -z "$device" -o "$device" = "$1"  ]; then
                    case $autoconf in
index 3b50b32..c0c13fc 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-dracut_install ip dhclient
+dracut_install ip dhclient grep
 instmods ${modules:-=net}
 inst "$moddir/ifup" "/sbin/ifup"
 inst "$moddir/dhclient-script" "/sbin/dhclient-script"
index a98e01d..0e54555 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 for i in /net.*.dhcp; do
-    [ "$dev" = "/net.*.dhcp" ] && break
-    dev=${i#net.}; dev=${i%.dhcp}
+    [ "$dev" = '/net.*.dhcp' ] && break
+    dev=${i#/net.}; dev=${dev%.dhcp}
     [ -f "/net.$dev.up" ] && continue
-    dhclient -1 -q $dev &
+    dhclient  -R 'subnet-mask,broadcast-address,time-offset,routers,domain-name,domain-name-servers,host-name,nis-domain,nis-servers,ntp-servers,root-path' -1 -q $dev &
 done
 wait