-   Slackware (
-   -   Kernel re-compile guide (

marlor 08-05-2004 03:48 PM

Kernel re-compile guide (simple)
Hi people,

as a lot of people end up having to recompile their kernel because they forgot to add something like ACPI support or they want to customize their current kernel, i decided to write this quick guide!

it works for my kernel 2.4.26 and should have not much problem with other kernels.

here we go the 5 magic steps:

STEP1: find your config
locate your original config file
it should be /boot/config or something similar like /boot/config-2.4.26

STEP2: prepare for configuration

cd /usr/src/linux

make mrproper

cp /boot/config-x.x.xx .config
replace the x.x.xx with whatever your config file in your /boot directory is called. it might be also just called config. and yes there is a space before .config

STEP3: configuring kernel
the next code will pop up the kernel configuration, there you can adjust the kernel to your needs. a tip is, do not add or remove too many things at once because IF something doesn't work later on, you will know what caused it.

make menuconfig
now when you are done don't forget to save the changes

STEP4: getting the new modules on your machine
the next few codes will basically make your new files/modules ready for you. each of these 4 commands will take some time to finish its proccess so lay back and have some tea ;)
(for kernel 2.6.xx you don't need this first step "make dep") thx mm3000

make dep

make bzImage

make modules

make modules_install
STEP5: final touch'z
now make sure that lilo boots your newly configured kernel with the new settings.

mv /boot/ /boot/
your might also be called something like so check it out in your /boot directory first.


cp /boot
still in the /usr/src/linux dir, the above command will copy the from the /usr/src/linux dir to your /boot dir.


mv /boot/vmlinuz /boot/vmlinuz.OLD

cp arch/i386/boot/bzImage /boot/vmlinuz
vmlinux is the file that your lilo call's up. so check your etc/lilo.conf and find the following line:
image = /boot/vmlinuz

it could be also something like /boot/vmlinux-2.4.26
in this case make sure that the vmlinuz in your /boot directory and the vmlinuz in your lilo.conf match. if you do edit lilo don't forget to save it first and then run lilo.

i hope this will help someone :D

good luck

Cedrik 08-06-2004 01:49 AM


cp arch/i386/bzImage /boot/vmlinuz
should be :

cp arch/i386/boot/bzImage /boot/vmlinuz
But great tutorial tough, you kept it simple ;)

marlor 08-06-2004 02:11 AM

oops :rolleyes:

fixed it, thanks :)

rgiggs 08-06-2004 02:56 AM

Re: Kernel re-compile guide (simple)

Originally posted by marlor

cp / /boot
still in the /usr/src/linux dir, the above command will copy the from the /usr/src/linux dir to your /boot dir.

it should be

cp /boot

marlor 08-06-2004 03:36 AM

thx :)

sh*t happens if you write a guide at 3-4 am :D

doesn't matter much though, moderator said the 2 guides in slack forum are enough, so this will fade away in 1 or 2 days

mm3000 08-08-2004 01:47 AM

Great guide, easy to follow.
Just one thing 'make dep' in 2.6.7 gives this output.

:make dep is unnecessary now

Cedrik 08-08-2004 03:57 AM

In fact to build 2.6 kernel and modules you just have to type : make
To install modules, it is as usual : make modules_install
At least to install kernel you can : make install, but I prefer and recommend to install kernel and by hand

This is a four-step procedure now ;) (taking in account make *config)

All times are GMT -5. The time now is 03:20 AM.