Efibootmgr/zh-cn

is Article description::a tool for managing UEFI boot entries.

It is not a bootloader. It is a tool that interacts with the EFI firmware of the system, which itself is acting as a bootloader. Using boot entries can be created, reshuffled and removed.

内核
CONFIG_EFI_VARS support needs to be enabled:

安装
The package does not have any USE flags. All that is needed is to install it:

EFI vars
In order to successfully use the EFI variables filesystem must be accessible. This requires that the system has been booted in EFI mode (and not through the firmware's MBR mode) as otherwise the EFI variables themselves cannot be accessed. If the system is in MBR mode, reboot and do what is necessary in order to tell the system firmware to boot in EFI mode. Usually this involved either changing an option in the firmware's settings or selecting an EFI boot entry in the system's boot menu.

When the system is in EFI mode, run the following command to check for the existence of efivarfs:

It is mounted ro through the init script), so it needs to be remounted rw manually using the following command:

Preconditions
If an EFI System Partition (ESP) does not exist, one needs to be created, see EFI System Partition

Listing boot entries
To list the current boot entries by using the  option:

Creating a boot entry
To create an EFI boot entry, a couple of arguments are passed to :


 * to create a new entry;
 * followed by the partition number on which the EFI System Partition is hosted;
 * followed by the disk on which the EFI System Partition is hosted;
 * followed by the label to use as the boot entry;
 * followed by the path of the EFI image to boot

For instance:

Optionally, additional kernels can be installed and made known to the UEFI firmware. This is especially useful when wanting to test more kernels or to dual-boot with another operating system. These will be shown in the boot selection prompt, normally after a keyboard hotkey is pressed at the right time during system initialization. The latest added entry always gets highest boot priority, so it will be default. If the hotkey combination is unknown, search for official documentation from the computer manufacturer. This information is usually not difficult to find.

Deleting a boot entry
Before deleting an entry, first figure out what ID the entry has.

To delete the Gentoo entry as shown above (which has Boot0002 as the identifier), ask to delete the entry with id 2, passing the arguments   with the identifier, and   to delete the entry: