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, users will need to add  to  before emerging GRUB2 so that the package will be built with EFI functionality:






 * If GRUB2 was somehow emerged without first adding  to  the line (as shown above) can be added then and dependencies for the world package set re-calculated by passing the   options to :



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

GRUB2 の設定
Next, install the necessary GRUB2 files to the directory via the  command. Presuming the first disk (the one where the system boots from) is, one of the following commands will do:


 * When using BIOS:


 * When using UEFI:







Next, 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.

To generate the final GRUB2 configuration, run the command:

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 root device is located:

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 must be executed each time a new kernel is installed or a change has been made to the  file in order for the system to boot if the filename of the kernel has changed.

代替案: 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" という名称のブートエントリーが利用可能になります.