Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 20th April 2011, 03:47 AM
paulhybryant Offline
Registered User
 
Join Date: Apr 2011
Posts: 6
windows_7chrome
Use rpmbuild to compile kernel without re-compiling unchanged module

Using the rpmbuild to compile the kernel, every time the patches will be applied to the source code. So even if no changes are made to the source code and no patches are added to kernel.spec, the whole kernel will still be recompiled, wasting a lot of time.

How can I avoid that?

Thank you very much!
Reply With Quote
  #2  
Old 20th April 2011, 06:42 AM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,060
linuxfirefox
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

Noooo... Make will not recompile stuff that didn't change. It will check to see whether a file is the same and then move on to the next one. Maybe you are mistaking all these checks for an actual compile, or you did a 'make clean', or a 'configure', which will force a recompile of everything?
Reply With Quote
  #3  
Old 20th April 2011, 02:02 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 811
windows_xp_2003chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

Quote:
Originally Posted by flyingfsck
Noooo... Make will not recompile stuff that didn't change. It will check to see whether a file is the same and then move on to the next one. Maybe you are mistaking all these checks for an actual compile, or you did a 'make clean', or a 'configure', which will force a recompile of everything?
They clearly stated their using rpmbuild, which doesn't work as you seem to think it does.

Quote:
Originally Posted by paulhybryant
How can I avoid that?
Install the "ccache" package.
Reply With Quote
  #4  
Old 20th April 2011, 07:09 PM
paulhybryant Offline
Registered User
 
Join Date: Apr 2011
Posts: 6
windows_7chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

hi, I make will not recompile unchanged module.

However, because the rpmbuild command reapply all the patches, though the file content is not changed, the modification date of the file is changed. Therefore make will think that all of them need to be recompilred.

I have tried ccache before, but it doesn't seem to work.
Reply With Quote
  #5  
Old 20th April 2011, 08:33 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 811
windows_xp_2003chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

It works well for me and I do kernel builds quite often.
So.. if you aren't making any changes, then why are you rebuilding the kernel with rpmbuild again?
Would be more efficient to just hang onto your previously generated rpms.
Reply With Quote
  #6  
Old 20th April 2011, 08:34 PM
paulhybryant Offline
Registered User
 
Join Date: Apr 2011
Posts: 6
windows_7chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

I actually changed one file in the kernel.

But when I rebuild the kernel, it still takes the same amount of time as I built the kernel for the first time.
Reply With Quote
  #7  
Old 20th April 2011, 08:43 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
linuxredhatfirefox
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

Quote:
Originally Posted by paulhybryant View Post
I actually changed one file in the kernel.

But when I rebuild the kernel, it still takes the same amount of time as I built the kernel for the first time.

Try excluding the debugging

Code:
rpmbuild --rebuild --with baseonly  --without debuginfo --target=`uname -m` kernel-*.src.rpm
Reply With Quote
  #8  
Old 20th April 2011, 08:49 PM
paulhybryant Offline
Registered User
 
Join Date: Apr 2011
Posts: 6
windows_7chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

yes, I excluded the debugging.

I think the problem is that every time rpmbuild will re-apply the patches, that is already applied in previous build.

Therefore even though the file content is the same, the modification time is changed. Thus the whole kernel is rebuilt.
Reply With Quote
  #9  
Old 20th April 2011, 09:38 PM
dd_wizard's Avatar
dd_wizard Offline
Registered User
 
Join Date: Sep 2009
Posts: 1,409
linuxfirefox
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

How about unpacking the src rpm, then building from the spec file after you make the changes. That will leave the previously compiled files in BUILD*.

dd_wizard
Reply With Quote
  #10  
Old 21st April 2011, 04:45 PM
paulhybryant Offline
Registered User
 
Join Date: Apr 2011
Posts: 6
windows_7chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

Thanks dd_wizard.

However, then all the files are still compiled. It still takes a long time to build the kernel.
Is there anyway that I can save time by only compiling the files that is changed with rpmbuild?
Reply With Quote
  #11  
Old 21st April 2011, 05:28 PM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304
linuxchrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

With the src rpm installed use the --short-circuit option to rpmbuild to skip direction to the compile phase.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #12  
Old 21st April 2011, 07:19 PM
paulhybryant Offline
Registered User
 
Join Date: Apr 2011
Posts: 6
windows_7chrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

Thanks brunson, that works!

Though the build time is still longer than I expected.

A fresh build of the kernel take me about 2 hours. And after changing two lines in mm/page_alloc.c,
it takes about 30 minutes to finish the build. Is this normal?
Reply With Quote
  #13  
Old 21st April 2011, 08:45 PM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304
linuxchrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

It depends on how the dependencies are set up in the make file. It still seems like a long time, but I haven't built a kernel in years.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #14  
Old 28th April 2011, 06:07 AM
sudhanAnand Offline
Registered User
 
Join Date: Apr 2011
Posts: 1
windows_vistachrome
Re: Use rpmbuild to compile kernel without re-compiling unchanged module

Quote:
Originally Posted by dd_wizard View Post
How about unpacking the src rpm, then building from the spec file after you make the changes. That will leave the previously compiled files in BUILD*.
dd_wizard

I am trying to change few files in the kernel and build it again,
all the changes are getting rewritten by update patches, is there anyway i can
specify while i use rpmbuild to skip all the update patches?

thnx!
Reply With Quote
Reply

Tags
compile, kernel, module, recompiling, rpmbuild, unchanged

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot compile kernel module dAverk Using Fedora 8 17th June 2010 02:30 PM
Akmods not finding kernel source (& Kernel Module size too large in Custom Compile) jbkt23 Using Fedora 27 18th July 2009 12:05 AM
Compile a New Kernel with a Module siddhx Using Fedora 2 27th March 2008 07:43 AM
Compiling a unique kernel vs. compiling a single module. jbkt23 Using Fedora 0 4th December 2006 12:11 AM
Compile kernel module mclerand Using Fedora 4 31st March 2006 05:33 PM


Current GMT-time: 00:34 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat