HOWTO Install Gentoo Linux: Kernel

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Image:Gentoo_tux.png

Base Install

  1. About
  2. Preparation
  3. Partitioning
  4. Configuring
  5. Stage Progression
  6. Kernel
  7. Bootloader
  8. Test
  9. Troubleshooting

Base Extras

  1. Basic Hardware
  2. Essential Daemons
  3. CUPS Printing
  4. SANE Scanning

Server

Desktop

edit

[edit] Kernel Configuration

Assuming that you use a genkernel, it may be that much of the information you'll need on your specific hardware will come from using lspci and other tools. Some research will be required to figure out what modules you need. I recommend the hardware compatibility section of LinuxQuestions.org. Additionally, you must absolutely check out the gentoo-wiki guide on detecting your hardware - in brief, it says to emerge and use these tools: lshw pciutils usbutils.

USE="-gtk" emerge lshw pciutils usbutils
lshw > /root/hardware.all.txt
# use gtk-lshw when in X
lspci > /root/hardware.pci.txt
lsusb > /root/hardware.usb.txt
cat /root/hardware.*.txt | less
USE="symlink" emerge gentoo-sources
emerge genkernel
# In case anything ever goes wrong with our filesystems and we can't boot normally
# we want to ensure that there is LVM2 support in our initrd. That requires a few extra steps:
emerge -f lvm2
cp /usr/portage/distfiles/device-mapper*.tgz /usr/share/genkernel/pkg/
cp /usr/portage/distfiles/LVM2*.tgz /usr/share/genkernel/pkg/
clear; echo "Wake up! You have work to do!"
echo "You'll need to change this info in /etc/genkernel.conf:"
echo 'DEVICE_MAPPER_VER="1.00.17"'
echo 'LVM2_VER="2.00.25"'
echo
echo "To match the versions of the following packages:"
ls /usr/share/genkernel/pkg | grep LVM2 && ls /usr/share/genkernel/pkg | grep device-mapper
sleep 15
nano -w /etc/genkernel.conf
cd /usr/src/linux && make && make modules && emerge ncpfs reiserfsprogs lvm2 splashutils &&\
emerge bootsplash-themes --nodeps --oneshot &&\
ls /etc/bootsplash -1 | while read SPLASH; do bootsplash2fbsplash ${SPLASH}; done &&\
emerge -C bootsplash-themes && ${INIT_UPDATE} add splash default # && ${INIT_UPDATE} del consolefont boot
genkernel --gensplash=emergence --udev --lvm2 --menuconfig all # use --oldconfig also in the future

Below is a 'diff' of sorts between the standard genkernel and one you might like to have.

  • Optimized for a Pentium4 (slightly incongruent with the make.conf above, hehe)
  • Memory management for a system with 1GB or more memory.
  • Support for PCMCIA
  • Support for Network Block Devices
  • Support for LVM & Raid
  • Support for fbsplash/gensplash
  • Support for USB K/B and mouse
  • Support for iptables and bridging
  • Support for Windows Networking
  • Support for Novell/Netware/NCP Networking
  • Support for PPP (if using dial-up)
  • Enable DMA for drives
  • Support utf-8 for file names
  • Pseudo filesystems
Linux Kernel Configuration:
Processor type and features --->
	Subarchitecture Type (PC-compatible)  --->
		Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon)
	[*] Generic x86 support
	[*] Preemptible Kernel
	High Memory Support (4GB)  --->
	[*] Allocate 3rd-level pagetables from highmem
Bus options (PCI, PCMCIA, EISA, MCA, ISA) --->
		PCCARD (PCMCIA/CardBus) support  --->
		<*> PCCard (PCMCIA/CardBus) support
		<*>   16-bit PCMCIA support
	[*]   32-bit CardBus support
	--- PC-card bridges
		<*> CardBus yenta-compatible bridge support (NEW)
		<*> Cirrus PD6729 compatible bridge support (NEW)
		<*> i82092 compatible bridge support (NEW)
		<*> i82365 compatible bridge support (NEW)
		<*> Databook TCIC host bridge support (NEW) 
Device Drivers  --->
	Block devices  --->
		<M> Network block device support
	Multi-device support (RAID and LVM)  --->
		[*] Multiple devices driver support (RAID and LVM)
		< >   RAID support
		<M>   Device mapper support
	Graphics support --->
		[*] Support for frame buffer devices
		<*> VESA VGA graphics support
			VESA driver type (vesafb-tng)  --->
		Console display driver support --->
			[*] Video mode selection support
			<*> Framebuffer Console support
		Logo configuration  --->
			[ ] Bootup logo
		[*] Support for the framebuffer splash (NEW)
	USB Support --->
		<*>   USB Human Interface Device (full HID) support
	Networking support  --->
		Networking options --->
			<M> IP: tunneling 
			[*] Network packet filtering (replaces ipchains)  --->
				IP: Netfilter Configuration  --->
				Bridge: Netfilter Configuration  --->
					(I chose to make everything a module
					but only because I don't know what
					any of it means... :P )
			<M> IPsec user configuration interface
			<M> 802.1d Ethernet Bridging
			<M> 802.1Q VLAN Support
		<*> PPP (point-to-point protocol) support
		<*>   PPP support for async serial ports
		<*>   PPP support for sync tty ports
	ATA/ATAPI/MFM/RLL support --->
		[*] Generic PCI bus-master DMA support
		[*]   Use PCI DMA by default when available
File systems  --->
	<*> Second extended fs support
		[*]   Ext2 extended attributes
	<*> Ext3 journalling file system support
		[*]   Ext3 extended attributes
		[*]   Ext3 POSIX Access Control Lists
		[ ]    Ext3 Security Labels
		[ ]    JBD (ext3) debugging support
	<*> Reiserfs support
		[ ]   Enable reiserfs debug mode
		[*]   Stats in /proc/fs/reiserfs
		[*]   ReiserFS extended attributes
	Network File Systems --->
		<M> SMB file system support (to mount Windows shares etc.)
		<M> CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)
		<M> NCP file system support (to mount NetWare volumes)
			(all selected for NCP)
	Pseudo Filesystems --->
		[*] /proc file system support
		[ ] /dev file system support (OBSOLETE)
		[*] Virtual memory file system support (former shm fs)
	Native Language Support -->
 		(utf8) Default NLS Option
  		<*> NLS UTF8
  		(Also <*> other character sets that are in use in
   			your FAT filesystems or Joilet CD-ROMs.)

Just to make boot time a little faster, uncomment the line in lvm.conf about filtering cdrom devices

You'll also want certain modules to load at boot. dm-mod is one, if you have an Intel NIC, e100 may be another.

echo e100 >> /etc/modules.autoload.d/kernel-2.6
echo dm-mod >> /etc/modules.autoload.d/kernel-2.6
modules-update

[edit] Additional Filesystem Tools

If you chose to enable support for filesystems other than ext2 or ext3 and plan on using them, you will need to install one or more of the following:

emerge xfsprogs
emerge reiserfsprogs
emerge jfsutils

[edit] Resources (Kernel Configuration)

Gentoo Wiki: gensplash

Gentoo Wiki: Bootsplash

Gentoo: 2005.1 Gentoo Handbook

Gentoo: Upgrading the kernel

Personal tools