Compiling Individual Modules on RedHat Linux Beta Severn
by David K. Levine
Compiling modules without a complete kernel recompile is a very useful thing to be able to do. There are instructions here, but as always require some tweaking. Here are instructions that work with Severn:
1. cd /usr/src/linux (or whichever /usr/src subdirectory has the linux source in it)
2. mv Makefile Makefile.orig
3. cp Makefile.orig Makefile.my
4. ln -s Makefile.my Makefile
5. from the configs subdirectory copy one of the configuration files
appropriate for your setup (probably kernel-2.4.21-i686.config) to
.config in the /usr/src/linux directory
6. if the module is in a directory with a bunch of other modules (such
as longrun, but not ntfs) then you must modify the appropriate line in
the .config file to indicate compilation as a module, for example
CONFIG_X86_LONGRUN=m ; otherwise this step is optional.
7. edit Makefile.my with a text editor
in the EXTRAVERSION line remove the word "custom"
appearing at the end of the line, so that it reads EXTRAVERSION =
find the SUBDIRS = line and comment it out
put SUBDIRS = fs/ntfs (or whatever is the subdirectory containing the one module you want to compile)
save the file
8. make -f Makefile.my modules
9. go to the directory containing the source code of the module (i.e.
fs/ntfs) and copy the module to the appropriate location in
11. use /sbin/modprobe to load to module
1. remove the .o modules from the directory with the source code (i.e.
fs/ntfs); probably you should do make clean, but I'm not sufficiently
sure what this will to do recommend it
2. rm Makefile from /usr/src/linux
3. if you want you can remove .config, Makefile.my and move Makefile.orig back to Makefile