while building kernel modules why do we need /lib/modules?
It is not necessary to give the above option ie the /lib/modulesmain intention is to get configured source-code directory.
You can install directly configured source code, or you can provide above ie / lib / modules /, which have a programmatic link for the embedded source code.
KDIR,
( ) ( ).
1)Full kernel sources
2)Only kernel headers (linux-headers-* packages in
Debian/Ubuntu distributions)
configured. macros or functions depend on the configuration
-C kernel Makefile, module
directory in the M variable ,the kernel Makefile knows how to compile a module.
, Arm architecture or machine, configured kernel Makefile , .
needs access to the kernel
headers, containing the defnitions of functions, types and
constants.
Can it be build solely?
, , , , ,
. toplevel Makefile of configured kernel.