Re: Question regarding building a specific kernel module.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Curran, Dominic wrote:
> This may be slightly off topic, but I wasn't sure where else to post...
>
> I want to use/modify a driver that my distribution has not built a
> module for.
>
> I'm using FC6 which doesn't install the src as standard so I:
> 1) Download the matching kernel SRPM from
> http://download.fedora.redhat.com
> 2) $ rpm -ivh kernel-2.6.18-1.2798.fc6.src.rpm 
> 3) $ rpmbuild -bp --target=$(uname -m)
> /usr/src/redhat/SPECS/kernel-2.6.spec
>
> This puts the source in:
>   /usr/src/redhat/BUILD/kernel-2.6.18/kernel-2.6.18.i686
>
> OK, so I copy the original .config in using:
> 4) $ cd /usr/src/redhat/BUILD/kernel-2.6.18/ kernel-2.6.18.i686
> 5) $ cp /lib/modules/2.6.18-1.2798.fc6/build/.config  .
> 6) $ make gconfig
> 7) Find the driver I want and turn on its compile option to 'M'odule.
>
> Now I try to build the module:
> 8) $ make modules
>
> Naively I though that this would just compile the one module I wanted !
> It actually seems to compile all modules (slow machine & still chugging
> away).
>
> QUESTIONS:
> (A) Could I have done this differently so that only the module I wanted
> got built?
>   

Not without editing the Makefile(s).

> (B) As part of some tests I'm doing I want to modify this one module and
> recompile.  What should I do to make sure ONLY the module I changed gets
> recompiled ? 

Just make the module from the top of your driver directory. As long as
the source code to the other modules is not modified and the file
timestamps are up to date they will not be recompiled.

> Will it just happen automagically ?  
>   

Yes, GNU Make does this automatically:

http://www.gnu.org/software/make/manual/

William

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux