Jump to content
Sign in to follow this  
ianw1974

Quick and Easy Kernel Compile Upgrade

Recommended Posts

Whilst this has been done for Mandriva 2006, it can also apply for previous versions. There's a kernel faq in the faq section of this board, however, I decided to write this as a quick and easy way to upgrade without actually having to do much.

 

Normal kernel versions for Mandriva 2006 are 2.6.12.12mdk standard, up to 2.6.12.17mdk as of present. Some people have wondered what to do if you need to get something working/compiled that requires a later kernel. I also heard people mention problems trying to do manual kernel upgrades on Mandrake/Mandriva due to the way they are normally set up. So I figured, I'll give it a go and see if it's really that bad. As it happens, no, it worked a treat :P

 

First, I downloaded 2.6.15.6 from kernel.org (this is the latest as of todays date). Download the bz2, it's 10MB smaller than the GZ. This was saved to my ~/Download directory. In my example, this refers to /home/ian/Download. First off, you need to extract it and update the symlink, so:

 

su (supply root password when prompted)
cd /usr/src
tar xvf /home/ian/Download/linux-2.6.15.6.tar.bz2
rm linux
ln -s linux-2.6.15.6 linux

 

Now, you've unpacked it, this is where we issue a few commands and then sit back and wait for about 30 minutes or so. Kernel compilation can take some time, especially if your machine is low spec. Mandriva's kernels are mostly modular, and for this, we're going to keep it the same. First, check that you can see files in your /boot directory. Specifically, the /boot/config file which is a symlink to your current kernel config file. If you can see this, then this makes it real easy. Why it makes it easy is that your current config file will be read by the kernel, therefore using all the settings from your existing Mandriva kernel. That way you don't have to worry about building a kernel that misses something and causes problems later. So, the next steps we do are:

 

Please note, if you want the Mandriva Bootsplash, make sure you check the Bootsplash section towards the bottom of this post. If you continue as below, the kernel will be compiled without bootsplash support.

 

