Bug#684596: udhcpc avoid default.script dependency on net-tools
Package: udhcpc
Version: 1:1.20.0-6
Severity: normal
Tags: patch
If I remove net-tools from my system, udhcpc breaks because its
default.script relies on ifconfig and route, but udhcpc doesn't depend
on net-tools.
Since versions of these are built into busybox, the attached
quick-and-dirty patch just uses those. A better approach might be to
use the "ip" command, either by depending on iproute2 or using the one
built into busybox.
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing'), (400, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages udhcpc depends on:
ii busybox 1:1.20.0-6
udhcpc recommends no packages.
udhcpc suggests no packages.
-- Configuration Files:
/etc/udhcpc/default.script changed [not included]
-- no debconf information
--- /etc/udhcpc/default.script.orig 2012-04-11 15:04:56.000000000 -0400
+++ /etc/udhcpc/default.script 2012-08-11 11:56:13.000000000 -0400
@@ -11,15 +11,15 @@
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
- /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+ /bin/busybox ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ]; then
echo "$0: Resetting default routes"
- while /sbin/route del default gw 0.0.0.0 dev $interface; do :; done
+ while /bin/busybox route del default gw 0.0.0.0 dev $interface; do :; done
metric=0
for i in $router; do
- /sbin/route add default gw $i dev $interface metric $metric
+ /bin/busybox route add default gw $i dev $interface metric $metric
metric=$(($metric + 1))
done
fi
@@ -45,7 +45,7 @@
if [ -x /sbin/resolvconf ]; then
resolvconf -d "${interface}.udhcpc"
fi
- /sbin/ifconfig $interface 0.0.0.0
+ /bin/busybox ifconfig $interface 0.0.0.0
;;
leasefail)
Reply to: