Why are CFG80211 symbols missing when loading a kernel module? - module

I have been given wireless driver which I have integrated in my Yocto project. The .config that the kernel is using has the following flag set:
CONFIG_CFG80211=m
This should compile the kernel with CFG80211 as a module. However, when I try to load MY_MODULE with this command:
insmod MY_MODULE.ko fw_name=mrvl/MY_MODULE.bin cfg80211_wext=0xf cal_data_cfg=none fw_serial=0
The module fails to load with:
insmod: ERROR: could not insert module MY_MODULE.ko: Unknown symbol in module
The reason of the failure is that CFG80211 symbols are not present when loading the module. This can be seen when running dmesg:
[ 1534.508504] sd8xxx: Unknown symbol mlan_main_process (err 0)
[ 1534.508560] sd8xxx: Unknown symbol cfg80211_sched_scan_results (err 0)
[ 1534.508704] sd8xxx: Unknown symbol cfg80211_rx_assoc_resp (err 0)
[ 1534.508847] sd8xxx: Unknown symbol cfg80211_scan_done (err 0)
[ 1534.508911] sd8xxx: Unknown symbol cfg80211_sched_scan_stopped (err 0)
[ 1534.508948] sd8xxx: Unknown symbol mlan_shutdown_fw (err 0)
[ 1534.509037] sd8xxx: Unknown symbol mlan_rx_process (err 0)
[ 1534.509064] sd8xxx: Unknown symbol cfg80211_remain_on_channel_expired (err 0)
[ 1534.509077] sd8xxx: Unknown symbol cfg80211_cac_event (err 0)
...
I tried to manually load the CFG80211 module but it is not present in the lib/modules/3.14.55-yocto-standard/kernel/net folder. Currently available modules in those folder are:
./kernel/net/wireless
./kernel/net/wireless/lib80211_crypt_tkip.ko
./kernel/net/wireless/lib80211_crypt_ccmp.ko
./kernel/net/wireless/lib80211.ko
./kernel/net/wireless/lib80211_crypt_wep.ko
Why are CFG80211 symbols missing when loading a kernel module? Should I have a loadable 80211.ko or I am missing something else?

Yocto does not ship kernel modules by default. You can include all kernel modules in your image by adding kernel-modules package. This is usually done within MACHINE_EXTRA_RRECOMMENDS or MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS in your machine conf file, so that people can say they actually don't want all kernel modules (it can take a lot of storage space).
If you want to include this module, its name is probably kernel-cfg80211 (you can find out by using oe-pkgdata-util find-path cfg80211.ko). Since it's needed for another module, I'd add it to MACHINE_EXTRA_RDEPENDS or MACHINE_ESSENTIAL_EXTRA_RDEPENDS still in your machine conf file.
You cannot realistically add it to the RDEPENDS of your other kernel module recipe because it would break your build if someone were to compile 80211 support directly in the kernel and not as a module. Other solution is to use RRECOMMENDS in the module recipe or put it where your kernel module package is added to the image (in the image recipe or wherever it's added).

Related

Gradle, error: module not found: kotlin.logging

These are my dependencies in build.gradle.kts:
implementation("io.github.microutils:kotlin-logging:1.7.8")
implementation("org.slf4j:slf4j-api:1.7.29")
Then in module-info.java:
requires kotlin.logging;
All the rest works fine with the Java modular approach
However whenever I try to build, then I get:
> Task :compileJava FAILED
6 actionable tasks: 6 executed
C:\Users\elect\IdeaProjects\assimp\src\main\java\module-info.java:13: error: module not found: kotlin.logging
requires kotlin.logging;
What am I doing wrong?
Automatic module name
PS C:\Users\elect> jar --file=C:\Users\elect\.gradle\caches\modules-2\files-2.1\io.github.microutils\kotlin-logging-jvm\2.0.3\acd404001442be5d98fbaa7ff9df83041cba70fe\kotlin-logging-jvm-2.0.3.jar --describe-module
No module descriptor found. Derived automatic module.
kotlin.logging.jvm#2.0.3 automatic
requires java.base mandated
contains mu
contains mu.internal

After infinispan 10.1.8 update: class file for org.infinispan.factories.scopes.Scopes not found

I just tried to update my application to Infinspan 10.1.8.Final. I am using Infinispan as a level-2 hibernate (5.4.18.Final) cache via this dependency in build.gradle:
compile group: 'org.infinispan', name: 'infinispan-hibernate-cache-v53', version: '10.1.8.Final'
The application compiles and starts, but the following is logged when I run the test suite:
warning: unknown enum constant Scopes.GLOBAL
reason: class file for org.infinispan.factories.scopes.Scopes not found
warning: unknown enum constant DataType.TRAIT
reason: class file for org.infinispan.jmx.annotations.DataType not found
Why is this happening? Do I need to include another dependency?
Try adding compileOnly 'org.infinispan:infinispan-component-annotations:10.1.8.Final' to the dependencies in your build.gradle file.
Both enums aren't required at runtime. They are using in compile time to generate metadata required by Infinispan.

Specify Fortran module compile order with CMake

My Fortran project has a target comprised of a module containing helper functions and a few generated source files for tests. The test modules all use the helper module (i.e. use test_tools). I'm building with CMake, so the source list looks like
add_custom_command(
# here's where I'm doing the stuff to generate test_SR#.F90
GENERATED
)
set(SOURCES
test_tools.F90
test_SR1.F90 # contains `use test_tools`
test_SR2.F90 # contains `use test_tools`
...
test_SR20.F90 # contains `use test_tools`
)
This compiles fine on macOS and Linux, but on Windows with the Visual Studio 15 2017 generator test_tools.F90 is not compiled before test_SR#.F90 so on the first attempt the compile fails.
6> ... Done. Results in C:/Users/rmudafor/Desktop/openfast453/build/unit_tests/tests/beamdyn/test_BD_CrvMatrixH.F90
6>Generating ../tests/beamdyn/test_BD_InputGlobalLocal.F90
6>Processing file C:/Users/rmudafor/Desktop/openfast453/unit_tests/../modules/beamdyn/tests/test_BD_InputGlobalLocal.F90
6> ... Done. Results in C:/Users/rmudafor/Desktop/openfast453/build/unit_tests/tests/beamdyn/test_BD_InputGlobalLocal.F90
6>Compiling with Intel(R) Visual Fortran Compiler 19.1.1.216 [Intel(R) 64]...
6>test_BD_InputGlobalLocal.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InputGlobalLocal.F90(19): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InputGlobalLocal.F90(47): error #6404: This name does not have a type, and must have an explicit type. [CALCROTATIONMATRIX]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InputGlobalLocal.F90 (code 1)
6>test_BD_InitShpDerJaco.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InitShpDerJaco.F90(9): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InitShpDerJaco.F90(54): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEPARAMETERTYPE]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InitShpDerJaco.F90 (code 1)
6>test_BD_DistrLoadCopy.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(9): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(32): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEPARAMETERTYPE]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(33): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEMISCVARTYPE]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(34): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEINPUTTYPE]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90 (code 1)
6>test_BD_CrvCompose.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_CrvCompose.F90(14): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_CrvCompose.F90(48): error #6404: This name does not have a type, and must have an explicit type. [CALCROTATIONMATRIX]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_CrvCompose.F90 (code 1)
6>test_BD_GaussPointWeight.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_GaussPointWeight.F90(13): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_GaussPointWeight.F90 (code 1)
6>test_tools.F90 <---- HERE: this one should be compiled before the ones above
6>test_BD_diffmtc.F90
6>test_ExtractRelativeRotation.F90
6>test_BD_CrvMatrixH.F90
6>test_BD_QPData_mEta_rho.F90
6>test_BD_CrvMatrixR.F90
6>test_BD_GenerateGLL.F90
6>test_BD_CrvExtractCrv.F90
6>test_BD_GravityForce.F90
6>test_BD_CheckRotMat.F90
6>driver.F90
6>
6>Build log written to "file://C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\beamdyn\beamdyn_utest.dir\Release\BuildLog.htm"
6>beamdyn_utest - 16 error(s), 0 warning(s)
========== Build: 5 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If I let the build continue to the end, then test_tools will have been compiled and it will succeed the second time. This isn't an issue when I'm doing this manually, but it does prevent automating the build and test sequence.
I'd like to somehow indicate to CMake that it must compile test_tools before any of the test_SR#.F90 modules.
I'm using CMake 3.17 on Windows, Visual Studio 15 2017, and Intel 2020 tools.

