Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>while building kernel modules why do we need /lib/modules?</code></p> <p>Its not a compulsory to give above option i.e <code>/lib/modules</code> The main intention is to <code>get configured source-code directory</code> .</p> <p>You can set to directly configured source-code or u can provide above i.e /lib/modules/ which having softlink for built source-code.</p> <p><code>KDIR,</code></p> <p>you can either set full kernel source directory (configured and compiled) or just kernel headers directory (minimum needed). Two solutions </p> <p><code>1)Full kernel sources</code></p> <p><code>2)Only kernel headers (linux-headers-* packages in Debian/Ubuntu distributions)</code></p> <p>where in both case The sources or headers must be <code>configured</code>.Many <code>macros or functions depend on the configuration</code></p> <p><code>-C</code> option calls the <code>kernel Makefile</code>, passing the <code>module directory in the M variable ,the kernel Makefile knows how to compile a module</code>.</p> <p>for e.g if you configure your kernel for <code>Arm architecture or machine</code> then <code>configured kernel Makefile</code> will tell how to compile and for which arhitecture your modules should be built.</p> <p>To be compiled, a kernel module <code>needs access to the kernel headers, containing the defnitions of functions, types and constants</code>.</p> <p><code>Can it be build solely?</code></p> <p>No you cant build solely since you module should should know for which kernel you want to build it and which configuration it needs to be compiled so that while inserting your module All respective symbols and configuration should be matched. All this can be done through <code>toplevel Makefile of configured kernel</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload