www.centos.org Forum Index CentOS 4 - General Support HOWTO: Build new modules for an existing kernel
|
Bottom Previous Topic Next Topic |
| |
|
|
|---|
| Poster | Thread | Rated: 3 Votes |
|---|
|
HOWTO: Build new modules for an existing kernel | #1 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2005/4/26
From Southern California
Posts: 7
|
Recently, I wanted to add NTFS support to my kernel as a module. Rather than recompile the whole kernel, or even all of the modules, I thought I should be able to build just the module I was interested in adding. It turns out this process isn't real straightforward, but it can be done pretty easily. I thought it might be good to pull together some information for other CentOS users. First, I found these two sources very helpful:
- The Linux Kernel Module Programming Guide, Chap. 2 - Building External Linux Kernel Modules Under Fedora Core 3 The following steps are a distillation of the above sources and are modified slightly for CentOS 4. They assume you are using a stock kernel from CentOS. 1) Install kernel sources. If you have a different kernel than the latest Note that the kernel-devel package is not sufficient, as it has only headers and makefiles, not source code. 2) Change to source directory. 3) Copy appropriate kernel config from boot directory. 4) Edit to enable the module. You can also just edit .config if you know the name of the parameter you are looking for. This step is very important, because the actual build step will do nothing if the module isn't enabled in the .config file. 5) Prepare the build environment. 6) Build and install the module. For instance, if you want to add NTFS support: Notice that we are using the external module build mechanism, but because we're building a module inside the kernel source tree, we don't need the -C argument to make. 7) At this point, the module shows up under /lib/modules/<version>, but does not work. It must be added to the current System.map (mimic what kernel build does). 9) Now the module will load. Hope this helps somebody. Any suggestions/comments from the community? Eric |
||
Posted on: 2005/4/27 23:35
|
|||
|
Re: HOWTO: Build new modules for an existing kernel | #3 |
|
|---|---|---|---|
|
Newbie
![]()
Joined: 2005/4/26
From Southern California
Posts: 7
|
Dang, left a step out! I thought I triple-checked that I put this in there. What a goof! Here's the missing step. I was going to edit the original post, but it looks like it's locked for some reason. Thanks for finding this.
Step 2.5) Edit Makefile. Change the line (near the top) that starts with "EXTRAVERSION". Remove the "custom" part. Save and quit. |
||
Posted on: 2005/5/19 15:35
|
|||
|
Re: HOWTO: Build new modules for an existing kernel | #4 |
|
|---|---|---|---|
|
WebMaster
![]()
Joined: 2004/12/5
From Corpus Christi, Texas, USA
Posts: 401
|
That works well, thanks for the information.
For some things (like NTFS, ReiserFS, XFS, JFS support and some others), they are now built into a kernel that we have released in CentOS plus. It is called kernel-xxxxx-unsupported. It replaces the main kernel and provides items not in the standard boot Kernel. Read more about it here: http://mirror.centos.org/centos/4/centosplus/Readme.txt |
||
Posted on: 2005/5/20 19:44
|
|||
|
Re: HOWTO: Build new modules for an existing kernel | #5 |
|
|---|---|---|---|
|
WebMaster
![]()
Joined: 2005/3/19
From
Posts: 89
|
With the passage of time, and the sequential and static nature of a Forum, this article has gone stale.
Please refer to the Wiki article maintained by the CentOS documentation team, at: How to Build Kernel Modules |
||
Posted on: 2008/3/5 14:22
|
|||
Top Previous Topic Next Topic |
|



Topic options
Print Topic
Threaded
Newest First
3 Votes
cybermac912




You cannot start a new topic.
You can view topic.