LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Kernel re-compile guide (https://www.linuxquestions.org/questions/slackware-14/kernel-re-compile-guide-213928/)

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
*********************************
Code:

cd /usr/src/linux
Code:

make mrproper
Code:

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.
Code:

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
Code:

make dep
Code:

make bzImage
Code:

make modules
Code:

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

mv /boot/System.map /boot/System.map.OLD
your System.map might also be called something like System.map-2.4.26 so check it out in your /boot directory first.

Code:

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

Code:

mv /boot/vmlinuz /boot/vmlinuz.OLD
Code:

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

Quote:

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

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)
 
Quote:

Originally posted by marlor
Code:

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

it should be
Code:

cp System.map /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.
Code:

:make dep is unnecessary now
cheers

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 System.map by hand

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


All times are GMT -5. The time now is 10:01 PM.