LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2010, 01:47 PM   #16
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15

Then how do we use the kernel makefile?

Last edited by David Li; 03-19-2010 at 03:01 PM.
 
Old 03-19-2010, 02:21 PM   #17
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Normally the layout is the following:
Code:
mymodule-objs := file1.o file2.o ...
obj-m := mymodule.ko
I modified your Makefile a little bit:
Code:
KERNELDIR = ../../kernel/linux-2.6.22.6

gedv0-objs := p3defs.o p3api.o gedrv.o
obj-m := gedv0.ko

call-kernel-build-system:
 make -C $(KERNELDIR) SUBDIRS=`cwd` ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules
The way you compiled the module was just creating a object and allowing unresolved references. The kernel build system will call several tools to generate the version information (especially modpost)

Last edited by irmin; 03-19-2010 at 02:24 PM.
 
1 members found this post helpful.
Old 03-19-2010, 03:27 PM   #18
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
Do I need to intergrate you code into my makefile?
 
Old 03-19-2010, 03:49 PM   #19
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
Your code is the complete make file I can use or I need to intergrate that into my make file. I did intergrate your code into mine. But modinfo still gives no version number. I think I missed your points.
 
Old 03-19-2010, 04:07 PM   #20
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
irmin,

I am desperate to get this resolved. Can I call you?
 
Old 03-19-2010, 04:34 PM   #21
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Use the code as it is in my example (modify the file names if needed). If you just integrate my lines into yours, the kernel build system will not be called.
 
Old 03-19-2010, 05:13 PM   #22
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
After typing make, returned nothing to be done for 'call-kernel-build-system'. Then commented out 'call-kernel-build-system', tried again returned No target, stop.
 
Old 03-19-2010, 05:27 PM   #23
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Did you put a TAB before the make command (in the Makefile)?

Last edited by irmin; 03-19-2010 at 05:29 PM.
 
Old 03-19-2010, 05:34 PM   #24
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
I did not.
 
Old 03-19-2010, 05:41 PM   #25
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
There is no Makefile under 'cwd' directory.
 
Old 03-19-2010, 06:29 PM   #26
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
I meant pwd instead of cwd. Sorry.
 
Old 03-19-2010, 06:37 PM   #27
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
I don't see any makefie in pwd either?
 
Old 03-19-2010, 07:09 PM   #28
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
In my example makefile in the last line there is a substring cwd that has to get replaced with pwd.
 
Old 03-19-2010, 07:16 PM   #29
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
Did that, then when you make you get linux-2.6.22-6/pwd/Makefile: No such file or directory.
 
Old 03-20-2010, 08:13 AM   #30
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Yeah, did you use the reversed quotes around pwd? If this does not work, put "SUBDIRS=/path/to/your/source" there instead. This assumes that /path/to/your/source/Makefile is the makefile with the above contents.

Take the Makefile appended to this post. For me it does work, when the source files are replaced with dummy files, of course.
Attached Files
File Type: txt Makefile.txt (213 Bytes, 10 views)

Last edited by irmin; 03-20-2010 at 08:21 AM.
 
  


Reply



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
What is the error "invalid module format" and "insert kernel module"? shayori Linux - Newbie 8 02-25-2010 03:48 AM
[SOLVED] booting a newly compiled kernel error :"invalid or unsupported executable format" shivanth Linux - Kernel 1 09-16-2009 06:57 AM
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
error: Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" penguin chick Linux - Wireless Networking 5 08-22-2008 01:16 PM
Ndiswrapper "Invalid driver" error - but it worked before i switched distros! drewbug01 Linux - Wireless Networking 5 11-01-2006 12:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration