From: Harald Hoyer Date: Mon, 18 May 2009 13:22:33 +0000 (+0200) Subject: fixed 40network module X-Git-Tag: 0.1~257 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32f32c14b6e39190f9ad71f07d2f76b96b49537e;p=platform%2Fupstream%2Fdracut.git fixed 40network module --- diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index 067bdf5..bc0a631 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -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 @@ -12,13 +16,13 @@ # 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 diff --git a/modules.d/40network/install b/modules.d/40network/install index 3b50b32..c0c13fc 100755 --- a/modules.d/40network/install +++ b/modules.d/40network/install @@ -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" diff --git a/modules.d/40network/run-dhclient.sh b/modules.d/40network/run-dhclient.sh index a98e01d..0e54555 100755 --- a/modules.d/40network/run-dhclient.sh +++ b/modules.d/40network/run-dhclient.sh @@ -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