Skip to contentSkip to conversation

Controlling uchcpc in busybox

DISCUSSION Gary Thomas 1 participant 1 message Aug 4, 2011

lore
Share & tools
lore
#0 lore raw

Note: I know this is a very busybox oriented question, but the problem affects my Poky based system and I'm hoping to find an answer here :-)

I have some interfaces which are very slow to come up on boot. When I try to use DHCP on these interfaces, often they will fail before the device negotiates a link (these are fibre channel devices which can take 15 seconds to "come up"). Using the default /etc/network/interfaces syntax, I have:
auto eth0
iface eth0 inet dhcp
This causes the busybox 'ifup' command to be run on the interface which in turn runs 'udhcpc' with the default options of "-R -n" With the other [compiled in] default options, the command only tries for 9 seconds to get an address, but in many cases, this is not long enough.

I'd like to be able to control the timeout regimen on this for my sluggish interfaces, but I can't figure out how to do it in the interfaces file. Is there a way to make 'ifup' send additional
options to 'udhcpc'? To date, I just modified the default options
when busybox gets built to include the ones I want, but this is terribly heavy handed! (see attached .bbappend file)

Ideas?

BTW, I find .bbappend very useful (even when I can't spell) in that I can most times find ways to fix problems [most of which aren't necessary for normal folks] without having to touch the mainline repository.

Thanks

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

#
# Just tell BitBake where to find my component files
#
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:${THISDIR}/${PN}:"

PR .= ".1"

do_prepare_config_append () {
sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n -T 1 -t 20"/' ${S}/.config
}