[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1009309: marked as done (udhcpc: allow usage without busybox)



Your message dated Wed, 13 Apr 2022 08:31:03 +0200
with message-id <YlZuJ+wMdWzNiobs@alf.mars>
and subject line Re: Bug#1009309: udhcpc: allow usage without busybox
has caused the Debian Bug report #1009309,
regarding udhcpc: allow usage without busybox
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1009309: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009309
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: busybox
Version: 1:1.30.1-7
Severity: wishlist
Tags: patch

Hi Aurelien,

would it be possible to avoid the udhcpc -> busybox dependency? It may
seem strange to remove busybox in a quest to reduce file system usage at
first, but if you need iproute2 for other reasons, it should be fine at
providing what udhcpc needs. I'm attaching a patch so you can judge the
impact.

If that's not a reasonable move forward, how about demoting the
dependency to Recommends? Admittedly, the case of using udhcpc without
using its default script is rare, so I wasn't convinced about that
approach yet.

What do you think?

Helmut
diff --minimal -Nru busybox-1.30.1/debian/changelog busybox-1.30.1/debian/changelog
--- busybox-1.30.1/debian/changelog	2021-08-22 16:39:45.000000000 +0200
+++ busybox-1.30.1/debian/changelog	2022-04-11 13:59:07.000000000 +0200
@@ -1,3 +1,10 @@
+busybox (1:1.30.1-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Allow using udhcpc without busybox. (Closes: #-1)
+
+ -- Helmut Grohne <helmut.grohne@intenta.de>  Mon, 11 Apr 2022 13:59:07 +0200
+
 busybox (1:1.30.1-7) unstable; urgency=medium
 
   [ Debian Janitor ]
diff --minimal -Nru busybox-1.30.1/debian/control busybox-1.30.1/debian/control
--- busybox-1.30.1/debian/control	2021-08-22 11:37:14.000000000 +0200
+++ busybox-1.30.1/debian/control	2022-04-11 13:59:04.000000000 +0200
@@ -104,7 +104,7 @@
 Section: net
 Architecture: linux-any
 Depends:
- busybox (>> ${source:Upstream-Version}) | busybox-static (>> ${source:Upstream-Version}),
+ busybox (>> ${source:Upstream-Version}) | busybox-static (>> ${source:Upstream-Version}) | iproute2,
  ${misc:Depends},
 Description: Provides the busybox DHCP client implementation
  Busybox contains a very small yet fully functional RFC compliant DHCP
diff --minimal -Nru busybox-1.30.1/debian/tree/udhcpc/etc/udhcpc/default.script busybox-1.30.1/debian/tree/udhcpc/etc/udhcpc/default.script
--- busybox-1.30.1/debian/tree/udhcpc/etc/udhcpc/default.script	2019-08-07 23:12:03.000000000 +0200
+++ busybox-1.30.1/debian/tree/udhcpc/etc/udhcpc/default.script	2022-04-11 13:58:08.000000000 +0200
@@ -12,28 +12,33 @@
     logger -t "udhcpc[$PPID]" -p daemon.$1 "$interface: $2"
 }
 
+command -v ip >/dev/null && ip_exe=ip || ip_exe="busybox ip"
+command -v awk >/dev/null && awk_exe=awk || awk_exe="busybox awk"
+
 case $1 in
     bound|renew)
 
 	# Configure new IP address.
 	# Do it unconditionally even if the address hasn't changed,
 	# to also set subnet, broadcast, mtu, ...
-	busybox ifconfig $interface ${mtu:+mtu $mtu} \
-	    $ip netmask $subnet ${broadcast:+broadcast $broadcast}
+	[ -n "$mtu" ] && $ip_exe link set dev $interface mtu $mtu
+	$ip_exe -4 addr flush dev $interface
+	$ip_exe -4 addr add $ip/$subnet ${broadcast:+broadcast $broadcast} \
+	    dev $interface
 
 	# get current ("old") routes (after setting new IP)
-	crouter=$(busybox ip -4 route show dev $interface |
-	          busybox awk '$1 == "default" { print $3; }')
+	crouter=$($ip_exe -4 route show dev $interface |
+	          $awk_exe '$1 == "default" { print $3; }')
 	router="${router%% *}" # linux kernel supports only one (default) route
 	if [ ".$router" != ".$crouter" ]; then
 	    # reset just default routes
-	    busybox ip -4 route flush exact 0.0.0.0/0 dev $interface
+	    $ip_exe -4 route flush exact 0.0.0.0/0 dev $interface
 	fi
 	if [ -n "$router" ]; then
 	    # special case for /32 subnets: use onlink keyword
 	    [ ".$subnet" = .255.255.255.255 ] \
 		    && onlink=onlink || onlink=
-	    busybox ip -4 route add default via $router dev $interface $onlink
+	    $ip_exe -4 route add default via $router dev $interface $onlink
 	fi
 
 	# Update resolver configuration file
@@ -53,9 +58,9 @@
 	;;
 
     deconfig)
-	busybox ip link set $interface up
-	busybox ip -4 addr flush dev $interface
-	busybox ip -4 route flush dev $interface
+	$ip_exe link set $interface up
+	$ip_exe -4 addr flush dev $interface
+	$ip_exe -4 route flush dev $interface
 	[ -x /sbin/resolvconf ] &&
 	    resolvconf -d "$interface.udhcpc"
 	log notice "deconfigured"

--- End Message ---
--- Begin Message ---
Control: tags -1 + moreinfo

On Wed, Apr 13, 2022 at 09:13:58AM +0300, Michael Tokarev wrote:
> No, as far as I understand. B/c udhcpc package lacks the main binary
> if there's no busybox... ;)
> 
> Can you explain please? :)

Head -> table. I now understand why udhcpc is so small. Thank you for
your kind reply. There is nothing to change here. I'll look into the
reverse (and usual) solution to space saving: replace everything else
with busybox.

On a related note, I have been wondering whether we could somehow put
the integration of busybox on more solid footing. A possible route could
be adding tiny symlink packages e.g. iproute2-minimal containing ip,
kmod-minimal containing lsmod and friends or procps-minimal containing
top et al. These would have to conflict with iproute2, kmod and procps
respectively as they're sharing paths. To make that actually useful,
downstream packages could update their depends to foo | foo-minimal when
they are known to work with busybox. If toybox wants to join, -minimal
would refer to the minimal baselines provided by both busybox and
toybox. It's a lot of small packages and metadata though. I'm not
convinced yet and merely sharing thoughts. Properly minimizing Debian
chroots with busybox is not a "it just works" experience yet.

Helmut

--- End Message ---

Reply to: