# Kernel compile time

## LIsLinuxIsSogood

I'm recently finding that the upgrades and changes to my custom linux kernel are taking a lot more time to compile than I am wanting...how might I reduce compile time, what are the methods of either reducing size, or just compile time for the kernel.  My system is very basic, and my kernel is steadily becoming larger over time.  I wonder if i have some options that could be removed, but I haven't any ideas for trying to spot and remove the unnecessary kernel options.

----------

## Jaglover

Start with make allnoconfig, add only what you need. Will take a couple of hours, probably. Keep some stuff ready to avoid brain overheating. My last kernel compile time was 1 minute 32 seconds, with -j9.

----------

## LIsLinuxIsSogood

Thanks for the suggestion. I want to do what you are suggesting, so just to make sure, the make allnoconfig I just ran and it took about 2 minutes of compiling the kernel.  So what's the next step, is it to compare the configs and alter them within just that file?  Then make the target(s) for kernel, modules, everything.  The reason I'm asking is because i've seen some information (possibly bad info) about the possible downsides of using the menuconfig option.  What is being recommended in terms of the changes to the kernel now that everything is set to no?

----------

## Jaglover

Now you run make nconfig and get ready to learn about kernel options you are going to enable.

----------

## LIsLinuxIsSogood

K I am not trying to break any records with the compile time, just need to do something about it, since it is getting ridiculous.  I do have some questions looking at those kernel options, would like to know just about some of the more standard or basic options and whether it might save time later down the road, just to get some help now for it...

a) Will it be worthwhile usually in the past that is all I've done but to include loadable module support, but since I will be reducing the size of the kernel it seems like a relevant issue to be worried about

b)  What specific types of things take up the compile time and I will do my best to avoid them...like device drivers, and stuff like that, or is it usually just a conglomerate of different items that take long to complete the process of compiling the kernel?

----------

## Roman_Gruber

```
man make
```

 *Quote:*   

>       -j [jobs], --jobs[=jobs]
> 
>             Specifies the number of jobs (commands) to run simultaneously.  If there is more than one -j option, the last one is  effective.   If  the  -j
> 
>             option is given without an argument, make will not limit the number of jobs that can run simultaneously.
> ...

 

e.g. for 8 threads

make --jobs 8 && make --jobs 8 modules_install

 *Quote:*   

> The reason I'm asking is because i've seen some information (possibly bad info) about the possible downsides of using the menuconfig option. 

 

just use make oldconfig when you are upgrading. When you do not have any particular needs to change anything.

----------

## LIsLinuxIsSogood

That is a good idea. I will keep it in mind   :Razz: 

----------

