System crash while insert and remove ethernet mod


#1

My device is arm board with two ethernet phy and using nxp driver which do not work well with dual ethernet phys. I find it always crash when i operate things about ethernet. And sometime Ethernet ports crash when i use console-config to configure network. It seem that something is watching on network…
For some reasons,i need to insert ethernet mod separately,then remove it and insert it again, it can be done and work well in normal linux,but crashed in ubuntu core.It print that:

rmmod: ERROR: …/libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file ‘/lib/modules/4.15.18-ge329841-dirty’

If it’s possible to insert and remove mod before ubuntu core completely initial network using /etc/init.d file?And if the network is managed strict by ubuntu core?


#2

is this driver an out of tree one ? this looks more like a module was added to your kernel snap but the module dependency database was not updated afterwards by running depmod with the right options …


#3

Hi ogra:
i build it in module not in kernel and the ethernet ports do not work before i insert the driver. and if i insert the ethernet module and remove it using insmod fec.ko and rmmod fec. it will report that error. and other module will not.
you mean it is inserted in kernel but do not update information so when i remove it, it can not be found here?
Normally how can i load/remove modules in core?


#4

kmod (the thing printing your error) checks module dependencies by reading modules.dep and friends in /lib/modules/<kernelversion>/ when you add an out-of-tree module this database will not have an entry and modprobe/rmmod will not be able to resolve module dependencies … but i see you are using fec.ko, that should be a module living in the mainline tree and if your devicetree properly defined an entry (and has set “status: ok” for it) for it it should just be auto-loaded without you needing to do the rmmod/insmod dance…


#5

it’s something wrong with the driver on my board. the second phy do not work until i reload the module…so i want to make it load-remove-reload at the board initial before i solve this problem…and it works well in linux…
i do not use snapcraft to build this module, i just change .config in /parts/kernel/build and build it…
if it will add dependencies while snapcrafting it?So I need to add it to snapcraft.yaml and snap it in kernel.snap?


#6

you should try to incorporate that step into your build process somehow … and make sure that depmod (which the kernel calls by default during a build) gets re-run after you added your module … take a look at how i hacked the xradio out of tree driver into my linux-generic-allwinner snap and how i re-run depmod during the prime step to get the modules.dep and friends updated: