Search code examples
linuxbuildlinux-kernelmakefileincremental-build

Fast kernel recompile


I'm trying to automate the process of recompile a upgraded kernel. (I mean version upgrade)

What I do:

  1. Backup the object files (*.o) with rsync

  2. Remove the directory and make mrproper

  3. Extract new source and patch

  4. Restore object files with rsync

But I found it doesn't make sense. Since skip compiled things need to get a hash, this should removed it.

Question: What file do I need to keep? or it doesn't exists?

BTW: I already know ccache but it broke with a little config change.


Solution

  • The incremental patch is a good way since it updates time stamps properly.

    (GNU) Make use time stamps to identify rebuild so just keep the time stamps to avoid rebuild.

    If we need rsync, we should use it with -t option.

    Also for a patch doesn't have incremental patches, we can make it manually by comparing patched files.