Jump to content

2.6 kernel compilation


arthur
 Share

Recommended Posts

Okay, it seems that the FAQ is a bit out of date now :jester:

 

According to the Gentoo handbook, but applicable to Mandrake, compiling the 2.6.x series kernel is a bit different from 2.4 or earlier. In all the commands following, replace the 'x' in 2.6.x with the proper number.

 

You still start with:

tar -xvfz linux-VERSION.tar.bz2

But sometimes that doesn't work for me, so I do "su" then I start "konqeror" and just use Ark to manually extract the source to /usr/src.

 

Then "make mrproper"

 

You should get a copy of the Mandrake default 2.6 config file (from your friends, or just get it from the 2.6 kernel itself) to save you a lot of hassle.

cp /path_to_config /usr/src/linux-2.6.x/.config
make xconfig

Now fine-tune your kernel to your machine, and apply any patches you want. Then save and

make && make modules_install

Note that there's no "make dep" or "make bzImage".

The next section is essentially the same as in the FAQ

cp .config /boot/config-2.6.x
cp System.map /boot/System.map-2.6.x
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.x

Okay, here's the new part that I always do, but some people may not need it:

cd /dev
mkinitrd /boot/initrd-2.6.x.img 2.6.x

You need a loopback device in /dev/ for this to work. then edit lilo.conf and add the new entry with image=vmlinuz-2.6.x and the path to the initrd image.

Link to comment
Share on other sites

for a .bz2 do;

tar -jxfv

or leave of the v.

 

make mrproper is always a good idea (i still do it) but if you watch

make menuconfig (and maybe ..xconfig etc...)

you'll see it make mrproper (or at least I have).

 

you can still do;

make clean bzImage modules modules_install

(I have) actually I add -j7 to/b4 modules which is why I prefer to do it myself as it's much faster to make 7 mods at a time.

 

make install

use to/or could be a bad thing. Last time, and one of the few times (for fun), I tried it it worked and didn't overwrite the old like it use to. Which wasn't good if the new kernel didn't boot. Can't believe it was ever like that, but it was.

Link to comment
Share on other sites

make install

use to/or could be a bad thing. Last time, and one of the few times (for fun),

I tried it it worked and didn't overwrite the old like it use to. Which wasn't good if

the new kernel didn't boot. Can't believe it was ever like that, but it was.

 

In my experience, that only happens/happened (never tried with 2.6) when compiling exactly the same version

of an already installed kernel: the vmlinuz image and also the modules directory will have the same

name and be overwritten for that reason.

A way out was to edit (by hand, with vi eg.) the makefile and modify the line

EXTRAVERSION =-nnnmdk

(nnn=some number)

to

EXTRAVERSION =-nnnmdk.myownnewkernel

or something like that. Then the newly built vmlinuz and modules will not have the same names as the

already installed ones, and won't overwrite them.

Cocco

Link to comment
Share on other sites

In 2.6 that is done automatically by Mandrake with a mandrake kernel source...I don't know how. The new modules directory is /lib/modules/2.6.x-mdkcustom.

 

A non-booting kernel happens to me often since I experiment a lot, so I don't do the "make install". Better to be careful.

Link to comment
Share on other sites

Oh sorry, I hadn't understood the point. Yes, make install will update the softlink vmlinuz (and initrd,...) in /boot/ to the newly built stuff, whatever it's named, and run lilo. If all the entries in lilo.conf point to the link /boot/vmlinuz , and the new image won't boot, it's troubles. One might add an entry in lilo.conf, which points not to the softlinks but to the actual files (of an old and safe kernel) in /boot/ . But then you're right, it's easier to install the files by hand...

Cocco

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...