Gentoo Logo

Kiistö: Tämä käsikirja on vanhentunut eikä sitä enää ylläpidetä.


[ << ] [ < ] [ 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. But before you start, consider your options...

Several bootloaders exist for Linux/PPC. We have yaboot (for NewWorld Apple and IBM machines) and BootX (for OldWorld Apple and IBM machines). The Pegasos does not require a bootloader, but we included the BootCreator for creating a SmartFirmware bootmenu.

10.b. Default: Using yaboot

Introduction

Tärkeää: yaboot can only be used on NewWorld Apple and IBM systems!

First we have to create the /dev files in our new home, which is needed during the bootloader installation. This could be done by "bind"-mapping the /dev-filesystem from the Installation CD:

Koodilistaus 2.1: Bind-mounting the /dev-filesystem

# exit  # this will exit the chroot
# mount -o bind /dev /mnt/gentoo/dev
# chroot /mnt/gentoo /bin/bash
# /usr/sbin/env-update && source /etc/profile 

There are two ways to configure yaboot for your system. You can use the included yabootconfig 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.

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 an Apple_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 yaboot installed.

Koodilistaus 2.2: Installing yaboot with GRP

# emerge --usepkg --update yaboot

Now exit the chroot and run yabootconfig --chroot /mnt/gentoo. 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 Apple_Bootstrap partition, and install the yaboot configuration file into it. After this enter the chroot again.

Koodilistaus 2.3: enter chroot

# chroot /mnt/gentoo /bin/bash
# /usr/sbin/env-update && source /etc/profile

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 Apple_Bootstrap partition.

Now continue with Rebooting the System.

Alternative: Manual yaboot Configuration

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

Koodilistaus 2.4: Installing yaboot

# emerge --usepkg --update yaboot

Below you find a completed yaboot.conf file. Alter it at will. G5 users should be aware that their disks are Serial ATA disks which are seen as SCSI disks by the Linux kernel (so substitute /dev/hda with /dev/sda).

Koodilistaus 2.5: /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/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ

## our bootstrap partition:

boot=/dev/hda2

## ofboot is the openfirmware 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 (or /dev/hdaX).
## 
## G5 users should uncomment this line!!

#ofboot=hd:2

## hd: is open firmware speak for hda
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 2.6.9 with your kernel-version
#################
image=/boot/kernel-2.6.9
  label=Linux
  root=/dev/hda3
  partition=3
  sysmap=/boot/System.map-2.6.9
  read-only
##################

## G5 users and some G4 users should set 
##   macos=hd:13
##   macosx=hd:12
## instead of the example values.
macos=/dev/hda13
macosx=/dev/hda12
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 the System.

10.c. Alternative: BootX

Tärkeää: BootX can only be used on OldWorld Apple and IBM systems!

BootX requires that you reboot first. So, let's reboot shall we :)

First exit the chrooted environment and unmount all mounted partitions, then type in the one magical command you have been waiting for: reboot.

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

# exit
cdimage ~# cd
cdimage ~# umount /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 MacOS.

Now your machine is booted in MacOS, open the BootX control panel. Select Options and uncheck Used specified RAM disk. When you return to the BootX main screen, you will now find an option to specify your machine's root disk and partition. Fill these in with the appropriate values.

BootX can be configured to start Linux upon boot. If you do this, you will first see your machine boot into MacOS then, during startup, BootX will load and start Linux. See the BootX home page for more information.

Now reboot again and boot into Linux, then continue with Finalizing your Gentoo Installation.

10.d. Alternative: BootCreator

Tärkeää: BootCreator will build a nice SmartFirmware bootmenu written in Forth for the Pegasos.

First make sure you have the latest bootcreator installed on your system:

Koodilistaus 4.1: Installing bootcreator

# emerge --usepkg --update bootcreator

Now copy the file /etc/bootmenu.example into /etc/bootmenu and edit it to your needs:

Koodilistaus 4.2: Edit the bootcreator config file

# cp /etc/bootmenu.example /etc/bootmenu
# nano -w /etc/bootmenu

Below you find a completed /etc/bootmenu config file. Alter it at will.

Koodilistaus 4.3: bootcreator config file

#
# Example description file for bootcreator 1.1
#

[VERSION]
1

[TITLE]
Boot Menu

[SETTINGS]
AbortOnKey = false
Timeout    = 9
Default    = 1

[SECTION]
Local HD -> Morphos      (Normal)
ide:0 boot2.img ramdebug edebugflags="logkprintf"

[SECTION]
Local HD -> Linux 2.6.10 (Normal)
ide:0 linux-2.6.10 video=radeonfb:1024x768@70 root=/dev/hda3

Finally the bootmenu must be transfered into Forth and copied to your boot partition, so that the SmartFirmware can read it. Therefore you have to call bootcreator:

Koodilistaus 4.4: Install the bootmenu

# bootcreator /etc/bootmenu /boot/menu

Huomaa: Be sure to have a look into the SmartFirmware's settings when you reboot, that menu is the file that will be loaded by default.

For now, continue the installation with Rebooting the System.

10.e. 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 5.1: Exiting the chroot, unmounting all partitions and rebooting

# exit
livecd ~# umount /mnt/gentoo/proc /mnt/gentoo/dev /mnt/gentoo
livecd ~# reboot

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 9. kesäkuuta 2005

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ä

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

Grant Goodyear
Katselmoija

Gerald J. Normandin Jr.
Katselmoija

Donnie Berkholz
Katselmoija

Ken Nowack
Katselmoija

Lars Weiler
Contributor

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.