Build Linux Kernel module with warning i2c_register_board_info undefined

I follow an example in kernel.org to write an i2c driver but unfortunately when i compile i got this warning
WARNING: "i2c_register_board_info" [/home/pi/builddriver/samplei2c/pn535.ko] undefined!
Although compile with 1 warning and no error, I cannot insmod module. this is error when insmod
insmod: ERROR: could not insert module pn535.ko: Invalid module format
My question is how to solve the warning above?, I think it make .ko file to be invalid. Here is my source code on
pastebin
thank for your help!
That is not possible in a kernel module simply because the function i2c_register_board_info is not exported from the kernel source tree to the kernel modules (built using obj-m targets). You can achieve this by building your driver within the kernel source tree using (obj-y targets).

unknown USB symbols in antique module for linux kernel 2.6.27

I am trying to revive an old linux USB module called Wind River v6 (wndrvr6), originally written for the 2.6.18 or earlier kernels, probably RedHat 5. The oldest kernel I have managed to get running adequately under Virtualbox is 2.6.27 in Fedora 9, and everything works okay except for this one module. I made about 10 changes to the source code to get it to compile with 2.6.27, but when I try to load it, I get
windrvr6: Unknown symbol usb_alloc_urb
windrvr6: Unknown symbol usb_free_urb
windrvr6: Unknown symbol usb_ifnum_to_if
windrvr6: Unknown symbol usb_register_driver
windrvr6: Unknown symbol usb_clear_halt
windrvr6: Unknown symbol usb_submit_urb
windrvr6: Unknown symbol usb_set_interface
windrvr6: Unknown symbol usb_deregister
windrvr6: Unknown symbol usb_kill_urb
I have run "depmod -a", and "depmod -e" gives no output, so all symbols should be accounted for. The symbols above appear in many modules (using the strings command). /proc/kallsyms has the line
ffffffff811efc29 T usb_kill_urb
so these symbols are provided. Why are these symbols not found?
I downloaded the most recent version of the driver from Jungo, which built just fine. When I swapped out the source code files but used the old configure & makefile scripts, then the problem returned. The issue then, whatever it was, was due to a problem with the compilation or installation of the module. At any rate, I now have an installed driver.