In my project I configure the kernel (2.6.32) in block/ioctl.c
.
We all know that kernel compiling and building takes few hours. Even for a small change, I'm compiling from scratch. So is there any way to compile and build only the changed file?
1 Answer
No, kernel compiling does not take “few hours”. Linus Torvalds said that it took him 12 minutes in the old days, and a lot less these days. Of course it depends whether you're compiling a kernel with just the drivers you need for your hardware, or a distribution kernel with all the drivers people may need — but even for a distribution kernel on a slightly elderly machine, it takes way less than an hour to do a full build.
Furthermore, if you change one file of the kernel, you don't need to do a full build. Just run make
(and make modules
if there are modules you need to recompile), and only the changed file (and the files that depend on it, if it's a header file) will be recompiled.
-
1Even the smallest change in configuration results in entire kernel being rebuilt, and it does take hours. It always did as long as I remember (20 years and counting). It became worse when
deps
target was dropped.– ajehMay 12, 2018 at 13:06
block/ioctl.c
code. simple ex: addindprintk
function. And changing some macro kind of things