ifup not passing hostname to udhcpc

Jim Sheldon jim.sheldon at gmail.com
Wed Oct 6 19:50:51 UTC 2010


Greetings!

I have a device running busybox 1.13.2.  When ifup kicks off udhcpc, I
would like it to have these arguments:

udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0 -H <hostname>

However, so far I can't get '-H <hostname>' to come through.

Looking through networking/ifupdown.c I see:

       { "udhcpc",
               "udhcpc -R -n -p /var/run/udhcpc.%iface%.pid -i
%iface%[[ -H %hostname%]][[ -c %clientid%]]"
                               "[[ -s %script%]][[ %udhcpc_opts%]]",
               "kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
       },

So clearly [[ -H %hostname%]] is not working for some reason.

I'm assuming this must be an environment variable, or read from the
system somehow? I tried adding 'hostname=myhost' in
/usr/share/udhcpc/default.script and /etc/udhcpc.d/50default, neither
worked.

I have a proper hostname set in /etc/hostname, does busybox expect it
to be somewhere else?

Thanks,
Jim


More information about the busybox mailing list