How to compile kernel module for a new kernel before reboot?

Kwan Lowe kwan at digitalhermit.com
Sat Apr 3 19:57:04 UTC 2010


On Sat, Apr 3, 2010 at 3:04 PM, Andrew Junev <a-j at a-j.ru> wrote:
> Hello All,
>
> I have a vt6656 WiFi adapter that needs a separate driver to work in
> Linux. The driver is neither in "native" Fedora repos, nor in
> rpmfusion (at least I don't know how to search for it, so I think it's
> not there).
>
> So whenever I do a 'yum update' and get a new kernel, I have to
> compile a new kernel module as well. Currently, I first reboot to a
> new kernel, then compile a module and then do another reboot just to
> check everything is loading properly on bootup.
>
> How do I compile my driver for a new kernel _before_ actually booting
> into that new kernel, so that I could be prepared with the new kernel
> module already on first reboot?

Depending on your source tree there are a few different ways. Most
kernel module sources will use 'uname -r' to find the path to the
kernel source tree. You may need to set a variable explicitly.  For
example, I grabbed a vt6656 build from git and saw in the mk.sh
script:

KDIR="/lib/modules/`uname -r`/build"

You can try passing the kernel version you want to build instead of
running uname.


More information about the users mailing list