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

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:PPC64/Installation/Bootloader and the translation is 100% complete.
PPC64 ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage ファイル
ベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentoo の操作
Portage について
USE フラグ
Portage の機能
Init スクリプトシステム
環境変数
Portage の操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムパッケージリポジトリ
高度な機能
OpenRC ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理



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.

GRUB が PPC64 ベースの Linux マシン向けのブートローダです。

インストール

root #emerge --ask sys-boot/grub

Setup bootstrap partition

First, prepare the bootstrap partition that was created created during the preparing the disk step. Following the example, this partition should be /dev/sda2. Optionally, confirm this by using parted:

Replace /dev/sda with the correct device if required.

root #parted /dev/sda print
Model: ATA Patriot Burst El (scsi)

Disk /dev/sda: 120GB

Sector size (logical/physical): 512B/512B

Partition Table: mac

Disk Flags:

Number  Start   End     Size    File system  Name       Flags
 1      512B    32.8kB  32.3kB               Apple
 2      32.8kB  852kB   819kB   hfs          bootstrap  boot
 3      852kB   538MB   537MB   ext4         Boot
 4      538MB   54.2GB  53.7GB  ext4         Gentoo

In this output, partition 2 has the bootstrap information so /dev/sda2 is the correct path to use.

Format this partition as HFS using the hformat command which is part of the sys-fs/hfsutils package:

root #dd if=/dev/zero of=/dev/sda2 bs=512
root #hformat -l bootstrap /dev/sda2

Create a directory to mount the bootstrap partition and then mount it:

root #mkdir /boot/NWBB
root #mount --types hfs /dev/sda2 /boot/NWBB

Setup GRUB

root #grub-install --macppc-directory=/boot/NWBB /dev/sda2

If it installs without errors, unmount the bootstrap:

root #umount /boot/NWBB

Next, bless the partition so it will boot:

root #hmount /dev/sda2
root #hattrib -t tbxi -c UNIX :System:Library:CoreServices:BootX
root #hattrib -b :System:Library:CoreServices
root #humount

Finally, build the grub.cfg file:

root #grub-mkconfig -o /boot/grub/grub.cfg


Using yaboot on IBM hardware

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

  • Emerge the yaboot-static package.
  • Run the following command, filling in XX with the disk and partition for the PReP partition. {{Path|/dev/sda1}
root #dd if=/usr/lib/yaboot/yaboot.chrp of=/dev/sdXX
  • Construct a yaboot.conf file and place it into /etc/. Take a look at the configuration example above, look into the man page for yaboot.conf (man 8 yaboot.conf, or look at the below yaboot.conf example.
  • Assuming the boot device in OpenFirmware 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!

ファイル 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:

ファイル 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を入力しましょう。

(chroot) livecd #exit
livecd~#cd
livecd~#umount -l /mnt/gentoo/dev{/shm,/pts,}
livecd~#umount -R /mnt/gentoo
livecd~#reboot

live イメージを取り出すのを忘れないでください。そうしないと新しくインストールされた Gentoo ではなく、live イメージが再度ブート対象になってしまうかもしれません!

リブートして新しい Gentoo 環境に入ることができたら、最終章のインストールの締めくくりに進むのがよいでしょう。