Gentoo Logo

[ << ] [ < ] [ Etusivu ] [ > ] [ >> ]


10. Configuring the Bootloader

Sisällysluettelo:

10.a. Making your Choice

Introduction

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 bootloader.

On Linux/PPC64 we have yaBoot as a bootloader.

10.b. Using yaBoot

Introduction

Tärkeää: If you are using a 64-bit userland, you must use the yaboot-static package because yaboot cannot be compiled as a 64-bit application. The 32-bit userlands should use the regular yaboot package.

There are two ways to configure yaBoot for your system. You can use the new and improved yabootconfig included with yaboot-1.3.8-r1 and later to automatically set up yaboot. If for some reason you do not want to run yabootconfig to automatically set up /etc/yaboot.conf or you are installing Gentoo on a G5 (on which yabootconfig does not always work), you can just edit the sample file already installed on your system.

Tärkeää: yabootconfig/ybin won't work on IBM. You have to install yaboot another way: Using yaboot on IBM hardware

Huomaa: If your root filesystem uses the JFS filesystem, be sure to add ro as a kernel parameter. JFS must be able to replay its log in read-only mode before it gets mounted read-write.

Default: Using yabootconfig

yabootconfig will auto-detect the partitions on your machine and will set up dual and triple boot combinations with Linux, Mac OS, and Mac OS X.

To use yabootconfig, your drive must have a bootstrap partition, and /etc/fstab must be configured with your Linux partitions. Both of these should have been done already in the steps above. To start, ensure that you have the latest version of yaboot installed by running emerge --update yaboot-static. This is necessary as the latest version will be available via Portage, but it may not have made it into the stage files.

Koodilistaus 2.1: Installing yaboot-static

(For 64-bit users)
# emerge --update yaboot-static

(For 32-bit users)
# emerge yaboot

Now run yabootconfig. The program will run and it will confirm the location of the bootstrap partition. Type Y if it is correct. If not, double check /etc/fstab. yabootconfig will then scan your system setup, create /etc/yaboot.conf and run mkofboot for you. mkofboot is used to format the bootstrap partition, and install the yaboot configuration file into it.

You might want to verify the contents of /etc/yaboot.conf. If you make changes to /etc/yaboot.conf (like setting the default/boot OS), make sure to rerun ybin -v to apply changes to the bootstrap partition.

Now continue with Rebooting your System.

Alternative: Manual yaBoot Configuration

First make sure you have the latest yaboot-static installed on your system:

Koodilistaus 2.2: Installing yaboot

(For 64-bit users)
# emerge --update yaboot-static

(For 32-bit users)
# emerge yaboot

Below you find a completed yaboot.conf file. Alter it at will.

Koodilistaus 2.3: /etc/yaboot.conf

## /etc/yaboot.conf
##
## run: "man yaboot.conf" for details. Do not make changes until you have!!
## see also: /usr/share/doc/yaboot/examples for example configurations.
##
## For a dual-boot menu, add one or more of:
## bsd=/dev/sdaX, macos=/dev/sdaY, macosx=/dev/sdaZ

## our bootstrap partition:

boot=/dev/sda2

## ofboot is the Open Firmware way to specify the bootstrap partition.
## If this isn't defined, yaboot fails on the G5 and some G4s (unless 
## you pass the necessary arguments to the mkofboot/ybin program).
## hd:X means /dev/sdaX.

ofboot=hd:2

## hd: is Open Firmware speak for sda
device=hd:

delay=5
defaultos=macosx
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

#################
## This section can be duplicated if you have more than one kernel or set of
## boot options - replace ${kernel-name} with your kernel
#################
image=/boot/${kernel-name}
  label=Linux
  root=/dev/sda3
  partition=3
  read-only

macos=hd:13
macosx=hd:12
enablecdboot
enableofboot

Once yaboot.conf is set up the way you want it, you run mkofboot -v to install the settings in the bootstrap partition. Don't forget this! Confirm when mkofboot asks you to create a new filesystem.

If all goes well, and you have the same options as the sample above, your next reboot will give you a simple, five-entry boot menu. If you update your yaboot config later on, you'll just need to run ybin -v to update the bootstrap partition - mkofboot is for initial setup only.

For more information on yaboot, take a look at the yaboot project. For now, continue the installation with Rebooting your System.

