问题
As I remember, when I rebuild image (more than once) from pure Linux kernel source tree, basically, the build system compiles only the changed codes and incrementally links them with other unchanged object files which were compiled before.
However, I couldn't find any options to make Ubuntu kernel build system to build image in the same manner. Simply, a line of change takes too long time to be compiled and linked. Is there any options for it, or any alternative practices?
Here is my shell command to build a kernel image in Ubuntu way.
fakeroot debian/rules -j8 binary-headers binary-generic
My current kernel source version is like below.
3.13.0-XXX-generic
回答1:
It looks like you're using Ubuntu's scripts for building kernel packages for the distribution. If they're like Debian's, they will rebuild everything, I think.
Simply don't use them unless you really need to recreate the packages exactly. Instead use make -j8 deb-pkg
, that will build packages for you without forcing a make clean
.
回答2:
I had the same question, but unfortunately I do not believe Andreas Bombe's answer is correct anymore. Looking at scripts/package/Makefile where deb-pkg
is defined, the first line of the recipe is $(MAKE) clean
.
I think you want the target defined next in the Makefile: bindeb-pkg
which does almost the same thing (it doesn't build a tar ball of the source, I think) without cleaning. See the Makefile for more details.
回答3:
do "make bindeb-pkg" that just rebuilds the kernel without enforcing make clean But have in mind that this build might in a few cases produce an unbootable kernel, or it might not compile at all, depending on the changes you have done in your kernel configuration.
来源:https://stackoverflow.com/questions/24489734/how-can-i-rebuild-ubuntu-kernel-sources-without-recompiling-any-of-unchanged-fil