# Pearce Wiki

### Site Tools

notes:rebuilding_kernel_modules

# Differences

This shows you the differences between two versions of the page.

 notes:rebuilding_kernel_modules [2012/10/17 10:22]andy created notes:rebuilding_kernel_modules [2012/10/17 10:32] (current)andy 2012/10/17 10:32 andy 2012/10/17 10:26 andy 2012/10/17 10:23 andy 2012/10/17 10:22 andy created Next revision Previous revision 2012/10/17 10:32 andy 2012/10/17 10:26 andy 2012/10/17 10:23 andy 2012/10/17 10:22 andy created Line 1: Line 1: ====== Rebuilding Linux Kernel Modules ====== ====== Rebuilding Linux Kernel Modules ====== - This page specifically concerns building kernel modules to work with an existing running kernel without having to rebuild the entire kernel or reboot the system. + This page specifically concerns building kernel modules to work with an existing running kernel without having to rebuild the entire kernel or reboot the system. More detailed information on this topic can be found in the [[http://​git.kernel.org/?​p=linux/​kernel/​git/​torvalds/​linux-2.6.git;​a=blob_plain;​f=Documentation/​kbuild/​modules.txt;​h=3fb39e0116b4c8e42d40009357ed5cf13c1f2888;​hb=HEAD|Documentation/​kbuild/​modules.txt]] file within the kernel source package. There are two prerequisites for building modules to work with an existing kernel: There are two prerequisites for building modules to work with an existing kernel: Line 13: Line 13: * ''/​usr/​src/​linux-headers-$(uname -r)/​Module.symvers''​ * ''/​usr/​src/​linux-headers-$(uname -r)/​Module.symvers''​ - <​note>​The latter file is located within the ''​linux-headers-$(uname -r)''​ package.​ + <​note>​On Ubuntu, the latter file is located within the ''​linux-headers-$(uname -r)''​ package.​ Unzip a copy of the Linux kernel sources and change into the root directory of it. Then execute the following commands: Unzip a copy of the Linux kernel sources and change into the root directory of it. Then execute the following commands: Line 34: Line 34: <​code>​ <​code>​ - make M=/sound/usb + make M=sound/usb ​ + + Once the build is complete you should find the ''​.ko''​ files in their respective subdirectories. + + ​If there are no ''​.ko''​ files or there are other inexplicable build failures, double check that your ''​GREP_OPTIONS''​ environment variable isn't set, and unset it if it is. After unsetting you may need to repeat everything from ''​make clean''​ onwards.
notes/rebuilding_kernel_modules.1350469371.txt.gz · Last modified: 2012/10/17 10:22 by andy