Gentoo - kernel
By: John McFarlane
<john.mcfarlane@rockfloat.com>
I'm finished with this step
I'm finished with this step
I'm finished with this step
I'm finished with this step
I'm finished with this step
This document was originally created on 01/30/2004
Last updated:
02/01/2007 @ 23:59
Abstract:
This document will go thru a step by step installation of the linux 2.6.17-gentoo-r7
kernel.
Table of Contents:
- Download the Linux kernel sources
- Configure the new kernel
- Compile the new kernel
- Copy the newly compiled kernel to the boot partition
- Copy the system map to the boot partition
- Replace the old system map with the new one
- Setup the bootloader (grub)
- Create /etc/fstab which holds static information about the filesystem
- Finish up the bootloader
- Resume Gentoo install if that's what you are doing
- Install utilities for alsa
- Make sure modules.autoload.d is set up to your liking
- Reboot
- Changelog
- Conventions used
1. Download the Linux kernel sources
To build the kernel you will need the actual kernel sources.
I'm finished with this step
root# emerge gentoo-sources
2. Configure the new kernel
Point /usr/src/linux to the correct kernel sources:
I'm finished with this step
root# cd /usr/src
root# rm linux
root# ln -s linux-2.6.17-gentoo-r7 linux
Now we want to pick which pieces of the kernel we want, and which parts we don't want.
The following command will open up a very simple but somewhat graphical interface that
lets you pick which elements you want to include/exclude from your kernel. You also
have the option to load some things as "Modules" that can loaded dynamically using insmod
or modprobe:
root# cd /usr/src/linux
root# make menuconfig
If you are using SCSI but aren't sure which modules you need here
are some commands that might help:
- root# dmesg | grep SCSI
- root# lsmod | grep SCSI
Processor Type and Features -->
Processor Family -->
*pick your processor, and hit the spacebar
Device Drivers -->
ATA/ATAPI/MFM/RLL support -->
[*] VIA82CXXX chipset support #dmesg | grep IDE to see what you need
SCSI device support -->
SCSI low-level drivers ->
#Remove drivers you don't need
#Compile directly in the drivers you need [NOT AS MODULES!]
Networking device support -->
Ethernet (10 or 100Mbit) -->
#Remove drivers you don't need
#Compile AS MODULES, the drivers you need
Ethernet (1000Mbit) -->
#Add drivers as needed AS MODULES
Sound -->
Advanced Linux Sound Architecture -->
#Uncheck Advanced Linux Sound Architecture if you don't need sound
#Add drivers AS MODULES if you need them
File systems -->
( ) Deselect EXT3
(*) Reiserfs support
Once your finished making your selections you can close the menuconfig interface and it
will ask you to save the file. Go ahead and do this, saving the file under the name
/usr/src/linux/.config
3. Compile the new kernel
Now it's time to actually compile the kernel
I'm finished with this step
root# make && make modules_install
4. Copy the newly compiled kernel to the boot partition
In order to boot from your new kernel, it must be on the boot partition
I'm finished with this step
root# cp arch/i386/boot/bzImage /boot/kernel-2.6.17-gentoo-r7
5. Copy the system map to the boot partition
root# cp System.map /boot/System.map-2.6.17-gentoo-r7
6. Replace the old system map with the new one
root# cd /boot
root# rm System.map
root# ln -s System.map-2.6.17-gentoo-r7 System.map
7. Setup the bootloader (grub)
root# nano -w /boot/grub/grub.conf
# Make file look like this:
default 0
timeout 30
title=Gentoo Linux 2.6.17
root (hd0,0)
kernel /kernel-2.6.17-gentoo-r7 root=/dev/hda3
8. Create /etc/fstab which holds static information about the filesystem
root# nano -w /etc/fstab
# Make file look like this:
/dev/hda1 /boot ext2 defaults,noatime 1 2
/dev/hda3 / reiserfs noatime,notail 0 1
/dev/hda2 none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,ro,user 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
9. Finish up the bootloader
root# cat /proc/mounts > /etc/mtab
root# grub-install /dev/hda
10. Resume Gentoo install if that's what you are doing
If you are currently following the Gentoo install howto, you can go back
resume by clicking here.
I'm finished with this step
11. Install utilities for alsa
If your an alsa user (which is a good idea) you'll want to make sure you have the needed
alsa utilities
I'm finished with this step
user# sudo emerge -a alsa-utils alsa-driver
12. Make sure modules.autoload.d is set up to your liking
After installing a new kernel of any version, it is important
that you have the appropriate /etc/modules.autoload.d/kernel-X.Y
created (X.Y is the first 2 parts of your new kernel version)
For example, this kernel will require:
/etc/modules.autoload.d/kernel-2.6
I'm finished with this step
/etc/modules.autoload.d/kernel-2.6
13. Reboot
If all goes well, your machine will startup with a shiney new 2.6 kernel. Enjoy!
I'm finished with this step
| Changelog: Date | Description |
|---|---|
| 01/30/2004 @ 21:00 | Initial creation |
| 11/03/2005 @ 18:30 | Updates for the 2.6 kernel |
| 12/11/2005 @ 14:00 | Updated to be Gentoo specific |
| 09/02/2006 @ 23:59 | Updated for 2.6.17-gentoo-r7 |
| 02/01/2007 @ 23:59 | Switch from cp to cat for mtab |
This document was originally created on 01/30/2004
Conventions and tips for this howto document:
- Please remember that I'm no kernel expert, and making even the slightest wrong step in a kernel update can render your machine useless.
- Please always have a live-cd available and know how to use it - just in case something goes wrong :/
Disclaimer:
This page is not endorsed by gentoo.org or any other cool
cats. Any information provided in this document is to be used
at your own risk.