All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Problmes with eth0 on Raspberry Pi 3B+
@ 2018-09-04 10:58 Oscar Gomez Fuente
  2018-09-04 12:31 ` Nicolas Cavallari
  2018-09-11 18:21 ` Oscar Gomez Fuente
  0 siblings, 2 replies; 5+ messages in thread
From: Oscar Gomez Fuente @ 2018-09-04 10:58 UTC (permalink / raw)
  To: buildroot

Hi everyone,

I am using the last Buildroot version from GIT:
2989e3c87a1123350728904fd789ad513e76b073 and I've noticed that
buildroot init as fast that it seems to be the eth0 device it isn't
ready yet. Afert it inits if I execute: ifup eth0, it works fine. The
same method with the raspberry Pi 3B works fine.

I know you can configure the /etc/network/interfaces with a command to
wait, and I did:
...
auto eth0
iface eth0 inet manual
       wait-delay 10
        pre-up ifconfig eth0 up
        pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
        pre-up /etc/network/nfs_check
        post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
        post-down ifconfig eth0 down
..

But it doesn't work. So I decided to place a sleep manually:
...
auto eth0
iface eth0 inet manual
        pre-up while [ ! -e /sys/class/net/eth0 ]; do sleep 0.1; done;
        pre-up ifconfig eth0 up
        pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
        pre-up /etc/network/nfs_check
        post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
        post-down ifconfig eth0 down

And this method works fine, but I think it isn't the proper way to do
it So my conclusion is the command wait-delay isn't work properly.

Could there be a bug in the script /etc/network/if-pre-up.d/wait_iface?

Best regards.

Oscar Gomez Fuente.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Problmes with eth0 on Raspberry Pi 3B+
  2018-09-04 10:58 [Buildroot] Problmes with eth0 on Raspberry Pi 3B+ Oscar Gomez Fuente
@ 2018-09-04 12:31 ` Nicolas Cavallari
  2018-09-04 21:17   ` Peter Korsgaard
  2018-09-11 18:21 ` Oscar Gomez Fuente
  1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Cavallari @ 2018-09-04 12:31 UTC (permalink / raw)
  To: buildroot

On 9/4/18 12:58 PM, Oscar Gomez Fuente wrote:
> auto eth0
> iface eth0 inet manual
>        wait-delay 10
>         pre-up ifconfig eth0 up
>         pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
>         pre-up /etc/network/nfs_check
>         post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
>         post-down ifconfig eth0 down

pre-up will run before the wait_iface hook.  For things that are actually
configuring the interface, you should use up.
(and ifconfig is a bid deprecated these days)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Problmes with eth0 on Raspberry Pi 3B+
  2018-09-04 12:31 ` Nicolas Cavallari
@ 2018-09-04 21:17   ` Peter Korsgaard
  2018-09-05  7:24     ` Nicolas Cavallari
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2018-09-04 21:17 UTC (permalink / raw)
  To: buildroot

>>>>> "Nicolas" == Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr> writes:

 > On 9/4/18 12:58 PM, Oscar Gomez Fuente wrote:
 >> auto eth0
 >> iface eth0 inet manual
 >> wait-delay 10
 >> pre-up ifconfig eth0 up
 >> pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
 >> pre-up /etc/network/nfs_check
 >> post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
 >> post-down ifconfig eth0 down

 > pre-up will run before the wait_iface hook.  For things that are actually
 > configuring the interface, you should use up.
 > (and ifconfig is a bid deprecated these days)

Correct. In addition to that, what is the reason why you manually run
udhcpc instead of just using 'iface eth0 inet dhcp'?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Problmes with eth0 on Raspberry Pi 3B+
  2018-09-04 21:17   ` Peter Korsgaard
@ 2018-09-05  7:24     ` Nicolas Cavallari
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Cavallari @ 2018-09-05  7:24 UTC (permalink / raw)
  To: buildroot

