Friday, February 4th, 2005

How to change or modify your Linux kernel under gentoo

Filed under: — Daniel Lemire @ 14:29

Here’s a quick guide to upgrading or modifying your kernel under gentoo. I assume you have genkernel installed (do “emerge genkernel”).

First of all, if you only want to add or remove elements to your kernel, or change options, you can do this as root:

genkernel --no-clean --menuconfig all

Do your changes and reboot.

If you want to change kernel, then look under /usr/src. Suppose the source code of your new kernel is in /usr/src/newkernel, then do

genkernel --menuconfig --kerneldir=/usr/src/newkernel all

Configure your new kernel the way you like it. Then do

rm /usr/src/linux
ln -s /usr/src/newkernel /usr/src/linux

If you have nvidia (binary) drivers, do

emerge nvidia-glx nvidia-kernel

Finally, possibly after mounting /boot (”mount /boot”) edit /boot/grub/grub.conf, basically just changing the name of the kernel throughout. Reboot and you have a new kernel compiled to your needs for your machine.

If you think this is hard, think again! When was the last time you changed your Windows kernel? Adding stuff to the Windows kernel is relatively (too) easy, but so is it easy with gentoo (single command followed by a reboot) whereas actually changing your Windows kernel is not so easy and is typically only done when you upgrade all of Windows: a task better left to experts.

2 Comments »

  1. Well, it’s a bit challenging.
    I can bring up my prism54 card with WEP well enough under the live CD
    (I position the firmware on a thumb drive, and copy the file to
    /usr/lib/hotplug/firmware/isl3890 after booting), but I have been beaten
    down trying to get genkernel to do the Right Thing for the PCMCIA subsystem.
    This is 2004.3, emerge gentoo-dev-sources, on a Dell D800.
    Thank you for your post, though: genkernel all is apparently too naive for
    my situation.
    The wireless card situation has all the appeal of a winmodem.
    I grasp that the manufacturers have various legal/business reasons for the
    ‘firmware’ nonsense (what a goofy euphemism), and I understand Linus has a
    Pontius Pilate policy about them, but I hope that the situation can evolve
    to the point that using this hardware under Linux isn’t such a flogging for a
    medium-weight geek like me.
    Party!

    Comment by Chris Smith — 10/2/2005 @ 10:10

  2. Gentoo might not be the best distro in your case. Have you tried Redhat or Mandrake?

    Comment by Daniel Lemire — 11/2/2005 @ 23:47

RSS feed for comments on this post.

Leave a comment

Warning: When entering a long comment, please ensure that you make copy of your text prior to submitting it. If the server should fail or if you hit a bug, you might lose your work. I am not responsible for your lost effort.

To spammers: I carefully review every single post and make sure that spam gets deleted. You are wasting your time if you are manually entering spam using this form. Read my terms of use to see what I consider to be abusive.

Example: two plus seven is '9'.

« Blog's main page

20 queries. 2.817 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.