rhboot / efibootmgr

efibootmgr development tree
GNU General Public License v2.0
522 stars 100 forks source link

Add efibootkey #192

Open demitriusbelai opened 1 year ago

demitriusbelai commented 1 year ago

Add efibootkey command for add hot keys to boot options.

Spec: https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html#launching-boot-load-options-using-hot-keys

Command line arguments:

Arg Description
-b | --bootnum XXXX Hot key for BootXXXX
-k | --key CODE Code of Key, can repeat for more than one
--alt Alt must be pressed
--shift Shift key must be pressed
--ctrl Control key must be pressed
--logo Logo key must be pressed
--menu Menu key must be pressed
--sysreq SysReq must be pressed
-l | -- list List Hot Keys
-B | --delete-keynum Delete Hot Key
-n | --keynum XXXX Use KeyXXXX

Examples

Verifing if hot key is supported:

efibootkey --support

If I want use F1 to boot Boot0001:

efibootkey -b 1 -k F1

'l' to boot Boot0000:

efibootkey -b 0 -k l

List hot keys:

efibootkey --list

Now, delete the hot key:

efibootkey -B -n 1