make mrproper (this clears any previous kernel compile, so for first time round, not really required)
make menuconfig (when this loads, just tab to exit, and then save the configuration

 

and that's it, your kernel config is exactly the same as your current 2.6.12 Mandriva kernel.

 

Compiling the kernel

 

Now, we need to compile it. I normally just add it all on one line, so that you just leave it go and it'll finish and complete automatically for you. Below, I've listed the options you can do in 3 stages, and then all in one:

 

make
make modules_install
make install

 

this means you have to keep checking after each stage. However, this one command will do it all for you:

 

make && make modules_install && make install

 

The first part compiles the kernel and modules. The second part installs the modules and the third part copies the kernel into place, creates the initrd image that Mandriva requires and copies the system.map, kernel.h and config files into the /boot directory. The contents of my directory is listed as follows:

 

[ian@elise ~]$ ls -l /boot
total 5404
-rw-r--r--  1 root root	 512 Jan 13 22:01 boot.0300
lrwxrwxrwx  1 root root	  19 Mar 10 20:52 config -> config-2.6.12-17mdk
-rw-r--r--  1 root root   71358 Feb 13 22:27 config-2.6.12-17mdk
-rw-r--r--  1 root root   65014 Mar 10 20:47 config-2.6.15.6
drwxr-xr-x  2 root root	 120 Jan 13 21:45 grub/
-rw-------  1 root root  234244 Feb 25 15:01 initrd-2.6.12-17mdk.img
-rw-r--r--  1 root root  210860 Mar 10 20:47 initrd-2.6.15.6.img
lrwxrwxrwx  1 root root	  23 Feb 25 15:01 initrd.img -> initrd-2.6.12-17mdk.img
lrwxrwxrwx  1 root root	  27 Mar 10 20:52 kernel.h -> /boot/kernel.h-2.6.12-17mdk
-rw-r--r--  1 root root	 695 Feb 25 16:06 kernel.h-2.6.12-17mdk
-rw-r--r--  1 root root	 695 Mar 10 20:49 kernel.h-2.6.15.6
-rw-------  1 root root  343552 Mar 10 20:47 map
lrwxrwxrwx  1 root root	  15 Jan 13 22:02 message -> message-graphic
-rw-r--r--  1 root root  246542 Mar 10 20:47 message-graphic
-rw-r--r--  1 root root	 116 Jan 13 22:02 message-text
lrwxrwxrwx  1 root root	  23 Mar 10 20:52 System.map -> System.map-2.6.12-17mdk
-rw-r--r--  1 root root  639466 Feb 13 22:27 System.map-2.6.12-17mdk
-rw-r--r--  1 root root  622211 Mar 10 20:47 System.map-2.6.15.6
-rw-r--r--  1 root root	 256 Jan 13 22:01 uk.klt
lrwxrwxrwx  1 root root	  20 Feb 25 15:01 vmlinuz -> vmlinuz-2.6.12-17mdk
-rw-r--r--  1 root root 1607727 Feb 13 22:27 vmlinuz-2.6.12-17mdk
-rw-r--r--  1 root root 1448482 Mar 10 20:47 vmlinuz-2.6.15.6

 

I didn't bother to update my symlinks for config, etc, etc. I could do, but for now, I've installed it as it. The last command also modified my lilo configuration and created an entry called "26156". So my main entries allow me to boot my standard Mandriva kernel, and the last one allows me to boot my newly created kernel. Updating your symlinks is only required if you have implicitly pointed your lilo/grub configuration to look at the symlinks instead of the actual kernel version itself. My new kernel is functioning correctly without having to do this.

 

Mandriva Bootsplash

 

The Mandriva bootsplash will no longer be present, but this is only a minor thing. A patch can be applied to get it back. Therefore, you need to change the steps from "make menuconfig". First, you need to download from here:

 

ftp://ftp.openbios.org/pub/bootsplash/ker...1.6-2.6.15.diff (info provided in post #8 below by mandrivauser ceco)

 

The steps to enable are as follows:

 

cd /usr/src/linux
patch -p1 < /path/to/bootsplash-3.1.6-2.6.15.diff
make menuconfig
Device Drivers --> Graphics Support
Scroll to bottom and select Logo Configuration
Disable Bootup Logo
Select Bootsplash Configuration
Enable Bootup Splash Screen

 

exit and choose save option, then continue using the compile steps as shown above. If using later kernel version in the future, then check for a later version of the bootsplash here: http://www.bootsplash.org/kernel.html

 

Additional posts below list success stories as well as problems encountered and how to resolve them. Please read all the below so that you can make sure your kernel migration is a success.

Share this post


Link to post
Share on other sites

I wouldn't compile my kernel as root, it doesn't sound like a good idea. Maybe in a fakeroot environment, but why not as plain user?

Edited by scarecrow

Share this post


Link to post
Share on other sites

Plain user wouldn't have the rights necessary for writing to the directories. I've never heard of issues compiling a kernel as root, and most everyone does it in this manner. I don't know of any guides that suggest doing it otherwise, or any reasons to do such.

 

Note that these directions are for compiling from pure source, not rebuilding a source rpm.

Share this post


Link to post
Share on other sites

What about multimedia kernels? I've seen that there is "kernel-multimedia-2.6.14-0.mm.7mdk-1-1mdk.i586.rpm" (http://www.mde.djura.org/2006.0/RPMS/kernel-multimedia-2.6.12-12.mm.13mdk-1-1mdk.i586.rpm) and kernel-2.6.14.1mdk-1-1mdk.i586.rpm (ftp://mandrake.contactel.cz/Mandrakelinux/devel/cooker/i586/media/main/kernel-2.6.14.1mdk-1-1mdk.i586.rpm)

Which one to use? Which is better and what is the difference?

Share this post


Link to post
Share on other sites

I would also recommend reading the kernel build how-to on digital hermit site. It contains generic instructions, but is worth reading anyway.

 

If I remember correctly, that how-to also explains how to patch a vanilla kernel with, e.g., "multimedia" patch. -mm patches are, according to kernel.org, "more experimental".

Share this post


Link to post
Share on other sites

Hi Ian

All done and it worked fien, only problem , as expected I lost my nvidia drivers because I suppose the kernel-source does not match the kernel. Sorry, I just went back to init3 and relaunched the NV installer and all is now in order, I will now try my software to see if all is ok. :thumbs:

 

uname -a :

Linux linux-box 2.6.15 #1 Sun Mar 12 17:58:03 GMT 2006 i686 AMD Athlon XP 3000+ unknown GNU/Linux

 

I didn t need to touch Lilo, it was uodated automatically.

 

Maybe a stupid question but do I leave my rpm update on automatic? Will the updates that I get from ftp servers be understood by the new Kernel or do the assume I still have the 2.6.12?

:mellow:

Stef

Edited by sjaglin@yahoo.co.uk

Share this post


Link to post
Share on other sites
The Mandriva bootsplash will no longer be present, but this is only a minor thing. I believe a patch can be applied, will update when I've checked/tested to see if the patch sorts it out.

 

There is a realised patch for 2.6.15.You can download it from here:

ftp://ftp.openbios.org/pub/bootsplash/ker...1.6-2.6.15.diff

I've tested it and it works!

 

To apply the patch follow this instructions:

cd /usr/src/linux
patch -p1 < /path/to/bootsplash-3.1.6-2.6.15.diff

And then u have to change your configuration of the kernel with "make xconfig" or "make menuconfig" if its not changed.U should enable "Frame-Buffer support" and select "VESA VGA graphics console" in the Console Drivers section.You also should disable "Use boot logo" and enable "Use splash screen".

Edited by Ceco

Share this post


Link to post
Share on other sites

It won't automatically update your kernel. What might be best to stop kernel-source upgrades is to remove mandriva kernel-sources, and just leave the 2.6.15.6 kernel source in place. That way it'll never attempt to update the kernel source, and you can do all this manually at your leisure.

 

Note, that if for example 2.6.16 came out, you could download the source, and compile in the same manner, since it would read your existing config. To make sure that this reads your 2.6.15.6 config, make sure symlinks are updated in /boot so that they point to 2.6.15.6 and not 2.6.12.17 or whatever you have installed with Mandriva.

 

You will not be able to remove your Mandriva 2.6.12.xx kernel, I just tried on my test system and it said it will break your system :D

 

But it's there as a fall back in case of any probs using 2.6.15.6. Enjoy :beer:

Share this post


Link to post
Share on other sites
There is a realised patch for 2.6.15.You can download it from here:

ftp://ftp.openbios.org/pub/bootsplash/ker...1.6-2.6.15.diff

I've tested it and it works!

 

To apply the patch follow this instructions:

cd /usr/src/linux
patch -p1 < /path/to/bootsplash-3.1.6-2.6.15.diff

 

And then u have to change your configuration of the kernel with "make xconfig" or "make menuconfig" if its not changed.U should enable "Frame-Buffer support" and select "VESA VGA graphics console" in the Console Drivers section.You also should disable "Use boot logo" and enable "Use splash screen".

 

Yes, this works. To find the options in case you're unsure of where they are, this is how I did it:

 

make menuconfig
Device Drivers --> Graphics Support
Scroll to bottom and select Logo Configuration
Disable Bootup Logo
Select Bootsplash Configuration
Enable Bootup Splash Screen

 

exit and save, and then this is when you compile the kernel using the commands I listed before.

 

I've not used the archck link iphitus posted, as I'm unsure of whether this relates just to the "arch" distro, or is generic.

Share this post


Link to post
Share on other sites

I wouldnt have posted if it wasnt generic, there would be no point in doing such. By their nature though, kernel patches and patchsets are mostly distro inspecific.

 

The poor name is a hangover from when I used to solely make it for the Archie liveCD. It's branched out since and is used by a heap of Gentoo, Arch, Fedora, and other users....

 

iphitus

Share this post


Link to post
Share on other sites

Ah OK, cool :P

 

Two patches for anyone to use now! :D

Share this post


Link to post
Share on other sites

After installing 2.6.15.6 there is an error while boot:

Mounting local filesystems: mounting special device: mount: /dev/hdc does not exist!

But /dev/hdc exist!!! How to fix this?

Edit: I've returned to the old 2.6.14-mm because of this :(

Edited by Ceco

Share this post


Link to post
Share on other sites

Check your /etc/fstab. If it mentions supermount, then this could be the problem. My cd-rom's are configured for "auto" and therefore mount no problems with 2.6.15.6. When you compiled 2.6.15.6 were you in your 2.6.14 mm kernel? If so, this could also explain why.

 

This howto was written on the basis that you have a Mandrake/Mandriva kernel installed. A stock kernel that has settings relevant to Mandrake/Mandriva. On this basis it works. I've no idea how your 2.6.14mm kernel has been configured, so it could be you missed a setting somewhere, which is why you are now experiencing problems. If you can, I would suggest you boot into a Mandrake/Mandriva kernel, and then rerun the compile, making sure that your /boot/config symlink is pointing to a Mandrake/Mandriva config file.

 

The only problem I've found so far is with the mandi service failing, probably due to some patch applied to the kernel. This isn't required anyway, as shorewall will work perfectly well without it. It just means if you configure using mcc, you have to disable the interactive option and when prompted to install mandi-ifw to click cancel, and just install shorewall after this.

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...