I'm setting up an embedded system that is built using the Yocto project. This outputs a root file system, kernel, u-boot, etc. I have an installer script that I run from an SD card that configures the eMMC on the board with partitions, copies in the rootfs, uboot, etc. It produces a bootable system when I boot from eMMC.
The problem I'm having is with the ethernet driver. Is isn't installed on the system by default. The installation script copies it to
/lib/modules/4.14.98-imx8mq+gea48c83/kernel/drivers/net/ethernet/freescale/fec.ko and I can log in over serial and manually load it with
insmod, and that works fine. But I'm not sure how to get it to load automatically.
Systemd looks in
/etc/modules-load.d/ for lists of modules to load, but this process seems to use modprobe and not insmod. The modprobe system doesn't really know about the ethernet driver because I haven't run depmod on it. But I can't run depmod from the installer because it would install it on my SD card installation, not on the eMMC.
What is my best approach here? Do I need to find some way to run depmod during the installation? Maybe it could be done with chroot?
Or is there a good way to get my module to load automatically without using the depmod/modprobe system?
Any insight here would be very appreciated.