How do I connect to internet using ethernet before booting from a SD card in yocto?

Hi!

I want to be connected to internet through ethernet cable before I finish the boot.
I run a .sh script when the boot finishes which uses internet. When I boot via tftp this script works but when I boot from a sd card doesnt work. I have tried to do: setenv ipaddr 192.168.xxx.xxx and then saveenv but didnt work.

What could I do to configure the internet before booting automatically?

ethernet driver loads during kernel boot as any other driver. Once the driver is loaded network manager starts and configures interfaces. You need to call your script after the network manager init.
You can try calling in your script something like:
ifconfig eth0 up
ifconfig eth0 192.168.1.7 netmask 255.255.255.0
or something like that to have network temporarily until network-manager starts

1 Like