# make just one module? 'make foo.modules modules_install' ???

## syadnom

how would one go about compiling and installing just a single module?

say i patch my kernel for reiser4, then in menuconfig i set it as a module

i dont want to go through the lengthy task of  make modules modules_install as it takes quite a while.

is their a way to just make the reiser4 modules???

----------

## DaMouse

Reiser4 effects the core adding some weird rcu stuff, you'd have to do a bzImage to i'm afraid  :Sad: 

-DaMouse

----------

## syadnom

the was just an example...just a bad one  :Smile: 

anyway, make bzImage is quick for me, its module compiling that takes forever.

----------

## DaMouse

hmm, last time i tried, make modules only did the newest modules so i'm not sure why yours doesn't, it DOES work on timestamps tho, so if a timestamp has changed it'll recompile it and all its dependancies. if i recall correctly of course  :Razz: 

-DaMouse

----------

## NeddySeagoon

syadnom,

If you go intoo your config and change iyems from off to M,

all thats needed is make modules and make modules_install.

You can then use your new module(s) after loading them with modprobe.

If you patch things, it gets much more complex. You need to understand what the patch changes and how your kernel is built. Modules may be enough.

----------

## syadnom

i dont want to compile ALL modules

i want to compile just ONE

i want to be able to compile any single module without recompiling the who modules tree.

for instance.

i have a USB2 hard drive formated XFS.  my system does not support XFS because it is not compiled in and not built as a modules.

i want to be able to just

make xfs_filesystem modules_install

or something to that effect to  compile ONLY XFS, i dont want to recompile every module.  when i want one module i don't want to wait 10 minutes for the who tree to recompile.

----------

## NeddySeagoon

syadnom,

Make is pretty good.

It will look through the whole tree and only build things where the source code is more recent than the corresponding object file.

If there is no object file, then it will be built.

Only your XFS module(s) will get built.

----------

## syadnom

ok, i did this,

ran 

time make modules

here are results

WITHOUT modifying .config

1st time 

real    0m31.601s

user    0m6.788s

sys     0m1.619s

2ond time

real    0m11.631s

user    0m6.726s

sys     0m1.319s

WITH added entry in .config

1st time

real    2m5.072s

user    1m31.024s

sys     0m7.865s

2ond time 

real    0m9.298s

user    0m7.248s

sys     0m1.291s

--nice

now, if i change a built in kernel driver(not module!) will it rebuild all the modules?

i see that make looks at the modules and decides if they are up to date.

----------

## NeddySeagoon

syadnom,

Well, your second make modules didn't compile anything and the kerenl will have been in cache, hence the speed improvement.

Make should not rebuild the modules unless the changes you make to the kernel change the 'magic' that associates the modules with the kernel.  Try it and check the timestamos on the *.o files and the *.ko files.

----------