On 04/09/2018 23:17, Peter Korsgaard wrote:
>>>>>> "Nicolas" == Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr> writes:
> 
>  > On 9/4/18 12:58 PM, Oscar Gomez Fuente wrote:
>  >> auto eth0
>  >> iface eth0 inet manual
>  >> wait-delay 10
>  >> pre-up ifconfig eth0 up
>  >> pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
>  >> pre-up /etc/network/nfs_check
>  >> post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
>  >> post-down ifconfig eth0 down
> 
>  > pre-up will run before the wait_iface hook.  For things that are actually
>  > configuring the interface, you should use up.
>  > (and ifconfig is a bid deprecated these days)

(s/bid/bit/, sorry for the typo)

> 
> Correct. In addition to that, what is the reason why you manually run
> udhcpc instead of just using 'iface eth0 inet dhcp'?

This probably have to do with the fact that the udhcpc options that are used
with method=dhcp are only configurable through a non-obvious way which is the
busybox Kconfig option CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS.

Or it could be the real ifupdown which does not really allow the user to
configure the udhcpc parameters easily. Or the desire to be compatible with both.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Problmes with eth0 on Raspberry Pi 3B+
  2018-09-04 10:58 [Buildroot] Problmes with eth0 on Raspberry Pi 3B+ Oscar Gomez Fuente
  2018-09-04 12:31 ` Nicolas Cavallari
@ 2018-09-11 18:21 ` Oscar Gomez Fuente
  1 sibling, 0 replies; 5+ messages in thread
From: Oscar Gomez Fuente @ 2018-09-11 18:21 UTC (permalink / raw)
  To: buildroot

Hi everyone,


I've got problems with the buildroot email and I didn't receive any
message, but I could see the answers in this link:
http://lists.busybox.net/pipermail/buildroot/2018-September/229775.html
so I'm going to try to answer again in order to get some support and
check if the buildroot list emails works.

Hi Nicollas, it seems to be that pre-up before wait-delay it doesn't
work, and it seems to be that wait-delay only works if you select inet
dhcp, so I have to find an alternative method to wait-delay or create
a new script for me. The way I'm using right now it is not too bad:
...
pre-up while [ ! -e /sys/class/net/eth0 ]; do sleep 0.1; done;
...
And according to :"ifconfig is a bid deprecated these days", yes you
are right, I am going to use something like:
...
pre-up ip link set dev eth0 up
...

Hi Peter,  I am using this way because when I connect and disconnect
the ethernet cable it doesn't work dhcp and the eth0 don't get the ip
properly.


Best regards.





Oscar Gomez Fuente

On Tue, 4 Sep 2018 at 12:58, Oscar Gomez Fuente <oscargomezf@gmail.com> wrote:
>
> Hi everyone,
>
> I am using the last Buildroot version from GIT:
> 2989e3c87a1123350728904fd789ad513e76b073 and I've noticed that
> buildroot init as fast that it seems to be the eth0 device it isn't
> ready yet. Afert it inits if I execute: ifup eth0, it works fine. The
> same method with the raspberry Pi 3B works fine.
>
> I know you can configure the /etc/network/interfaces with a command to
> wait, and I did:
> ...
> auto eth0
> iface eth0 inet manual
>        wait-delay 10
>         pre-up ifconfig eth0 up
>         pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
>         pre-up /etc/network/nfs_check
>         post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
>         post-down ifconfig eth0 down
> ..
>
> But it doesn't work. So I decided to place a sleep manually:
> ...
> auto eth0
> iface eth0 inet manual
>         pre-up while [ ! -e /sys/class/net/eth0 ]; do sleep 0.1; done;
>         pre-up ifconfig eth0 up
>         pre-up /sbin/udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
>         pre-up /etc/network/nfs_check
>         post-down kill -9 $(cat /var/run/udhcpc.eth0.pid)
>         post-down ifconfig eth0 down
>
> And this method works fine, but I think it isn't the proper way to do
> it So my conclusion is the command wait-delay isn't work properly.
>
> Could there be a bug in the script /etc/network/if-pre-up.d/wait_iface?
>
> Best regards.
>
> Oscar Gomez Fuente.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-11 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 10:58 [Buildroot] Problmes with eth0 on Raspberry Pi 3B+ Oscar Gomez Fuente
2018-09-04 12:31 ` Nicolas Cavallari
2018-09-04 21:17   ` Peter Korsgaard
2018-09-05  7:24     ` Nicolas Cavallari
2018-09-11 18:21 ` Oscar Gomez Fuente

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.