Switching to randomly generated hostnames

Martin Langhoff martin.langhoff at gmail.com
Wed May 2 03:18:59 EDT 2012

On Tue, May 1, 2012 at 11:29 AM, Daniel Drake <dsd at laptop.org> wrote:
> In Nicaragua we are seeing cases where XOs have no hostname set, both
> on XO-1 and XO-1.5. On XO-1 this is presumably because libertas
> usb8388 init was never 100% reliable, and on XO-1.5 its presumably
> because the wireless card was DOA but was replaced after first boot.

That is happening too on 12.1.0 on XO-1.75 right now for me. I've been
looking at the exact problem, with comments at

To summarize:

1 - the code to setup /etc/sysconfig/network is in the wrong place --
it should trigger boot that /etc/sysconfig/network is missing

2 - yes, libertas init is slow, I've implemented a draft patch that
waits for it to complete with something smarter than "sleep" -- with
this patch, it seems to succeed 100% of the time for me. Not of the
wlan is DOA, but in that case fixing #1 addresses the problem.

3 - I think it gets better if we load drivers early on olpc-configure,
but as long as we wait for it we're fine

See draft patch addressing #2 and #3 at

> We could harden up our initialisation to work better in the face of no
> MAC address being available on first boot, but actually that is
> becoming more complicated (due to increased parallelisation, the
> network adapter will now come up late in boot).

OK - but we only need to wait for it for first boot. Maybe we can tidy
up my code in the patch above, unless you think it is fundamentally

We could move it to a separate init script. We could setup a udev
script when eth0 appears -- can a udev script tell systemd to restart

> I propose we move to generating hostnames in the same format as before

I am not against this alternative plan but TBH I think the problem of
waiting for certain devices is one we need to address in general in
this wild systemd world. The USBVGA support put me on this track.
Maybe we need to evolve that "waitforpath" function to a

Even in this modern systemd + udev world, some devices you need to
configure during startup. Today systemd doesn't have good support for
that,  the udev settle "service" is a pretty blunt tool.


 martin.langhoff at gmail.com
 martin at laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

More information about the Devel mailing list