mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 01:57:54 +00:00
32 lines
11 KiB
HTML
32 lines
11 KiB
HTML
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>Installing Linux kernel modules with DKMS</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
|
MathJax = {
|
|
tex: {
|
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
|
},
|
|
options = {
|
|
processHtmlClass = "math"
|
|
}
|
|
}
|
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>Installing Linux kernel modules with DKMS</h1><section class="post-metadata"><span>Date: <!-- -->2021-05-30 17:40:35 +08:00</span><span>Date modified: <!-- -->2021-07-22 18:07:36 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"></ol></nav><p><a href="https://github.com/dell/dkms">Dynamic kernel module support</a> (DKMS) is a feature that allows installation of kernel modules while reinstalling the kernel.
|
|
This is preferable if you don't want to build and install kernel modules every kernel update.
|
|
</p><p>Oftentimes to build the kernel module, it is required to install Linux-related headers.
|
|
</p><p>Here's an example scenario where I want to install <a href="https://github.com/jlam55555/veikk-linux-driver/issues/43">Veikk tablet driver</a> that is not available out-of-the-box.
|
|
The following list is the summarized version of what should happen.
|
|
</p><ul><li><p>Download the source code of the kernel module.
|
|
</p></li><li><p>Check if the Linux headers are available otherwise the kernel module cannot be built.
|
|
</p></li><li><p>Place the kernel module source into the kernel source tree (e.g., <code class="inline-verbatim">/usr/src</code>).
|
|
</p></li><li><p>Create <code class="inline-verbatim">dkms.conf</code> to tell where the module is to be built.
|
|
</p></li><li><p>Install the module with <code class="inline-code">dkms</code>.
|
|
</p></li></ul><p>The most difficult out of the steps is configuring with <code class="inline-verbatim">dkms.conf</code>.
|
|
You can see the format and the available options from <code class="inline-verbatim">dkms.8</code> manual page.
|
|
For now, let's see the example configuration.
|
|
</p><pre class="src-block"><code class="language-shell">PACKAGE_NAME="input-veikk"
|
|
PACKAGE_VERSION="git"
|
|
BUILT_MODULE_NAME[0]="veikk" # (ref:module-name)
|
|
DEST_MODULE_LOCATION[0]="/extra/"
|
|
AUTOINSTALL="yes"
|
|
</code></pre><p>This tells <code class="inline-code">dkms</code> to install the Veikk driver, packaged as <code class="inline-verbatim">input-veikk</code> with version <code class="inline-verbatim">git</code>, in <code class="inline-verbatim">extra/</code> (e.g., <code class="inline-verbatim">/lib/modules/@LINUX_KERNEL_VERSION@/extra</code>).
|
|
When installed, you should see a module named <a href="/wiki/(module-name)"><code class="inline-verbatim">veikk</code></a> — e.g., see the module list with <code class="inline-verbatim">lsmod</code>.
|
|
</p><p>With the setup complete, run <code class="inline-code">dkms install -m input-veikk -v git</code> and it should be effective immediately.
|
|
</p></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"\"2021-05-30 17:40:35 +08:00\"","date_modified":"\"2021-07-22 18:07:36 +08:00\"","language":"en","source":""},"title":"Installing Linux kernel modules with DKMS","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/dell/dkms"},"children":[{"type":"text","value":"Dynamic kernel module support"}]},{"type":"text","value":" (DKMS) is a feature that allows installation of kernel modules while reinstalling the kernel.\nThis is preferable if you don't want to build and install kernel modules every kernel update.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Oftentimes to build the kernel module, it is required to install Linux-related headers.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Here's an example scenario where I want to install "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/jlam55555/veikk-linux-driver/issues/43"},"children":[{"type":"text","value":"Veikk tablet driver"}]},{"type":"text","value":" that is not available out-of-the-box.\nThe following list is the summarized version of what should happen.\n"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Download the source code of the kernel module.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Check if the Linux headers are available otherwise the kernel module cannot be built.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Place the kernel module source into the kernel source tree (e.g., "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"/usr/src"}]},{"type":"text","value":").\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Create "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"dkms.conf"}]},{"type":"text","value":" to tell where the module is to be built.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Install the module with "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"dkms"}]},{"type":"text","value":".\n"}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The most difficult out of the steps is configuring with "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"dkms.conf"}]},{"type":"text","value":".\nYou can see the format and the available options from "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"dkms.8"}]},{"type":"text","value":" manual page.\nFor now, let's see the example configuration.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"PACKAGE_NAME=\"input-veikk\"\nPACKAGE_VERSION=\"git\"\nBUILT_MODULE_NAME[0]=\"veikk\" # (ref:module-name)\nDEST_MODULE_LOCATION[0]=\"/extra/\"\nAUTOINSTALL=\"yes\"\n"}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This tells "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"dkms"}]},{"type":"text","value":" to install the Veikk driver, packaged as "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"input-veikk"}]},{"type":"text","value":" with version "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"git"}]},{"type":"text","value":", in "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"extra/"}]},{"type":"text","value":" (e.g., "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"/lib/modules/@LINUX_KERNEL_VERSION@/extra"}]},{"type":"text","value":").\nWhen installed, you should see a module named "},{"type":"element","tagName":"a","properties":{"href":"/(module-name)"},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"veikk"}]}]},{"type":"text","value":" — e.g., see the module list with "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"lsmod"}]},{"type":"text","value":".\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With the setup complete, run "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"dkms install -m input-veikk -v git"}]},{"type":"text","value":" and it should be effective immediately.\n"}]}]},"backlinks":[]},"__N_SSG":true},"page":"/[[...slug]]","query":{"slug":["linux.modules-with-dkms"]},"buildId":"Ie9t5zutrXP6Of75Cb5xF","assetPrefix":"/wiki","nextExport":false,"isFallback":false,"gsp":true}</script><script nomodule="" src="/wiki/_next/static/chunks/polyfills-99d808df29361cf7ffb1.js"></script><script src="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" async=""></script><script src="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" async=""></script><script src="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" async=""></script><script src="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" async=""></script><script src="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" async=""></script><script src="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" async=""></script><script src="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_buildManifest.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_ssgManifest.js" async=""></script></body></html> |