How (recipe) to build only one kernel module?
- by Pro Backup
I have a bug in a Linux kernel module that causes the stock Ubuntu 14.04 kernel to oops (crash).
That is why I want to edit/patch the source of only that single kernel module to add some extra debug output. The kernel module in question is mvsas and not necessary to boot. For that reason I don't see any need to update any initrd images.
I have read a lot of information (as shown below) and find the setup and build process confusion. I need two recipes:
to setup/configure the build environment once
steps to do after editing any source file of this kernel module (.c and .h) and converting that edit into a new kernel module (.ko)
The sources that have been used are:
build one kernel module - Google search
http://www.linuxquestions.org/questions/linux-kernel-70/rebuilding-a-single-kernel-module-595116/
http://stackoverflow.com/questions/8744087/how-to-recompile-just-a-single-kernel-module
http://www.pixelbeat.org/docs/rebuild_kernel_module.html
How do I build a single in-tree kernel module?
http://ubuntuforums.org/showthread.php?t=1153067
http://ubuntuforums.org/showthread.php?t=2112166
http://ubuntuforums.org/showthread.php?t=1115593
build one kernel module ubuntu - Google search
'make +single +kernel +module' - Ask Ubuntu
'make +kernel +module' - Ask Ubuntu
My makefile results in: No rule to make target `arch/x86/tools/relocs.c', needed
'"Invalid module format"' - Ask Ubuntu
Driver installation: compiling source code for newer kernel
Modprobe: 'Invalid nodule format', yet works after insmod
"Symbol version dump" "is missing" - Google search
http://stackoverflow.com/questions/9425523/should-i-care-that-the-symbol-version-dump-is-missing-how-do-i-get-one
Where can I find the corresponding Module.symvers and .config files for 12.04.3 i386 server?
"no symbol version for module_layout" when trying to load usbhid.ko
Broken links inside Linux header file folder
'make modules_install' - Ask Ubuntu
'modules_install' - Ask Ubuntu
Empty build directory in custom compiled kernel
Not able to see pr_info output
In which directory are the kernel source files and how can I recompile it?
How can I compile and install that patched libata-eh.c file?
'modules_install +depmod' - Ask Ubuntu
modules_install depmod - Google search
"make modules_install" - Google search
http://www.csee.umbc.edu/courses/undergraduate/CMSC421/fall02/burt/projects/howto_build_kernel.html
http://unix.stackexchange.com/questions/20864/what-happens-in-each-step-of-the-linux-kernel-building-process
https://wiki.ubuntu.com/KernelCustomBuild
http://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html
http://www.linuxforums.org/forum/kernel/170617-solved-make-modules_install-different-path.html
"make prepare" - Google search
"make prepare" "scripts/kconfig/conf --silentoldconfig Kconfig" - Google search
http://ubuntuforums.org/showthread.php?t=1963515
ubuntu "make prepare" version - Google search
http://stackoverflow.com/questions/8276245/how-to-compile-a-kernel-module-against-a-new-source
https://help.ubuntu.com/community/Kernel/Compile
How do I compile a kernel module?
How to add a custom driver to my kernel?
Compile and loading kernel module without compiling the kernel