Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-25-2005, 08:28 AM
|
#1
|
Member
Registered: Feb 2002
Posts: 393
Rep:
|
Building new kernel modules?
Hi this is a long shot I guess... But anyway, I wonder, does anyone know if there is a way in Debian to compile modules from my kernel sources without compiling the entire kernel again? Say for example I bought a new network card and it needed specific drivers from the kernel which I had not compiled into my kernel on any previous kernel compile - isn't there any way just to compile that single driver from the kernel sources and load it, or must I compile everything from scratch again?
I hope I'm being clear about what I want. Basically I would like the ability to add new hardware without compiling my entire kernel again just to enable the driver for it. I would much rather just compile the driver itself.
I know compiling a kernel when it has been compiled at least once already is fairly fast, but there are various cirumstances where this is not helpful. I am experiencing one of those conditions right now - where recompiling the kernel would simply be impractical for what I hope to achieve.
Best regards,
GJ
|
|
|
05-26-2005, 02:23 AM
|
#2
|
Member
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466
Rep:
|
I'm not sure about debian.
But in the kernel you can run
"make menuconfig" or "make xconfig"
you tick "M" for module that you want and compile it again.
Then run make modules modules_install
If it's just a driver you shouldn't need to reboot to load it up.
Recompiling little bits seems to go faster with 2.6 kernel than 2.4.
If you want to recompile without using the kernel compiling system, then that'll depend on what driver you're talking about and what kernel version.
|
|
|
05-26-2005, 03:07 AM
|
#3
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
I think that it depends whether the support for that type of module was already compiled in.
I would start with "make oldconfig" before "make xconfig" in the above instructions. This will use your last .config options before you make changes. It also validates your .config file.
If you are adding a sata drive and your kernel was compiled without sata support,
i.e.:# CONFIG_BLK_DEV_IDE_SATA is not set
in .config, then you would need to recompile the kernel with this option changed.
On the other hand if this is a module for an ide drive, then for the 2.6 kernel, you might be able to just
make modules && make modules_install
The nvidia installer does something like this to compile and install the nvidia.ko kernel module.
So to use your network device example. You are adding a device that uses the apricot network device driver. If the .config file says "CONFIG_APRICOT=m" then either a new driver isn't needed or you need only to install the source-code and run "make modules && make modules_install"
Also, there are howtos and README documents in the kernel source. Be sure the read through them. The source code the you are installing will probably have documentation with the source that will give you detailed instructions. There are also instructions on how to install drivers with the source code.
When I just looked in my /usr/src directory, there was a sub-directory "kernel-modules" present. Two kernel module source directories were inside. Each module's Makefile had a "make all" target to compile the module and "make install" target to install the module. Each module also had a README and INSTALL file.
This is the first of two methods for recompiling a kernel module given in the /usr/src/linux/SuSE-README file:
The first method involves the following steps:
(1) Install kernel-source.$ARCH.rpm.
(2) Change to the /usr/src/linux directory. Configure the kernel
(for example, ``make oldconfig'' or ``make cloneconfig'', see
HOW TO CONFIGURE THE KERNEL SOURCES).
(3) Create files required for compiling external modules:
``make modules_prepare''.
(4) Compile the module(s) by changing into the module source directory
and typing ``make -C /usr/src/linux M=$(pwd)''.
(5) Install the module(s) by typing
``make -C /usr/src/linux M=$(pwd) modules_install''.
If I hadn't read the README file in the kernel source, I would of missed the "make modules_prepare" step that my system requires.
|
|
|
All times are GMT -5. The time now is 03:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|