refind-mkdefault - Man Page

Set rEFInd as the default EFI boot option

Synopsis

refind-mkdefault [ -L|--label <name> ]

Description

EFI booting normally relies on boot manager entries stored in NVRAM, which describe the locations of EFI boot programs and the order in which the firmware will attempt to launch them. In Linux, these entries can be created, deleted, and manipulated with the efibootmgr utility.

Many OSes and Linux packages assume that they should control the boot process, and so both create NVRAM boot entries for themselves and set these entries first in the boot order. If you intend rEFInd to control the boot process, though, such changes are undesirable and require adjustment via efibootmgr. Such adjustments are annoying to make and can be intimidating to non-experts.

The refind-mkdefault script simplifies matters: Running this script with no options sets rEFInd as the default boot program. The details of what the script does depends on the current state of the boot order list and existing boot entries:

A rEFInd entry is defined as one that contains the string refind (case-insensitive). This string could exist in the description or in the filename. The string used to define the rEFInd entry can be changed via the --label (-L) option.

The intent is that refind-mkdefault can be called after booting via GRUB or some other means to restore rEFInd as the default boot program.  It can also be placed in a startup and/or shutdown script to restore rEFInd to its default position automatically. Because it does not re-write the boot order if rEFInd is listed as the first boot entry, this practice should be low in risk.

Options

-L | --label <name>

Instead of searching for the string refind in efibootmgr output as a way to identify rEFInd, search for the string name.

Return Values

refind-mkdefault returns the following values:

0

The script completed successfully, which can mean either that no change was necessary or that the call to efibootmgr returned a success code.

1

EFI boot order variables are available, and a rEFInd entry was found, but the call to efibootmgr returned a failure code.

2

EFI boot entries are not available. This condition is often an indication of a buggy EFI or badly damaged NVRAM contents.

3

No rEFInd entry could be found in the list of boot options, and so no changes were made to the boot order list.

4

The script could not run because of OS issues -- the OS was not Linux, the efibootmgr utility was not available, or the script was not run as root.

Limitations

Authors

Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)

See Also

mvrefind(8), mkrlconf(8), refind-install(8), efibootmgr(8).

https://www.rodsbooks.com/refind/

Availability

The refind-mkdefault command is part of the rEFInd package and is available from Roderick W. Smith.

Info

0.13.3 Roderick W. Smith rEFInd Manual