LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Adding modules to avoid rebuilding the kernel (https://www.linuxquestions.org/questions/linux-kernel-70/adding-modules-to-avoid-rebuilding-the-kernel-762359/)

awp2513 10-16-2009 07:38 AM

Adding modules to avoid rebuilding the kernel
 
Hello,

I have a system running Mandrake 9.2 with a custom kernel based off of 2.4.22-10mdk. The only custom part is that many previously unnecessary options were removed.

Network Device support and many of the Network Options, including Packet Socket and Packet filtering (which seem to be necessary if I want to use dhclient or dhcpcd) are not configured. I would like to avoid rebuilding the kernel on the existing system for v&v reasons).

It looks like the three modules I need are:

1. 8139too (network card)
2. mii (which 8139too depends on)
3. af_packet (the packet socket module)

I have successfully build kernels with these options modularized, modprobed, setup eth0, and pinged google. But as soon as I start putting pre-compiled (maybe built is the right word?) modules on the existing system, I get unresolved symbols. I have built the modules using the existing system's config file, so I thought it should work.

In all my different kernel builds, I have used the same kernel name (EXTRAVERSION in the .../linux/Makefile is unchanged)

Maybe what I'm trying to do isn't possible. I'd like to understand why, but nothing I've read has helped explain it either way.

Is there a way to avoid a kernel rebuild? if so, how can I do it? Am I missing something simple?

Please let me know if I can provide any additional information. I'm pretty new to Linux, so I'm not sure what may or may not be helpful.

Thank you in advance

GrapefruiTgirl 10-16-2009 11:35 AM

Better than 9/10 times, what you are trying to do will not work, and definitely is not recommended. There are always exceptions to the rules, but generally, doing what you are doing, will not produce happiness.

Even kernel modules, built as modules, require that the kernel blob itself be constructed in such a way so that it is compatible the modules, i.e. a module needs a "socket" to connect to the kernel with, and a kernel that is not built what this "socket" will not have a way to accept the module that was built separately (hence errors like "undefined symbols").

Also, the kernel will, at the *very* least, complain that a module built for "abc" kernel, is not compatible, or is an incompatible format, when you try to use it with kernel "xyz". So kernel "abc" will only be happy with modules built with/for kernel "abc".

I'm not sure what you meant by "v&v" reasons as to not wanting to rebuild the kernel on the machine, but it really is your best bet, and will give less headaches in the long run, to just do it that way :)

Cheers,
Sasha


All times are GMT -5. The time now is 05:06 AM.