PDA

View Full Version : Kernel compilation


eobard
09-11-01, 11:49 PM
Does kernel compilation for Mandrake 8.0 work the same way previous versions did? Its been a long time since I've messed with Linux. My notes from the last time I ran Linux say I need to:
1)make config
2)make dep
3)make clean
4)make zlilo (or make zimage)

Is that still how it goes?

Thelemac
09-12-01, 12:01 AM
Hm..not sure myself, but you could always check the how-to's or Mandrakes website for some correct information. :)

David
09-12-01, 07:24 AM
Ok, go to the folder with the kernel source. Type make menuconfig and select the options needed for your PC. When your finished, choose exit and say yes when asked about saving the config. Then type make dep this will take a few mins. Type make bzImage and this will take up to a few hours (depending on your PC). Then type make modules. This will take a wee while. Then type make modules_install (remember the underscore). Type: cd arch/i386/boot and then type ls. This will show you a load of files inc. one called bzImage. This is your kernel.

Type:

cp bzImage /boot/vmlinuz.new

This copies the kernel image to /boot/ directory

Type mcedit /etc/lilo.conf. Add the following to the bottom of the file:

image = /boot/vmlinuz.new
label = newkernel
root = /dev/xxxx


the xxxx depends on your root directory, on mine it is hda7

Then type lilo. reboot and check out your new kernel

***READ THIS FIRST***
This only works if you use LILO, I don't know anything 'bout GRUB.
LILO - Linux Loader
GRUB - Grand Unified Bootloader

eobard
09-12-01, 11:57 AM
Holy crap! Thanks for the answer, once I've successfully done that I think I'll perform successful microsurgery! I just remembered why bill has a monopoly on os'es. This isn't going to be fun!

Thanks.

David
09-13-01, 07:14 AM
You dont REALLY need to recompile your kernel unless your current one is way ancient or you desperately need that new feature.

JaY_III
09-15-01, 12:57 AM
and that is 1 of the problem with linux.
why can it be done in one command? yes i am lazy.....
can i write a batch for it (or what ever linux calls them)

i need to do some reading before i get linux fully.. the use it for a year.....
but it is easier to use now then 2 years ago, tried debian then

David
09-15-01, 10:27 AM
It can sort of be done easily. Give me your full system spec, what you need to use for your comp. Get hold of kernel 2.4.7
I'll set up a kernel config file for you, you can use it with a few keypresses; and I'll write a batch file* to do the make ..blah blah?

*batch files are called scripts in Linux and are more flexible (they can be ash, bash, sh, tcsh, ...)

How about it?

David
09-15-01, 10:29 AM
*note*

kernel compilation can be tricky. After a reinstall of SuSE 7 pro, it has taken me 4 days to get my CD burner and sound card and the framebuffer device (will try to get the nvidia drivers going soon) all working in the same kernel.

Balkoth
09-24-01, 06:51 PM
There is no need to re-compile your kernel at all!!

Just get the RPMs... Much easier :)

When installing the RPMs you must have all the other packages that the kernel depends on - there are a few.

Also its a good idea to grab the kernel-source RPM, cos without it youll get problems.

Install the packages that the kernel depends on first:

as root: rpm -Uvh packagename
then the kernel: rpm -i kernel-version.rpm

Then edit /etc/lilo.conf so that you can revert back to your old kernel in an emergency (note: if you use -Uvh instead of -i when installing the kernel, then you will not be able to revert back because -Uvh Upgrades ie replaces the old kernel. Whereas -i installs the new kernel beside the old one, so you can choose :) ). Give the command lilo -C /etc/lilo.conf, reboot and your done!

Much faster and EASIER than re-compiling, although the RPM kernel will not be tuned specifically for your system it IS tweaked and patched by Mandrakesoft so that all the nice features of Mdk will still work :)

I use Mandrake 8.0 with kernel 2.4.8-22mdk - Luuurrvly! Only fault is that supermount doesnt work (which really doesnt bother me) but the latest (2.4.8-26mdk) includes a couple of fixes for supermount so you might wanna go for that.

Kernel 2.4.9 is available, but I think Mandrakesoft are holding back their release of 2.4.9mdk to be included in Mandrake 8.1 :( .

Hope this is of some use :)

Hack
09-24-01, 09:24 PM
Originally posted by jay




and that is 1 of the problem with linux.





why can it be done in one command? yes i am lazy.....





can i write a batch for it (or what ever linux calls them)











You can, it's called a script, and I use one here. The contents of my do-kern script :




make menuconfig &&




make dep &&



make clean &&




make bzImage &&




make modules &&




make modules_install &&




cp System.map /boot &&




cp arch/i386/boot/bzImage /boot &&




lilo









This script reflects the setup for my system but it should give you a good base to go from. And in anticipation of your next question, the &&'s are there as a fall through mechanism so that if any command in the script should fail, the _next_ command won't be executed and thereby you get dumped right out of the script. And if you haven't installed gcc, glibc etc... well then just pipe this to /dev/null ....






Hack