On Thursday 12 December 2002 2:31 pm, Angus Auld wrote:
> Greetings,
> I would like to get some feedback on kernel recompiling.
> Is it something that is recommended? Is it difficult to do?
> I've installed a kernel on my previous 8.2 system, but
> never recompiled an existing one.
>
> I'm a newbie, and just needing to ask. ;-)
> TIA for any insight.
>
>
> --Angus

Yes it is recommended and no, it is not difficult to do, but its not exactly 
easy either. It's like most other aspects of linux, the first few attempts 
can be pretty baffling and may only result in failure, but the more often you 
do it the easier it becomes and also you gain a better understanding of your 
system. Before you pile in though, you really want to read through some 
proper documentation on the subject; the best place to start would be the 
kernel howto...... (you may already have them installed)...

/usr/share/doc/HOWTO/HTML/en/Kernel-HOWTO.html

A few general points before you start on compiling your own kernel;
1) Make sure you are familiar with navigating your system in text mode, ie 
from a real console without running X
2) Make sure that you know how to edit files using either vi or emacs from a 
console
3) MOST IMPORTANT...make sure you have already made a boot floppy from the 
current kernel that you have tried and tested and know will work if you 
happen to mess up your boot sector. (mkbootdisk)  see man mkbootdisk.

Install the kernel source;      urpmi kernel-source
Then cd to the source directory as root; cd /usr/src/linux (the linux bit here 
is actually a symbolic link that points to /usr/src/linux-2.4.19-16mdk on 
MDK9.0)

A few other general points;

a) Edit the Makefile (/usr/src/linux/Makefile) line "EXTRAVERSION =" to 
something that suits you; eg,  EXTRAVERSION = -superduper
b) Use either "make menuconfig" or "make xconfig" to edit the options, I 
prefer menuconfig.
c) Go through the options carefully and try to read the help files with each 
to understand what you need and what you don't. There are an awful lot of 
them, but also an awful lot you won't need (hence the potential benefit to 
speeding up your system).
d) One thing that stumped me for a long time was the very first option;
"Code maturity level options"-->"Prompt for development.....drivers"
Without selecting this I was unable to select an option for frame-buffer 
support under the later section of console drivers so I was only getting a 
blank screen with my normal vga=788 lilo boot option.
e) Make sure you compile the option for your root file system type into the 
kernel rather than as a module or your kerel will get in a tizzy when it 
tries to boot. (eg, if you use ext3 make sure you compile this into the 
kernel).
f) When you think you have selected all the options you need, then exit 
menuconfig of xconfig and then run "make dep"
g) Then compile the kernel with "make bzImage"
h) Then the modules with "make modules"
i) Install the modules with "make modules_install"
j) Install the kernel with "make install" (check the symlinks in /boot that 
they point where you want them to). Other people may disagree with this part 
and would rather just copy the bzImage and System.map to /boot
k) Edit /etc/lilo.conf and make sure you have the correct entries for your new 
kernel
l) Easily forgotten after all your head scratching... RUN lilo to update your 
boot sector.
m) reboot.... select your new superduper kernel...  and keep your fingers 
crossed!

        Good Luck,      Robin

ps, If you use NVIDIA drivers, you will have to run make again in their source 
directories to get them to work with the new kernel.

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to