Now that your kernel is configured and compiled and the necessary system
configuration files are filled in correctly, it is time to install a
program that will fire up your kernel when you start the system. Such a
program is called a
For
But before we install the bootloader, we inform you how to configure framebuffer (assuming you want it of course). With framebuffer you can run the Linux command line with (limited) graphical features (such as using the nice bootsplash image Gentoo provides).
First of all, you need to know what type of framebuffer device you're using. If
you use a Gentoo patched kernel tree (such as
The
The following table lists the available resolutions and color depths and
matches those against the value that you need to pass on to the
| 640x480 | 800x600 | 1024x768 | 1280x1024 |
|---|---|---|---|
| 256 | |||
| 32k | |||
| 64k | |||
| 16M |
The
| Control | Description |
|---|---|
The result of those two statements could be something like
Now, you should install the
Now continue by installing
The most critical part of understanding GRUB is getting comfortable with how
GRUB refers to hard drives and partitions. Your Linux partition
Hard drives count from zero rather than "a" and partitions start at zero
rather than one. Be aware too that with the hd devices, only hard drives are
counted, not atapi-ide devices such as cdrom players and burners. Also, the
same construct is used with SCSI drives. (Normally they get higher numbers
than IDE drives except when the BIOS is configured to boot from SCSI devices.)
When you ask the BIOS to boot from a different hard disk (for instance your
primary slave),
Assuming you have a hard drive on
Having gotten the feel for that, it is time to install GRUB.
To install GRUB, let's first emerge it:
# emerge grub
Although GRUB is now installed, we still need to write up a
configuration file for it and place GRUB in our MBR so that GRUB automatically
boots your newly created kernel. Create
# nano -w /boot/grub/grub.conf
Now we are going to write up a
# Which listing to boot as default. 0 is the first, 1 the second etc. default 0# How many seconds to wait before the default listing is booted. timeout 30# Nice, fat splash-image to spice things up :) # Comment out if you don't have a graphics card installed splashimage=(hd0,0)/boot/grub/splash.xpm.gz title Gentoo Linux# Partition where the kernel image (or operating system) is located root (hd0,0) kernel /boot/root=/dev/sda3 title Gentoo Linux (rescue) # Partition where the kernel image (or operating system) is located root (hd0,0) kernel /boot/root=/dev/sda3 init=/bin/bb # The next four lines are only if you dualboot with a Windows system. # In this case, Windows is hosted on /dev/sda6. title Windows XP rootnoverify (hd0,5) makeactive chainloader +1
default 0 timeout 30 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title Gentoo Linuxroot (hd0,0) kernel /boot/ root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev initrd /boot/ # Only in case you want to dual-boot title Windows XP rootnoverify (hd0,5) makeactive chainloader +1
If you used a different partitioning scheme and/or kernel image, adjust
accordingly. However, make sure that anything that follows a GRUB-device (such
as
Besides, if you chose to use a different partitioning scheme and did not put
If you need to pass any additional options to the kernel, simply add
them to the end of the kernel command. We're already passing one option
(
If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
because the BIOS can't handle large harddrives you'll need to append
Now save the
The GRUB developers recommend the use of
Continue with
To install GRUB you will need to issue the
# grep -v rootfs /proc/mounts > /etc/mtab
Now we can install GRUB using
# grub-install --no-floppy /dev/sda
If you have more questions regarding GRUB, please consult the
Continue with
To start configuring GRUB, you type in
# grub --no-floppy
In the example configuration we want to install GRUB so that it reads its
information from the boot partition
The tab completion mechanism of GRUB can be used from within GRUB.
For instance, if you type in "
By using the tab completion, setting up GRUB should be not that hard. Now go on, configure GRUB, shall we? :-)
grub> root (hd0,0)(Specify where your /boot partition resides) grub> setup (hd0)(Install GRUB in the MBR) grub> quit(Exit the GRUB shell)
If you have more questions regarding GRUB, please consult the
Continue with
LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. However, it lacks some features that GRUB has (which is also the reason why GRUB is currently gaining popularity). The reason why LILO is still used is that, on some systems, GRUB doesn't work and LILO does. Of course, it is also used because some people know LILO and want to stick with it. Either way, Gentoo supports both, and apparently you have chosen to use LILO.
Installing LILO is a breeze; just use
# emerge lilo
To configure LILO, you must create
# nano -w /etc/lilo.conf
Some sections ago we have asked you to remember the kernel-image name
you have created. In the next example
Make sure you use
boot=/dev/sda# Install LILO in the MBR prompt# Give the user the chance to select another section timeout=50# Wait 5 (five) seconds before booting the default section default=gentoo# When the timeout has passed, boot the "gentoo" section # For non-genkernel users image=/boot/label=gentoo # Name we give to this section read-only# Start with a read-only root. Do not alter! root=/dev/sda3# Location of the root filesystem image=/boot/label=gentoo.rescue # Name we give to this section read-only# Start with a read-only root. Do not alter! root=/dev/sda3# Location of the root filesystem append="init=/bin/bb"# Launch the Gentoo static rescue shell # For genkernel users image=/boot/label=gentoo read-only root=/dev/ram0 append="init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev" initrd=/boot/ # The next two lines are only if you dualboot with a Windows system. # In this case, Windows is hosted on /dev/sda6. other=/dev/sda6 label=windows
If you need to pass any additional options to the kernel, add an
image=/boot/label=gentoo read-only root=/dev/sda3 append="video=vesafb:mtrr,ywrap,1024x768-32@85"
If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
because the BIOS can't handle large harddrives you'll need to append
Now save the file and exit. To finish up, you have to run
# /sbin/lilo
If you have more questions regarding LILO, please consult its
You can now continue with
On the IA64 platform, the boot loader is called elilo. You may need to emerge it on your machine first.
# emerge elilo
You can find the configuration file at
boot=/dev/sda1 delay=30 timeout=50 default=Gentoo append="console=ttyS0,9600" prompt image=/vmlinuz label=Gentoo root=/dev/sda2 read-only image=/vmlinuz.old label=Gentoo.old root=/dev/sda2 read-only
The
The sections that start with
When configuration is done, just run
# elilo --efiboot
Now continue with
Exit the chrooted environment and unmount all mounted partitions. Then type in
that one magical command you have been waiting for:
# exit cdimage ~# cd cdimage ~# umount /mnt/gentoo/boot /mnt/gentoo/sys /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo cdimage ~# reboot
# exit cdimage ~# cd cdimage ~# umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo cdimage ~# reboot
Of course, don't forget to remove the bootable CD, otherwise the CD will be booted again instead of your new Gentoo system.
When you reboot you should see a new Gentoo Linux menu option in the EFI Boot Manager which will boot Gentoo.
Once rebooted in your Gentoo installation, finish up with