I compile a driver following the documentations. But when I try loading them via
insmod onebox_wlan_nongpl.ko, I receive an error message:
insmod: Error: could not insert module onebox_wlan_nongpl.ko: Unknown symbol in module
I know this is due to wrong order of loading .ko files but it does not tell me which module does it depend on. I would like to know what symbol is unknown to file the module that I should load first.
2 Answers
You can simply check the missing symbols in dmesg using dmesg | tail. If you want to check if the symbols are actually in your symbol table, check using cat /proc/kallsyms | grep <function_name>Similar issue:
To see which symbols are actually missing, look into the kernel log using dmesg.
It will show you the exact symbols.
If you wrote the kernel module yourself and it for example relies on a framework like the device mapping framework, the dependecy has to be loaded first. Here an example I ran into:
I wrote a device mapper, which depends on the device mapping framework. On insertion, this happens:
$ sudo insmod some-module.ko
insmod: ERROR: could not insert module some-module.ko: Unknown symbol in moduleInspect the kernel log:
$ sudo dmesg
[ XX.XXXXXX] some-module.ko: Unknown symbol dm_per_bio_data (err -2)
[ XX.XXXXXX] some-module.ko: Unknown symbol dm_put_device (err -2)
...Inspect the loaded modules:
$ lsmod | grep dm
<NOTHING>Insert the device mapping target driver:
$ sudo modprobe dm_mod
$ lsmod | grep dm
dm_mod 184320 0Now insert the original module an the error is resolved.