Skip to contentSkip to conversation

compiling only one module in kernel version 2.6?

DISCUSSION Fong Vang 4 participants 9 messages Aug 17, 2005 – Aug 18, 2005

lore
Share & tools
lore

Fong Vang

author
#0 lore raw

What's the easiest way to compile just one module in the Linux 2.6 kernel tree?

This no longer seem to work:

  $ cd /usr/src/linux
  $ make SUBDIRS=fs/reiserfs modules
           Building modules, stage 2.
           MODPOST

I don't see any .ko generated.

#1 lore raw
Quoted 10 lines · Fong Vang

What's the easiest way to compile just one module in the Linux 2.6 kernel tree?

This no longer seem to work:

  $ cd /usr/src/linux
  $ make SUBDIRS=fs/reiserfs modules
           Building modules, stage 2.
           MODPOST

I don't see any .ko generated.

It worked for me. Is your reiserfs turned on as a module, and not compiled into the kernel. (<M> not <*> nor < >)

-- Steve

#2 lore raw
Quoted 10 lines · On Tue, 16 Aug 2005 23:18:49 -0400 Steven Rostedt wrote:
Quoted 9 lines · Fong Vang

What's the easiest way to compile just one module in the Linux 2.6 kernel tree?

This no longer seem to work:

  $ cd /usr/src/linux
  $ make SUBDIRS=fs/reiserfs modules
           Building modules, stage 2.
           MODPOST
Quoted 4 lines
Quoted 1 line

I don't see any .ko generated.

It worked for me. Is your reiserfs turned on as a module, and not compiled into the kernel. (<M> not <*> nor < >)

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

---
~Randy

#3 lore raw
Quoted 3 lines · Randy.Dunlap

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

That could very well explain it. I'm doing this on 2.6.13-rc6-rt6 (2.6.13-rc6 with Ingo's rt6 patch applied). So I really do have a recent kernel.

-- Steve

#4 lore raw
Quoted 9 lines · Steven Rostedt
Quoted 3 lines · Randy.Dunlap

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

That could very well explain it. I'm doing this on 2.6.13-rc6-rt6 (2.6.13-rc6 with Ingo's rt6 patch applied). So I really do have a recent kernel.

I just did this on a 2.6.9 vanilla kernel, and it still worked. How "recent" did Sam do this?

-- Steve

#5 lore raw
Quoted 6 lines · On Wed, 17 Aug 2005 01:54:50 -0400 Steven Rostedt wrote:
Quoted 5 lines · Steven Rostedt
Quoted 3 lines · Randy.Dunlap

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

Quoted 7 lines
Quoted 4 lines

That could very well explain it. I'm doing this on 2.6.13-rc6-rt6 (2.6.13-rc6 with Ingo's rt6 patch applied). So I really do have a recent kernel.

I just did this on a 2.6.9 vanilla kernel, and it still worked. How "recent" did Sam do this?

2.6.9 did not handle "make one_module.ko" (for me on x86).

2005-july-08:
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=155ad605b3c9c5874ff068f23c6ea8537190e0a8

---
~Randy

#6 lore raw
In reply to Steven Rostedt
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Steven Rostedt
Quoted 3 lines · Randy.Dunlap

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

Quoted 6 lines
Quoted 4 lines

That could very well explain it. I'm doing this on 2.6.13-rc6-rt6 (2.6.13-rc6 with Ingo's rt6 patch applied). So I really do have a recent kernel.

I just did this on a 2.6.9 vanilla kernel, and it still worked.

Hi Steve.

make fs/reiserfs/
and
make fs/reiserfs/resiserfs.ko

does not do the same thing. Only the latter result in a .ko file.

Sam

#7 lore raw
Quoted 14 lines · Sam Ravnborg
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Steven Rostedt
Quoted 3 lines · Randy.Dunlap

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

Quoted 6 lines
Quoted 4 lines

That could very well explain it. I'm doing this on 2.6.13-rc6-rt6 (2.6.13-rc6 with Ingo's rt6 patch applied). So I really do have a recent kernel.

I just did this on a 2.6.9 vanilla kernel, and it still worked.

Quoted 7 lines

Hi Steve.

make fs/reiserfs/
and
make fs/reiserfs/resiserfs.ko

does not do the same thing. Only the latter result in a .ko file.

I never said I did a "make fs/reiserfs". I did a "make SUBDIRS=fs/reiserfs" which does produce a .ko file.

But even shorter is to do a "make M=fs/reiserfs", which also works.

But, I guess what was added was the ability to just type the module itself. That's cool, but I haven't had the need to do that (yet).

-- Steve

#8 lore raw
Quoted 17 lines · Steven Rostedt
Quoted 16 lines · Sam Ravnborg
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Steven Rostedt
Quoted 3 lines · Randy.Dunlap

Sam only added make .ko build support very recently, so it could easily depend on what kernel verison Fong is using.

Quoted 6 lines
Quoted 4 lines

That could very well explain it. I'm doing this on 2.6.13-rc6-rt6 (2.6.13-rc6 with Ingo's rt6 patch applied). So I really do have a recent kernel.

I just did this on a 2.6.9 vanilla kernel, and it still worked.

Hi Steve.

Quoted 8 lines
Quoted 5 lines

make fs/reiserfs/
and
make fs/reiserfs/resiserfs.ko

does not do the same thing. Only the latter result in a .ko file.

I never said I did a "make fs/reiserfs". I did a "make SUBDIRS=fs/reiserfs" which does produce a .ko file.

That command uses an implicit target of all (which is bzImage + modules), and then SUBDIRS (or M) limits it to the specified subdir., so it builds all modules in the specified subdir.
As opposed to what I thought(?) the OP was asking about:
how to build one module only.

I think that we have nailed it enough now, yes? :)

Quoted 4 lines

But even shorter is to do a "make M=fs/reiserfs", which also works.

But, I guess what was added was the ability to just type the module itself. That's cool, but I haven't had the need to do that (yet).

Signature · 1 line
~Randy