[Buildroot] [PATCH] package/skeleton: add a startup script to wait for slow network interfaces

Peter Korsgaard peter at korsgaard.com
Mon Oct 19 10:15:40 UTC 2015


>>>>> "Jérôme" == Jérôme Pouiller <jezz at sysmic.org> writes:

Hi,

> I am a bit late to do the review, but why not add a script in 
 > /etc/network/if-pre-up.d ? For example (notice $IFACE and $IF_MAXWAIT 
 > are set by ifupdown):

 > #! /bin/sh
 > if [ "${IF_MAXWAIT}" ]; then
 >     printf "Waiting for interface %s to appear" "${IFACE}"
 >     while [ ${IF_MAXWAIT} -gt 0 ]; do
 >         if [ -e "/sys/class/net/${IFACE}" ]; then
 >             printf " yes\n"
 >             exit 0
 >         fi
 >         sleep 1
 >         printf "."
 >         : $((wait--))
 >     done
 >     printf " no.\n"
 >     exit 1
 > fi

That's certainly also an option. Care to send a patch reworking the
logic in S40network to a pre-up.d hook?

 > Next, interface would use "maxwait" property in /etc/network/interface:

 > auto eth0
 > iface eth0 inet dhcp
 >     maxwait 15

Then our BR2_SYSTEM_DHCP logic should probably also be adapted to add
'maxwait 15' by default.

Thanks!

-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list