ハンドブック:PPC64/インストール/ブートローダー

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Handbook:PPC64/Installation/Bootloader and the translation is 100% complete.

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎polski • ‎русский • ‎українська • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
PPC64 ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理



With the kernel configured and compiled and the necessary system configuration files filled in correctly, it is time to install a program that will fire up the kernel when the system boots. Such a program is called a boot loader.

Linux/PPC64 では、 yaBoot がブートローダーです。

yaboot を使う

はじめに

Important
When using a 64-bit userland, the yaboot-static package must be used because yaboot cannot be compiled as a 64-bit application. The 32-bit userlands should use the regular yaboot package.

In order to find the boot devices, yaboot needs access to the device nodes created by udev on startup and the sysfs filesystem. These two filesystems are found at /dev/ and /sys/ respectively. Early in the installation, these locations have already been bind-mounted into the chroot.

Important
yabootconfig/ybin won't work on IBM. Please refer to Using yaboot on IBM hardware.

To set up yaboot, either use yabootconfig to automatically create a configuration file or manually configure the boot loader. When installing Gentoo on a G5 (where yabootconfig does not always work), or when the system needs to boot from FireWire or USB, then manually configuring yaboot is mandatory.

デフォルト: yabootconfig を使用する

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

To use yabootconfig, the drive must have a bootstrap partition, and /etc/fstab must be configured to reflect the Linux partitions (note that the Bootstrap partition should not be in the fstab file). These steps should have already been completed before, but check /etc/fstab before proceeding. Now, install yaboot.

32ビットの場合:

root #emerge --ask sys-boot/yaboot

64ビットの場合:

root #emerge --ask sys-boot/yaboot-static

Now run yabootconfig. First, the program will confirm the location of the bootstrap partition. When using the suggested disk partitioning scheme, the bootstrap partition should be /dev/sda1. Type Y if the output is correct. If not, double check the /etc/fstab file. yabootconfig will then scan the system setup, create /etc/yaboot.conf and run mkofboot. mkofboot is used to format the bootstrap partition, and install the yaboot configuration file into it.

Verify the contents of /etc/yaboot.conf. When making changes to /etc/yaboot.conf (like setting the default/boot OS), make sure to rerun ybin -v to apply changes to the bootstrap partition.

Alternative: Manual yaboot configuration

First, install yaboot on the system:

32ビットの場合:

root #emerge --ask sys-boot/yaboot

64ビットの場合:

root #emerge --ask sys-boot/yaboot-static

An example yaboot.conf file is given below, but it will need to be altered to fit personal preference.

FILE /etc/yaboot.confExample configuration
## /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/sda3
  
## 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-3.16.5-gentoo with your kernel
#################
image=/boot/kernel-3.16.5-gentoo
  label=Linux
  root=/dev/sda3
  partition=3
  read-only
  
macos=hd:13
macosx=hd:12
enablecdboot
enableofboot

Once yaboot.conf is configured, run mkofboot -v to format the bootstrap partition and install the settings. If yaboot.conf is changed after the bootstrap partition has been created, then update the settings by running ybin -v.

root #mkofboot -v

For more information on yaboot, take a look at the yaboot project.

Using yaboot on IBM hardware

On IBM hardware it is not possible to run yabootconfig or ybin. Proceed with the following steps:

  • Install yaboot-static
  • Run dd if=/usr/lib/yaboot/yaboot.chrp of=/dev/sdXX (fill in XX with the disk and partition for the PReP partition; this was in our example /dev/sda1)
  • Next construct a yaboot.conf file and place it 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 the boot device in OF is pointing to the hard drive the prep boot partition is on, then it'll just work. If not, at IPL time, go into the multiboot menu and set the boot device to the one with the prep boot partition

That's it!

FILE yaboot.confExample yaboot.conf for IBM hardware
device=disk:
partition=2
root=/dev/sda3
default=linux
timeout=50
  
image=/boot/kernel-3.16.5-gentoo
    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 the kernel are on the same physical disk, it is possible to use a simplified yaboot.conf. The following should be sufficient:

FILE yaboot.confyaboot.conf for PReP hardware
default = linux
timeout = 100
image=/boot/kernel-3.16.5-gentoo
        label=linux
        read-only
        root = /dev/sda3
        append="root=/dev/sda2"

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

root #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.


システムのリブート

chroot環境を出て、全てのパーティションをアンマウントします。次に、最終かつ真のテストを実行するためのマジカルコマンドrebootを入力しましょう。

root #exit
cdimage ~#cd
cdimage ~#umount -l /mnt/gentoo/dev{/shm,/pts,}
cdimage ~#umount -R /mnt/gentoo
cdimage ~#reboot

もちろん、ブートCDを取り出しておいてください。そうしないと新しいGentooではなく、再度CDをブートしてしまいます。

新規にインストールされたGentooをリブートした後は、最終章インストールの締めくくりに進みましょう。