Linux: modpost does not build anything
The error mysteriously went away. If anyone has an idea what could cause this. I'd like to know in case there is a next time.
kernel driver external modules not building completely
I found the solution. I really misunderstood the error messages and how ".ko" modules interact with the kernel. An external module resolves externals (at least some) at compile/link time not at run time. This is why I get the 4 "ERRORS".
That said, my "GobiNet" is looking for external symbols not present in my Kernel set-up. A few quick greps allowed me to find it needed "drivers/net/usb/usbnet.c". This required CONFIG_USBNET = y to be set in the ".config" file (set through "make xconfig"). Hope it can help someone else.
EDIT: To answer the question about "a few quick greps". What I meant is I search all the source files containing the missing names. It will tell me what file defines that symbol. Then, I can find what variable should be set to "y" to include it in the compile. Here is an example:
grep -r --include="*.c" "usbnet_probe"
You execute that in the terminal from the folder you want to search from and down recursively (-r option). grep is extremely useful to find text in large amount of files. I often don't remember the specific but a quick Google search gives you how to perform some very tricky searches you never thought could be done so easily.
Problems building driver on Linux kernel 5.8.x
I am answering my own question in case it helps anyone else with this problem. Although it has never been an issue in the past, we've always had a warning that the corresponding .o.cmd file was not present for our .o_shipped files. This appears to be important in kernel 5.8 onwards and my fix was to add a touch command to the Kbuild file (i.e. "touch .driver.o.cmd"). This does not remove the warning but it allows the driver to build as normal.
Command 'make modules' doesn't build all modules
Ok, after several cups of coffee and lots of googling, I don't know how this all works yet, but looks like when I first upgraded the kernel, the .config was based on the running kernel's config and it includes all the needed modules, therefore it ran fine? Then somehow on the subsequent compilations almost all of the modules were not configured in the .config (except the 4 mentioned above). Long story short, I used the old .config and ran menuconfig to make additional changes, it seems to solve my problem. Thanks!
Kernel module not building .ko file
Ok, I have figured out the problem. I am having square bracket character "[" in the module source directory
LD [M] /home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/os/linux/ar6000.o
Removing this from the path worked well and I got my kernel module object files. I have renamed
ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553
to
ar6003,
and also tested with
ar6003_3.1_RC_Linux_release_posted_2011_8_19_olca3.1RC_553
Both worked fine. I was building on Ubuntu 10.04. A colleague of mine has built from the same sources having "[" character in his path on Ubuntu 11.04 and kernel module object file was building nicely, this also suggest the changed behavior of grep / find / awk or such utility among their different versions, which kernel build system is using, resulting in this issue.
Regards,
Farrukh Arshad.
Related Topics
A Modification to %Esp Cause Sigsegv
Makefile with Multiple Targets
Matlab Mex Socket Wrapper Library
Copy Files from Windows to Windows Subsystem for Linux (Wsl)
What's the Difference Between Event-Driven and Asynchronous? Between Epoll and Aio
How to Create Virtual Ethernet Devices in Linux
What Is Start-Stop-Daemon in Linux Scripting
How to Run R Scripts on Servers Without X11
Get the Last 4 Characters of Output from Standard Out
What Is the Recommended Way to Perform Source-Level Debugging of System Library Calls
Linux. Sol_Netlink Not Defined
Dyld_Library_Path Environment Variable Is Not Forwarded to External Command in Makefile on MACos
Is It Safe to Delete the Journal File of Mongodb
How to Get the Nvidia Driver Version from the Command Line
How to Define a Bash Alias as a Sequence of Multiple Commands