I am trying to build from source and customize the kernel for the latest 17.10 distro (kernel v 4.13). I am following the instructions at https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel, however it seems that the build command

fakeroot debian/rules binary-headers binary-generic

does not work incrementally. Whenever I change the source of the kernel, the build does not include that in the newly generated .deb packages. I have to clean and rebuild everytime. Is there a way to force that build to be incremental?

  • Did you ever get an answer to this? I'm wondering the same :-( Dec 24 '17 at 4:23
  • Not really :/ But I have not had the chance to try out Colin's answer below, it seems promising. What I finally did is that I used the same kernel version from kernel.org, made all of my changes there and used a config file from a running Ubuntu machine. When I was happy with the results I generated a patch and applied it to the Ubuntu kernel and hoped for the best. It worked for me but that is not sustainable I guess. Dec 25 '17 at 18:25
  • See also stackoverflow.com/questions/24489734/…
    – Étienne
    Aug 13 '19 at 13:06

I use the the following when working on changes on the kernel:

1st build:

fakeroot debian/rules clean
debian/rules build
fakeroot debian/rules binary-headers binary-generic

change a source file, and do a quick rebuild:

rm debian/stamps/stamp-build*
debian/rules build
fakeroot debian/rules binary-headers binary-generic

The removal of the stamps/stamp-build allows one to rebuild without the need to perform the clean each time. If you are not changing the header files in any way then you can remove the binary-headers part of the final fakeroot build line to just rebuild the binary-generic packages

  • This rebuilds a lot ot stuff, not really incremental. Or did you mean to remove a specific stamp-build file?
    – Étienne
    Aug 13 '19 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.