[Buildroot] [PATCH] package/skeleton: add a startup script to wait for slow network interfaces
Maxime Hadjinlian
maxime.hadjinlian at gmail.com
Sat Oct 3 18:29:08 UTC 2015
On Sat, Oct 3, 2015 at 5:47 PM, Thomas Petazzoni <
thomas.petazzoni at free-electrons.com> wrote:
> Hello,
>
> On Sat, 3 Oct 2015 14:31:45 +0100, Yann E. MORIN wrote:
>
> > + printf "Waiting for interface %s to appear" "${IF}"
> > + wait=${WAIT_DELAY}
> > + while [ ${wait} -gt 0 ]; do
> > + if [ -e "/sys/class/net/${IF}" ]; then
> > + printf " yes\n"
> > + return 0
> > + fi
> > + sleep 1
> > + printf "."
> > + : $((wait--))
> > + done
>
> One thing that I really like in Buildroot is that by default, it
> generates you a system that boots really fast. People often don't have
> to do anything special with Buildroot to make it boot fast. So having a
> shell script that is installed by default and does a "sleep 1" in a
> loop is not very nice :-/
>
> Though I agree that it will only slow the boot on systems where the
> network interfaces are not available immediately at boot time.
>
I have that trouble too but instead of doing a sleep 1, I "hammer" the
system with sleep 0.1 or usleep 25 if it's available (even usleep 1 can
work, since it's not RT, it takes around 10ms).
This way it's almost transparent and add the necessary requirements before
going on with the boot.
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151003/e4cf1363/attachment-0002.html>
More information about the buildroot
mailing list