LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-14-2006, 11:43 PM   #1
henryquinn
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Rep: Reputation: 0
single module compile in clean source tree


Hi

I'm trying to compile a single kernel module in a clean kernel source tree and just can't seem to get it right.

After compiling the kernel (2.6.10) I cleaned the source tree with make mrproper.
Now I'm trying to add just one fs driver module (ntfs.ko), so I copy the saved .config file into the source tree and do a make menuconfig.
I select ntfs support as M and save the changes.
The path to the kernel sources is ~/projects/linux-2.6.10 and I'm working in the source root directory.

make help shows a make dir target and this is what I use.

Here's the output from the command:

SPLIT include/linux/autoconf.h -> include/config/*
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
HOSTCC scripts/kallsyms
HOSTCC scripts/pnmtologo
HOSTCC scripts/conmakehash
SYMLINK include/asm -> include/asm-i386
CHK include/linux/version.h
UPD include/linux/version.h
CC arch/i386/kernel/asm-offsets.s
CHK include/asm-i386/asm_offsets.h
UPD include/asm-i386/asm_offsets.h
LD fs/ntfs/built-in.o
CC [M] fs/ntfs/aops.o
CC [M] fs/ntfs/attrib.o
CC [M] fs/ntfs/collate.o
CC [M] fs/ntfs/compress.o
CC [M] fs/ntfs/debug.o
CC [M] fs/ntfs/dir.o
CC [M] fs/ntfs/file.o
CC [M] fs/ntfs/index.o
CC [M] fs/ntfs/inode.o
CC [M] fs/ntfs/mft.o
CC [M] fs/ntfs/mst.o
CC [M] fs/ntfs/namei.o
CC [M] fs/ntfs/runlist.o
CC [M] fs/ntfs/super.o
CC [M] fs/ntfs/sysctl.o
CC [M] fs/ntfs/unistr.o
CC [M] fs/ntfs/upcase.o
CC [M] fs/ntfs/bitmap.o
CC [M] fs/ntfs/lcnalloc.o
CC [M] fs/ntfs/logfile.o
CC [M] fs/ntfs/quota.o
LD [M] fs/ntfs/ntfs.o
/bin/sh: .tmp_versions/ntfs.mod: No such file or directory

A look inside the fs/ntfs directory shows the .tmp_versions dir as well as the ntfs.mod file in it is there.
Unfortunately the kernel makefile is still indistinguishable from magic to me.

Anyone?

Henry
 
Old 02-14-2006, 11:47 PM   #2
henryquinn
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Original Poster
Rep: Reputation: 0
The actual command that I use is: make fs/ntfs. :-)

Henry
 
Old 02-15-2006, 03:23 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Maybe this:
Code:
make modules SUBDIRS=fs/ntfs
 
Old 02-15-2006, 03:38 AM   #4
henryquinn
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Hi nx5000

Thanks for the answer.

The SUBDIRS variable is for backwards compatibility with the 2.4 kernel according to comments in the makefile.
I tried make modules SUBDIRS=fs/ntfs though but get a lot of errors because of include files etc not available.

As can be seen from the output of make fs/ntfs, it takes care of building and satisfying dependancies where make modules SUBDIRS=fs/ntfs does not.

I think the .tmp_versions directory and ntfs.mod file are generated by the build process as it's not in the source tree when you extract it from the archive but it doesn't get cleaned by make mrproper or make distclean.

Thanks again for the reply
Henry
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I format my single, clean hard drive to Linux? deanh2nd Linux - Newbie 2 06-26-2006 10:24 AM
which source tree to choose for module compilation ? roemisch Linux - Hardware 4 03-31-2005 04:03 PM
how to compile a single module? linjia Debian 1 12-26-2004 05:30 AM
Compile A Single Module leohuang Linux - General 4 05-02-2004 06:20 AM
compile a single kernel module wr3ck3d Linux - General 10 03-01-2003 12:00 PM


All times are GMT -5. The time now is 11:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration