Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have patched a file for my wifi driver in net/wireless/drivers/zd1211rw/, and I couldn't get it to compile just that driver. so I backed up into the main directory of my linux kernel source, and issued the command make modules. It is taking forever, even though I have a quad core, so is there any way I can tell it specifically to just compile the wireless drivers? or even just zd1211rw?

Thanks. I have 3.2.0.

share|improve this question
the majority of the procedure is documented here:… if anyone wants some easy rep – RobotHumans Sep 22 '12 at 0:08
hum so I just tried it, and it is not what I am looking for. Because when I get to the command make EXTRAVERSION=-21-generic O=/usr/src/mytree modules SUBDIRS=scripts it starts at the beginning, and compiles every single module [starting with arch/], which is what I am already doing now. Thanks anyway though. My modules are still compiling, and it has reached the zd1211rw folder, but so far there is no .ko file, just an zd1211rw.o file. I guess it makes .ko's at the end? – Matt Sep 22 '12 at 1:03
iirc you can skip that line – RobotHumans Sep 22 '12 at 1:11
Thank you, that linked showed me how to do it; I answered my own question – Matt Oct 21 '12 at 3:21
up vote 3 down vote accepted

Set up for compiling:

extraversion="-"$(uname -r|sed 's/[0-9].[0-9].[0-9]-//' ) # extraversion in 3.5.0-17-generic is -17-generic
mkdir ~/tmp/build/
cd ~/tmp/build/
cp /boot/config-`uname -r`  .config
cp /usr/src/linux-headers-3.5.0$extraversion/Module.symvers ./
cd /usr/src/linux-source-3.5.0/
make EXTRAVERSION=$extraversion O=~/tmp/build oldconfig
make EXTRAVERSION=$extraversion O=~/tmp/build prepare
make EXTRAVERSION=$extraversion O=~/tmp/build outputmakefile
make EXTRAVERSION=$extraversion O=~/tmp/build archprepare
make EXTRAVERSION=$extraversion O=~/tmp/build modules SUBDIRS=scripts

Now you are ready. To compile module put in the folder of its location. For zd1211

make EXTRAVERSION=$extraversion O=~/tmp/build/ modules SUBDIRS=drivers/net/wireless/zd1211rw

cd into ~/tmp/build/drivers/net/wireless/zd1211rw/ to find the .ko file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.