mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
update
This commit is contained in:
18
build.md
18
build.md
@@ -2,7 +2,23 @@
|
||||
|
||||
The module building system.
|
||||
|
||||
Kernel modules are built using a makefile located at:
|
||||
Explained at: <https://www.kernel.org/doc/Documentation/kbuild/modules.txt>
|
||||
|
||||
Full method: get the kernel, build it to a directory `$KDIR`, and then run:
|
||||
|
||||
make -C "$KDIR" M="$(PWD)" modules
|
||||
|
||||
Quick method: no need for a full build, just:
|
||||
|
||||
make modules_prepare
|
||||
|
||||
but you lose some functionality. TODO: module insert on host then fails with:
|
||||
|
||||
insmod: ERROR: could not insert module hello.ko: Invalid module format
|
||||
|
||||
even though kernel tree was checked out to match the host.
|
||||
|
||||
Using your distro's kernel version:
|
||||
|
||||
/lib/modules/$(uname -r)/build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user