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


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 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 netmask
or something like that to have network temporarily until network-manager starts

1 Like