linux - Fast kernel recompile -


i'm trying automate process of recompile upgraded kernel. (i mean version upgrade)

what do:

  1. backup object files (*.o) rsync

  2. remove directory , make mrproper

  3. extract new source , patch

  4. restore object files rsync

but found doesn't make sense. since skip compiled things need hash, should removed it.

question: file need keep? or doesn't exists?

btw: know ccache broke little config change.

you're doing wrong™ :-)

keep kernel tree as-is , patch using appropriate incremental patch. example, 3.x, find these patches here:

https://www.kernel.org/pub/linux/kernel/v3.x/incr/

if have 3.18.11 built , want upgrade 3.18.12, download 3.18.11-12 patch:

https://www.kernel.org/pub/linux/kernel/v3.x/incr/patch-3.18.11-12.xz

(or .gz file, if don't have xz utilities installed.)

and apply it. "make oldconfig" , "make". whatever needs rebuilt rebuilt.

however, it's best not rely on object file dependency mechanism. knows if might end not being rebuilt though should due bug. i'd recommend starting clean every time "make clean" before applying patch, though rebuild everything.

are in such big need save build time? if yes, might better idea configure kernel ("make menuconfig") , disable functionality don't need (like device drivers hardware don't have, file systems don't care about, networking features not use, etc.) such kernel that's optimized needs takes 3 or 4 minutes build (normally, full kernel enabled need on half hour; or more these days, it's been long time since i've built non-optimized kernels.)

some more info on kernel patches:

https://www.kernel.org/doc/documentation/applying-patches.txt


Comments