The core around which all distributions are built is the Linux kernel. It is the
layer between the user programs and your system hardware. Gentoo provides its
users several possible kernel sources. A full listing with description is
available at the
For x86-based systems we have, amongst other kernels,
For alpha-based systems we have
For sparc-based systems we have
Other architectures should use the kernel source specifically optimized for
their architecture:
Choose your kernel source and install it using
In the next example we install the
# emerge --usepkg vanilla-sources
When you take a look in
# ls -l /usr/src/linux lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -> linux-2.4.22
If this isn't the case (i.e. the symlink points to a different kernel source) change the symlink before you continue:
# rm /usr/src/linux && ln -s /usr/src/linux-2.4.22 /usr/src/linux
Now it is time to configure and compile your kernel source. The x86-based
architectures can use
If you want to manually configure your kernel, continue now with
Manually configuring a kernel is often seen as the most difficult course every Linux users ever has to go through. Nothing is less true -- after configuring a couple of kernels you don't even remember that it was difficult ;)
However, one thing
Now go to your kernel source directory and execute
# cd /usr/src/linux # make menuconfig
You will be greeted with several configuration sections. We'll first list some options you must activate (otherwise Gentoo will not function, or not function properly without additional tweaks).
First of all, activate the use of development and experimental code/drivers. You need this, otherwise some very important code/drivers won't show up:
Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers"
Now go to
File systems ---> [*] Virtual memory file system support (former shm fs) [*] /proc file system support [*] /dev file system support (EXPERIMENTAL) [*] Automatically mount at boot(Deselect the following unless you have a 2.6 kernel) [ ] /dev/pts file system for Unix98 PTYs(Select one of more of the following options as needed by your system) <*> Reiserfs support <*> Ext3 journalling file system support <*> JFS filesystem support <*> Second extended fs support <*> XFS filesystem support
If you are using PPPoE to connect to the Internet, you will need the following options in the kernel:
Network device support ---> <*> PPP (point-to-point protocol) support <*> PPP support for async serial ports <*> PPP support for sync tty ports
The two compression options won't harm but are not definitely needed, neither
does the
If you are using LVM, you will need to activate it in the kernel:
Multi-device support (RAID and LVM) ---> [*] Multiple devices driver support (RAID and LVM) <*> Logical volume manager (LVM) support
If you require it, don't forget to include support in the kernel for your ethernet card.
Now, dependent on your architecture, you might need to select more options:
If you have an x86-based system, you can immediately continue with
The following options are recommended for Alpha-users:
General setup ---> <*> SRM environment through procfs <*> Configure uac policy via sysctl Plug and Play configuration ---> <*> Plug and Play support <M> ISA Plug and Play support SCSI support ---> SCSI low-level drivers ---> <*> SYM53C8XX Version 2 SCSI support (NEW) <*> Qlogic ISP SCSI support Network device support ---> Ethernet (10 or 100 Mbit) ---> <M> DECchip Tulip (dc21x4x) PCI support <M> Generic DECchip & DIGITAL EtherWORKS PCI/EISA <M> EtherExpressPro/100 support (eepro100) <M> EtherExpressPro/100 support (e100) Ethernet (1000 Mbit) ---> <M> Alteon AceNIC [*] Omit support for old Tigon I <M> Broadcom Tigon3 [*] FDDI driver support <M> Digital DEFEA and DEFPA <*> PPP support <*> PPP Deflate compression Character devices ---> [*] Support for console on serial port [*] Direct Rendering Manager File systems ---> <*> Kernel automounter version 4 support Network File Systems ---> <*> NFS [*] NFSv3 client <*> NFS server [*] NFSv3 server Partition Types ---> [*] Advanced partition selection [*] Alpha OSF partition support Native Language Support <*> NLS ISO 8859-1 Sound ---> <M> Sound card support <M> OSS sound modules [*] Verbose initialisation [*] Persistent DMA buffers <M> 100% Sound Blaster compatibles
When you're finished configuring the kernel, continue with
If you have a HIL mouse or keyboard, do not forget to compile in support for them.
Input core support ---> [*] Keyboard support [*] Mouse support [*] Event interface support
If you have no mouse on your HIL port, only use the basic support:
HIL support ---> [*] HIL Keyboard (basic) support
If you however want
HIL support ---> [*] HP System Device Controller i8042 Support [*] HIL MLC Support [*] HIL Keyboard (full) support [*] HIL Mouse & Pointer support
When you're done configuring your kernel, continue with
First of all, disable ADB raw keycodes:
Macintosh Device Drivers ---> [ ] Support for ADB raw keycodes
Also choose the correct RTC support (
Character devices ---> [ ] Enhanced RTC General setup ---> [*] Support for /dev/rtc
Users of OldWorld machines will want HFS support so they can copy compiled kernels to the MacOS partition.
File Systems ---> [*] HFS Support
When you're done configuring your kernel, continue with
First activate the correct bus-support:
Console drivers ---> Frame-buffer support ---> [*] SBUS and UPA framebuffers [*] Creator/Creator3D support(Only for UPA slot adapter used in many Ultras) [*] CGsix (GX,TurboGX) support(Only for SBUS slot adapter used in many SPARCStations)
Of course you want support for the OBP:
Misc Linux/SPARC drivers ---> [*] /dev/openprom device support
You will also need SCSI-specific support:
SCSI support ---> SCSI low-level drivers ---> <*> Sparc ESP Scsi Driver(Only for SPARC ESP on-board SCSI adapter) <*> PTI Qlogic, ISP Driver(Only for SBUS SCSI controllers from PTI or QLogic) <*> SYM53C8XX Version 2 SCSI support(Only for Ultra 60 on-board SCSI adapter)
To support your network card, select on of the following:
Network device support ---> Ethernet (10 or 100Mbit) ---> <*> Sun LANCE support(Only for SPARCStation, older Ultra systems, and as Sbus option) <*> Sun Happy Meal 10/100baseT support(Only for Ultra; also supports "qfe" quad-ethernet on PCI and Sbus)
When you're done configuring your kernel, continue with
# ls -lh vmlinux -rw-r--r-- 1 root root 2.4M Oct 25 14:38 vmlinux
If the (uncompressed) size is bigger than 2.5Mb (for Sparc32) or 3.5Mb (for Sparc64), reconfigure your kernel untill it doesn't exceed these limits. Ignoring this can lead to a non-booting kernel.
Now that your kernel is configured, it is time to compile and install it. Exit
the configuration and run
(For x86-based systems, 2.4 kernel) # make dep && make bzImage modules modules_install(For other systems, 2.4 kernel) # make dep && make vmlinux modules modules_install(For 2.6 kernel) # make && make modules_install
When the kernel is done compiling, copy over the kernel image to
(For x86-based systems) # cp arch/i386/boot/bzImage /boot/kernel-2.4.22 # cp System.map /boot/System.map-2.4.22(For other systems) # cp vmlinux /boot/kernel-2.4.22 # cp System.map /boot/System.map-2.4.22
It is also wise to copy over your kernel configuration file to
# cp .config /boot/config-2.4.22
Now continue with
If you are reading this section, you have chosen to use our
Now that your kernel source tree is installed, it's now time to compile your
kernel by using our
Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
# emerge --usepkg genkernel
Now, compile your kernel sources by running
# genkernel Gentoo Linux genkernel, version 1.4 Copyright 2003 Gentoo Technologies, Inc., Bob Johnson, Daniel Robbins Distributed under the GNU General Public License version 2 Settings: compile optimization: 1 processor(s) source tree: /usr/src/linux-2.4.22 config: gentoo (customized) config loc: /etc/kernels/config-2.4.22 initrd config: (default) /etc/kernels/settings * Running "make oldconfig"... [ ok ] * Logging to /var/log/genkernel.log... [ ok ] * Starting 2.4.22 build... [ ok ] * Running "make dep"... [ ok ] * Running "make bzImage"... [ ok ] * Running "make modules"... [ ok ] * Running "make modules_install"... [ ok ] * Moving bzImage to /boot/kernel-2.4.22... [ ok ] * Building busybox... [ ok ] * Creating initrd... [ ok ] * Build completed successfully! * Please specify /boot/kernel-2.4.22 and /boot/initrd-2.4.22 * when customizing your boot loader configuration files.
Once
Now, let's perform one more step to get our system to be more like the Live
CD -- let's emerge
# emerge --usepkg hotplug # rc-update add hotplug default
Finally, you should emerge ebuilds for any additional hardware that is on your system. Here is a list of kernel-related ebuilds that you could emerge:
Ebuild | Purpose | Command |
---|---|---|
Beware though, some of these ebuilds might deal with big dependencies. To verify
what packages will be installed by emerging an ebuild, use
# emerge --pretend emu10k1
If you don't like the packages it wants to install, use
# emerge --pretend --verbose emu10k1... [ebuild N ] media-sound/aumix-2.8 +gpm +nls +gtk +gnome +alsa -gtk2
In the previous example you can see that one of
If you don't want all this to be compiled, deselect all USE-flags, for instance:
# USE="-gpm -nls -gtk -gnome -alsa" emerge --pretend emu10k1
When you're happy with the results, remove the