LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 02: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 04:01 PM.
 
Old 03-19-2010, 03: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 03:24 PM.
 
1 members found this post helpful.
Old 03-19-2010, 04: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, 04: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, 05: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, 05: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, 06: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, 06: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 06:29 PM.
 
Old 03-19-2010, 06:34 PM   #24
David Li
Member
 
Registered: Mar 2010
Posts: 42

Original Poster
Rep: Reputation: 15
I did not.
 
Old 03-19-2010, 06: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, 07: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, 07: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, 08: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, 08: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, 09: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, 7 views)

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


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


All times are GMT -5. The time now is 08:57 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration