Handbook:AMD64/Blocks/Bootloader/ja

ブートローダーを選ぶ
これまでLinuxカーネルを設定すると共に、システムツールをインストールし、設定ファイルを修正してきました. そして今、最も重要なLinuxインストールの最後の一片をインストールします. それがブートローダーです.

The boot loader is responsible for firing up the Linux kernel upon boot - without it, the system would not know how to proceed when the power button has been pressed.

For, we document how to configure either GRUB2 or LILO for BIOS based systems, and GRUB2 or efibootmgr for UEFI systems.

デフォルト: GRUB2 を用いる
Previously, Gentoo Linux used what is now called GRUB Legacy as the recommended boot loader. As the name implies, the older GRUB package is no longer actively maintained and has been superseded by GRUB2. For more information about the legacy GRUB, please refer to its GRUB article on the Gentoo Wiki.

GRUB2 のインストール
GRUB2 は、 で提供されています.


 * When using BIOS:




 * When using UEFI, UEFI users will need to add  to  first.





これで GRUB2 ソフトウェアがシステムにインストールされましたが、有効にはなっていません.

GRUB2 の設定
つぎに、必要な GRUB2 ファイルを にインストールします. もし（システムがブートする）一番目のディスクにインストールするなら、 ですので、以下のコマンドでインストールすることができます:


 * When using BIOS:


 * When using UEFI:





Next, we can generate the GRUB2 configuration based on the user configuration specified in the file and  scripts. In most cases, no configuration is needed by users as GRUB2 will automatically detect which kernel to boot (the highest one available in ) and what the root file system is.

最終的な GRUB2 の設定ファイルを生成するには、  コマンドを実行します:

The output of the command must mention that at least one Linux image is found, as those are needed to boot the system. If an initramfs is used or  was used to build the kernel, the correct initrd image should be detected as well. If this is not the case, go to and check the contents using the   command. If the files are indeed missing, go back to the kernel configuration and installation instructions.

LILO のインストール
LILO, the LInuxLOader, is the tried and true workhorse of Linux boot loaders. However, it lacks some features that GRUB has. 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.

Installing LILO is a breeze; just use emerge.

LILO の設定
LILO の設定をするにはまず、 を作成します:

In the configuration file, sections are used to refer to the bootable kernel. Make sure that the kernel files (with kernel version) and initramfs files are known, as they need to be referred to in this configuration file.

If an initramfs is necessary, then change the configuration by referring to this initramfs file and telling the initramfs where the real root device is at:

If additional options need to be passed to the kernel, use an  statement. For instance, to add the  statement to enable framebuffer:

Users that used  should know that their kernels use the same boot options as is used for the installation CD. For instance, if SCSI device support needs to be enabled, add  as kernel option.

Now save the file and exit.

To finish up, run  so LILO can apply the  settings to the system (i.e. install itself on the disk). Keep in mind that  needs to be executed every time a new kernel is installed or a change has been made to the  file.

代替案: efibootmgr を用いる
On UEFI based systems, the boot loader itself is the UEFI firmware of the system. Such systems do not need additional boot loaders to help boot the system, although EFI-based bootloaders do exist to extend the functionality of UEFI systems during boot.

The application is not a boot loader, but a tool to interact with the UEFI firmware and update its settings, so that the Linux kernel that was previously installed can be booted with additional options (if necessary), or to allow multiple boot entries. This interaction is done through the EFI variables (hence the need for the support of EFI vars in the past).

まずは efibootmgr をインストールします.

つぎに、"Gentoo" という名称のブートエントリーが作成され、これは新規にインストールされた Linux カーネルをブートするものであることを、UEFI ファームウェアに知らせます:

イニシャルRAMファイルシステム (initramfs)を用いるときには、適切なブートオプションを加えてください:

これらの変更が完了したら、システムを再起動後から、"Gentoo" という名称のブートエントリーが利用可能になります.