LinuxQuestions.org
Visit Jeremy's Blog.
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 11-05-2010, 05:46 AM   #1
mehdi141
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Rep: Reputation: 0
Question Shortcut to compile kernel file ?


Dear All,
I hope you all are fine ad doing well,

I become successful to download kernel, compile it and run it.

BUT
When i modify tcp.c file or any other file in this /usr/src/linux/net/ipv4 location, (just modifying c files) i have to compile the complete kernel every time, which is very time consuming procedure.

So Please help, How to compile that net/ipv4 package or etc...

I will be very very thankful to you all... please please guide me..

Mehdi
 
Old 11-06-2010, 12:53 PM   #2
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
If you just want to syntax-check your .c file, it looks like you can go to the top of the tree (i.e., /usr/src/linux) and say
Code:
make net/ipv4/tcp.o
I'm not sure what is the minimum you need to do to actually run the code, though.
 
Old 11-07-2010, 05:27 AM   #3
mehdi141
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Hello Sir,
First of all Thank you very much for reply. As you mention to compile the tcp.c file like make net/ipv4/tcp.o after modification, Which is working fine and new tcp.o file is created in net/ipv4 location.

But when i run my user level normal server client application [where client sent just hello to server after connecting to server].

So our changes are not effective in the kernel level modification which we have done in net/ipv4/tcp.c file, i verified through printk. But it does not effect.


And when i recompile the whole kernel using [oldconfig , make; make modules; make modules_install; make install and restart of system] so our changes are effective.

My question,is there anyway to just compile the required kernel files which are relevant to network level. net/ipv4

Because proper kernel compilation procedure is to lengthy and time consuming and i am not able to develop any thing...

Please sir, guide me or send me some links or reference. Linux is very new to me...

It will be really highly appericated for guide... Thanks

Mehdi
 
Old 11-08-2010, 12:09 PM   #4
mehdi141
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Hello,
Any one who help me ????
 
Old 11-08-2010, 01:23 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
If the Makefile is set up correctly, it will already do exactly what you are asking for. Make, according to the rules in a Makefile, figures out what does and does not need to be recompiled to build the target(s). In the case of a kernel build, it does have to inspect a lot of stuff to make the determination of what needs to be done to rebuild a kernel. You should be able to use the recursive make structure to build only the kernel module(s) of interest in their own directories, but if the modules affected are built-in modules, you will still have to let make run its course over the whole kernel directory structure.

Once you have built the kernel once, you don't have to repeat the whole configuration process. If you are just modifying modules, then simply do 'make modules', and 'make modules_install'. That's why those targets are in the Makefile.

--- rod.
 
Old 11-08-2010, 08:02 PM   #6
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
If the code you're working on is part of a module, you can make just the .ko file, as theNbomr points out, and then rmmod and insmod it. I'm not sure if it's possible to configure tcp.o to land in a module, though.
 
  


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
Need to compile a Linux kernel so that it can use the FATX file system... Nebetsu Linux - Software 9 04-18-2005 11:10 AM
Kernel compile isn't reading my .config file...? R00ts Debian 4 03-21-2005 07:46 PM
/usr/bin/find :No such file or Directory errors while trying to compile kernel. Zero-0-Effect Linux From Scratch 2 05-29-2004 03:46 PM
Kernel compile failing due to a file I can't find GreenPenInc Libranet 7 10-21-2003 11:55 AM
Need a SIMPLE CONFIG file for Kernel compile bongski55 Linux - Newbie 1 09-02-2003 08:54 AM

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

All times are GMT -5. The time now is 09:15 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
Open Source Consulting | Domain Registration