10.c. Using yaboot on IBM hardware

On IBM hardware you cannot run yabootconfig or ybin. You must proceed with the following steps:

  • Install yaboot-static
  • Run dd if=/usr/lib/yaboot/yaboot.chrp of=/dev/sdXX (fill in XX with your disk and partition for the PReP partition; this was in our example /dev/sda1)
  • Next construct your own yaboot.conf file and place into /etc. (Take a look at the config above, look into the man page of yaboot.conf or look at the below yaboot.conf example.)
  • Assuming your boot device in OF is pointing to the harddrive you prep boot partition is on then it'll just work, otherwise at IPL time, go into the multiboot menu and set the boot device to the one with your prep boot partition
  • That's it!

Koodilistaus 3.1: yaboot.conf for IBM hardware

device=disk:
partition=2
root=/dev/sda2
default=linux
timeout=50

image=/boot/${kernel-name}
    label=linux
    append="console=ttyS0,9600"
    read-only

For POWER4, POWER5, and blade-based hardware where the PReP disk partition and the disk partition that contains your kernel are on the same physical disk, you can use a simplified yaboot.conf. The following should be sufficient:

Koodilistaus 3.2: yaboot.conf for PReP hardware

default = linux
timeout = 100
image=/boot/${kernel-name}
        label=linux
        read-only
        root = /dev/sda2
        append="root=/dev/sda2"

To verify that yaboot has been copied to the PReP partition:

Koodilistaus 3.3: Verifying the yaboot install on PReP

# dd if=/dev/sda1 count=10 | grep ELF
Binary file (standard input) matches
10+0 records in
10+0 records out

A match signifies that yaboot was installed correctly.

10.d. Rebooting the System

Exit the chrooted environment and unmount all mounted partitions. Then type in that one magical command you have been waiting for: reboot.

Koodilistaus 4.1: Exiting the chroot, unmounting all partitions and rebooting

# exit
~# cd
~# umount -l /mnt/gentoo/dev{/shm,/pts,}
~# umount -l /mnt/gentoo{/boot,/proc,}
~# reboot

Of course, don't forget to remove the bootable CD, otherwise the CD will be booted again instead of your new Gentoo system.

Once rebooted in your Gentoo installation, finish up with Finalizing your Gentoo Installation.


[ << ] [ < ] [ Etusivu ] [ > ] [ >> ]


Tulostettava muoto

Näytä kaikki

Tämä sivu on viimeksi päivitetty 12. huhtikuuta 2014

Tätä käännöstä ei enää ylläpidetä

Tiivistelmä: Several bootloaders exist. Each one of them has its own way of configuration. In this chapter we'll describe all possibilities for you and step you through the process of configuring a bootloader to your needs.

Sven Vermeulen
Tekijä

Daniel Robbins
Tekijä

Chris Houser
Tekijä

Jerry Alexandratos
Tekijä

Seemant Kulleen
Gentoon x86-kehittäjä

Tavis Ormandy
Gentoon alpha-kehittäjä

Aron Griffis
Gentoon alpha-kehittäjä

Brad House
Gentoon AMD64-kehittäjä

Guy Martin
Gentoon HPPA-kehittäjä

Pieter Van den Abeele
Gentoon PPC-kehittäjä

Joe Kallar
Gentoon SPARC-kehittäjä

John P. Davis
Toimittaja

Pierre-Henri Jondot
Toimittaja

Eric Stockbridge
Toimittaja

Rajiv Manglani
Toimittaja

Jungmin Seo
Toimittaja

Stoyan Zhekov
Toimittaja

Jared Hudson
Toimittaja

Colin Morey
Toimittaja

Jorge Paulo
Toimittaja

Carl Anderson
Toimittaja

Jon Portnoy
Toimittaja

Zack Gilburd
Toimittaja

Jack Morgan
Toimittaja

Benny Chuang
Toimittaja

Erwin
Toimittaja

Joshua Kinard
Toimittaja

Xavier Neys
Toimittaja

Grant Goodyear
Katselmoija

Gerald J. Normandin Jr.
Katselmoija

Donnie Berkholz
Katselmoija

Ken Nowack
Katselmoija

Lars Weiler
Kirjoittaja

Flammie Pirinen
Vastuullinen kääntäjä

Jouni Hätinen
Käännöksen laatutarkistaja

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.