Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO Update the Kernel fast and painlessly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
infion
n00b
n00b


Joined: 01 Nov 2004
Posts: 4
Location: Potsdam and Gehlenberg, Germany

PostPosted: Sat Dec 17, 2005 5:21 pm    Post subject: HOWTO Update the Kernel fast and painlessly Reply with quote

This HOWTO is intended for people, who do not use genkernel, who know how to configure a kernel and who want to update the kernel just easily.

Problem:
We all know the situation when portage installed new kernel-sources to /usr/src or the situation when we want to add another feature to our kernel, we have to do it all by hand.
The steps to do for the first case are to link the new sources to /usr/src/linux, to copy the kernel-configuration and then to call:
Code:
make oldconfig
make
make modules_install

Now we have still to copy the kernel-image to the right position and perhaps we have to mount /boot and update a link or if we use lilo, we'll have to call dolilo.
If we use drivers like nvidia-kernel or alsa-driver, we'll also have to remerge them.
For the second case we start just with an make menuconfig and then have to do all the steps from the first case beginning with make.

A lot of stupid stuff to do!

Solution:
A script called doLinuxKernel formerly known as doGentooKernel!

Okay here an explanation how it works.
If you call doLinuxKernel without any arguments:

  1. It searches the newest kernel in /usr/src.
  2. It links the newest kernel to /usr/src/linux.
  3. It copies the kernel-config from /proc/config.gz.
  4. It runs make oldconfig.
  5. It runs make.
  6. It runs make modules_install.
  7. It installs the kernel.

    • If generic is specified in /etc/doLinuxKernel.yml for install_kernel, the kernel-image will be copied and linked and if necessary /boot will be mounted for it.
    • If dolilo is specified, it will do the job.

  8. If anything is specified for post_run in /etc/doLinuxKernel.yml it will be run.


If you have a scenario like in the second case and you only want to add a feature to your kernel, you can call doLinuxKernel -STm

  • -S: stands for --skip-search-kernel and the newest kernel will not be searched
  • -T: stands for --skip-transfer-kernel and no kernel-configuration will be copied, so the current .config will be used
  • -m: will call make menuconfig

and now everything will be done like in the first case beginning with make.

doLinuxKernel has much more functions and it is still under development.
You can find it here: http://www.ularx.de/doLinuxKernel

The authors are pleased about feedback.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Sat Dec 17, 2005 5:58 pm    Post subject: Reply with quote

I wrote such a script for myself too (a 10 minute job, very crappy, just to fit my special situation). It doesn't compile the kernel for me (I prefer to do that manually), but it copies all kernels that are present in /usr/src to /boot, appends proper version numbers to bzImage/System.map, and re-generates /etc/grub/grub.conf so that newest / current kernel is made the default entry and all other kernels are still selectible from the menu.

If you have to recompile kernels a lot (like I have to due to problems / testing / investigating a kernel bug I'm suffering from), this sure saves a lot of time and annoyance when you have to always edit and re-edit the grub.conf and copy kernels and stuff.
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Sat Dec 17, 2005 6:52 pm    Post subject: Reply with quote

frostschutz wrote:
I wrote such a script for myself too (a 10 minute job, very crappy, just to fit my special situation). It doesn't compile the kernel for me (I prefer to do that manually), but it copies all kernels that are present in /usr/src to /boot, appends proper version numbers to bzImage/System.map, and re-generates /etc/grub/grub.conf so that newest / current kernel is made the default entry and all other kernels are still selectible from the menu.

If you have to recompile kernels a lot (like I have to due to problems / testing / investigating a kernel bug I'm suffering from), this sure saves a lot of time and annoyance when you have to always edit and re-edit the grub.conf and copy kernels and stuff.


Most of what you're talking about gets done by doing "make install" after you do "make modules_install"

edit: Though sometime (after I get around to adding config.gz support to my kernel) I'll try out the original poster's link on my next new kernel update
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum