Introduction
Why on earth would you want to slow down your kernel compile? Most people want to speed things up, optimize it so it's using every morsel of CPU and RAM so it's over and done with quicker. Well, not everyone wants or needs this. A kernel compile may drop a system that's overloaded or in heat stress. Sometimes you just want a new kernel and a slow but steady pace that won't overdo it is exactly what you need...
Kernel config for Kernel 2.4
You'll need to run 'make menuconfig' and configure all the things you normally need.
Then you'll need to edit the Makefile in the kernel source root directory:
Change this:
AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = $(CROSS_COMPILE)ar NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump |
To this:
AS = sleep 5 ; $(CROSS_COMPILE)as LD = sleep 5 ; $(CROSS_COMPILE)ld CC = sleep 10 ; $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = sleep 5 ; $(CROSS_COMPILE)ar NM = sleep 5 ; $(CROSS_COMPILE)nm STRIP = sleep 5 ; $(CROSS_COMPILE)strip OBJCOPY = sleep 5 ; $(CROSS_COMPILE)objcopy OBJDUMP = sleep 5 ; $(CROSS_COMPILE)objdump |
Then do the usual 'make all install' to compile and install your kernel.
Kernel config for Kernel 2.6
Looks pretty similar to what you have to do for Kernel 2.4...
Change this:
AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = $(CROSS_COMPILE)ar NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump |
To this:
AS = sleep 2 ; $(CROSS_COMPILE)as LD = sleep 2 ; $(CROSS_COMPILE)ld CC = sleep 5 ; $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = sleep 5 ; $(CROSS_COMPILE)ar NM = sleep 5 ; $(CROSS_COMPILE)nm STRIP = sleep 5 ; $(CROSS_COMPILE)strip OBJCOPY = sleep 5 ; $(CROSS_COMPILE)objcopy OBJDUMP = sleep 5 ; $(CROSS_COMPILE)objdump |
Then do the usual 'make all install' to compile and install your kernel.
Explanation
What the above does is cause the compilation to take a break for a few seconds before each compile command. 'sleep 5' means wait for 5 seconds. 'sleep 15' means wait for 15 seconds. The sleep command doesn't use any processing power to wait around. That gives your CPU a chance to cool down a bit between each compile instruction.
Feel free to adjust the numbers above higher or lower depending on your own system.