From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/skeleton: add a startup script to wait for slow network interfaces
Date: Sat, 3 Oct 2015 19:43:59 +0100 [thread overview]
Message-ID: <561021EF.7020105@mind.be> (raw)
In-Reply-To: <CAGduivwa-qfDjTNoryRgCV=ZCmDVUa5A8TXTYLbzZ7mcJOY-fA@mail.gmail.com>
On 03-10-15 19:29, Maxime Hadjinlian wrote:
>
>
> On Sat, Oct 3, 2015 at 5:47 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com
> <mailto:thomas.petazzoni@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).
Since sysv init is not parallel, you're not even hammering the system since
nothing else is going on except perhaps some hotplug callbacks.
Regards,
Arnout
> 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 <mailto:buildroot@busybox.net>
> http://lists.busybox.net/mailman/listinfo/buildroot
>
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
next prev parent reply other threads:[~2015-10-03 18:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 13:31 [Buildroot] [PATCH] package/skeleton: add a startup script to wait for slow network interfaces Yann E. MORIN
2015-10-03 13:51 ` Arnout Vandecappelle
2015-10-03 13:59 ` Peter Korsgaard
2015-10-03 14:01 ` Peter Korsgaard
2015-10-16 9:42 ` Peter Korsgaard
2015-10-03 15:47 ` Thomas Petazzoni
2015-10-03 18:29 ` Maxime Hadjinlian
2015-10-03 18:43 ` Arnout Vandecappelle [this message]
2015-10-03 18:46 ` Maxime Hadjinlian
2015-10-04 8:23 ` Peter Korsgaard
2015-10-19 8:47 ` Jérôme Pouiller
2015-10-19 10:15 ` Peter Korsgaard
2015-10-19 10:22 ` Jérôme Pouiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=561021EF.7020105@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox