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

20th April 2011, 03:47 AM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 6

|
|
|
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!
|

20th April 2011, 06:42 AM
|
|
Registered User
|
|
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,060

|
|
|
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?
|

20th April 2011, 02:02 PM
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 811

|
|
|
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.
|

20th April 2011, 07:09 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 6

|
|
|
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.
|

20th April 2011, 08:33 PM
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 811

|
|
|
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.
|

20th April 2011, 08:34 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 6

|
|
|
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.
|

20th April 2011, 08:43 PM
|
 |
Retired Administrator
|
|
Join Date: Oct 2006
Posts: 21,509

|
|
|
Re: Use rpmbuild to compile kernel without re-compiling unchanged module
Quote:
Originally Posted by paulhybryant
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
|

20th April 2011, 08:49 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 6

|
|
|
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.
|

20th April 2011, 09:38 PM
|
 |
Registered User
|
|
Join Date: Sep 2009
Posts: 1,409

|
|
|
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
|

21st April 2011, 04:45 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 6

|
|
|
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?
|

21st April 2011, 05:28 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304

|
|
|
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.
|

21st April 2011, 07:19 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 6

|
|
|
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?
|

21st April 2011, 08:45 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304

|
|
|
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.
|

28th April 2011, 06:07 AM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 1

|
|
|
Re: Use rpmbuild to compile kernel without re-compiling unchanged module
Quote:
Originally Posted by dd_wizard
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!
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 00:34 (Sunday, 26-05-2013)
|
|
 |
 |
 |
 |
|
|