busybox: udhcpc.script: cleanup
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 26 Jun 2013 12:29:19 +0000 (14:29 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 26 Jun 2013 12:34:25 +0000 (14:34 +0200)
ifconfig up is a no-op if the device is already running, so let's just
do that unconditionally.

Systems might have multiple network devices, and perhaps run udhcpc on
another interface even when booted over nfs, so don't disable the
per-interface deconfig based on the global nfsroot= setting on the kernel
command line.

If you don't want udhcpc to mess with kernel level IP autoconfiguration
(E.G. for nfs boot), you should instead ensure udhcpc/ifup/ifplugd isn't
started for that interface.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/busybox/udhcpc.script

index 0bb3dea03c78fe9b51e7c37fcf8381ac91ae4c6c..f7beb56a08048390c80ebfd3b6da16b40014a056 100755 (executable)
@@ -10,14 +10,9 @@ RESOLV_CONF="/etc/resolv.conf"
 
 case "$1" in
        deconfig)
-               grep -q -v ip= /proc/cmdline
-               if [ $? -eq 0 ]; then
-                       /sbin/ifconfig $interface up
-               fi
-               grep -q -v nfsroot= /proc/cmdline
-               if [ $? -eq 0 ]; then
-                       /sbin/ifconfig $interface 0.0.0.0
-               fi
+               /sbin/ifconfig $interface up
+               /sbin/ifconfig $interface 0.0.0.0
+
                if [ -x /usr/sbin/avahi-autoipd ]; then
                        /usr/sbin/avahi-autoipd -k $interface
                fi