Skip to content

efibootmgr

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


# Device Drivers  --->
>   Firmware Drivers  --->
>      [ ] Disable EFI runtime services support by default
>           [*] Network core driver support # Symbol: NET_CORE [=y]

# File systems  --->
>   Pseudo filesystems  --->
>       <*> EFI Variable filesystem
#!/bin/bash

for x in $(efibootmgr -v \
    |grep ^Boot \
    |grep -vi order \
    |cut -f1 -d ' ' \
    cut -f1 -d'*' \
    |sed "s/Boot00//g" \
    |sed "s/^0//g"); do 
	    efibootmgr -b $x -B ; 
done

Configure efibootmgr

This is how I start my gentoo machine if no other functions are needed (then I'm not using grub in this example)

efibootmgr -d /dev/sda -p 2 -c -L "Gentoo Linux" -l /vmlinuz-5.4.97-gentoo-x86_64 -u "cryptdevice=UUID=80bf5e3b-c34f-4917-b7e8-6733909ef5a8:latitude-rootfs root=UUID=80bf5e3b-c34f-4917-b7e8-6733909ef5a8 rw initrd=/initramfs-5.4.97-gentoo-x86_64.img"
efibootmgr -d /dev/sda -p 2 -c -L "Gentoo Linux" -l /vmlinuz-5.4.97-gentoo-x86_64 -u "cryptdevice=UUID=UUID:lvm root=UUID=<real_root_uuid></real_root_uuid> rw initrd=/initramfs-5.4.97-gentoo-x86_64.img

Creating Network Boot Entries

!From the efiboomgr manual - As I have read and simplified for with correct examples

A system administrator wants to create a boot option to network boot (PXE). Unfortunately, this requires knowing a little more information about your system than can be easily found by efibootmgr, so you've got to pass additional information - the ACPI HID and UID values.

These can generally be found by using the EFI Boot Manager (in the EFI environment) to create a network boot entry, then using efibootmgr to print it verbosely.

  • Here's one example:

Boot003* Acpi(PNP0A03,0)/PCI(5|0)/Mac(00D0B7F9F510)  ACPI(a0341d0,0)PCI(0,5)MAC(00d0b7f9f510,0) In this case, the ACPI HID is 0A0341d0 and the UID is 0.

For the zx2000 gigE, the HID is 222F and the UID is 500". For the rx2000 gigE, the HID is 0002 and the UID is 100.

You create the boot entry with: efibootmgr -c -i eth0 -H 222F -U 500 -L netboot