S
S
Sergey Karbivnichy2021-03-20 20:00:30
linux
Sergey Karbivnichy, 2021-03-20 20:00:30

How to compile only changed files when building the kernel?

To install an old version of VirtualBox, you need to build the 5.4.xx kernel. I assembled it (I forgot to add support for Intel HD Audio beforehand). VirtualBox worked, only there was no sound on the laptop. Well, I think, now I will connect support in the form of a module and quickly rebuild it. But then a bummer awaited. In my opinion, after enabling the module, judging by the output of make, the kernel began to build again. Further, without changing anything, I launch the assembly and again it takes a long time. A clean build takes 52 minutes, and a rebuild (no changes) takes 52 minutes too! Having vast experience in assembling software for a variety of operating systems and devices, I know that only changed files are compiled during reassembly. I bet I'm doing something wrong.

fakeroot make-kpkg -j 3 --initrd --append-to-version=-custom kernel_image kernel_headers

PS: Linux last compiled 2.6 or 3.xx, maybe something has changed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Yuriev, 2021-03-21
@hottabxp

try instead of your command

make -j3 bindeb-pkg LOCALVERSION=-custom KDEB_PKGVERSION=$(make kernelversion)

Previously at least it worked
UPD: in 4.9.x it worked

V
ValdikSS, 2021-03-21
@ValdikSS

The kernel itself only supports rebuilding changed files/options, but make-kpkg rebuilds the kernel clean.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question