Skip to content

RFC: What are your gripes with `efibootmgr`, and would you use a better version of it?

I recently switched from the mainline kernel to the LTS one, and had one hell of a time editing the boot entries (I use EFISTUB, so no bootloader) with efibootmgr. It felt incredibly clunky and frustratingly sparse in terms of documentation. I have a few noticeable gripes with it now:

  • Boot entries cannot be edited, and instead need to be deleted an re-created all over again.
  • Boot order cannot be changed trivially, the entire order has to be passed to the flag including the ones that haven't changed position.
  • The default output is unreadable as it is not in unicode; I don't see how this benefits anyone using the tool.

I want to reach out to the community (you) and ask what your gripes are, and whether you would be interested in an improved efibootmgr equivalent?

15 points8 comments
Open on Reddit
About this post
Posted
Archived
Score
15 · 94% up
Kind
Text
ID
18j6o7x

Author

3
posts
68
comments
0
media
View profile

8 comments

First, the name should be changed. "efibootmgr" implies that it's the EFI boot manager. It's not. It's a tool that's used to edit the EFI boot manager entries.

Second, it clearly needs to read a config file. This functionality could be added in a backwards compatible way, retaining the current command line syntax. This would solve your first two bullet points.

As for the unicode, I suspect it's just copying strings with no knowledge of the encoding. Maybe the entries are in utf16 or something. This should be fixed to. The tool should translate between whatever is used for the entries and whatever your locale calls for.

11 points

The entries are in either UTF16 or UCS2, I forget which is used by UEFI firmware.

3 points

I use a simple Bash script to configure the Boot entries

#!/bin/bash
efibootmgr --disk /dev/nvme0n1p1 --part 1 --bootnum 0001 --delete-bootnum
efibootmgr --disk /dev/nvme0n1p1 --part 1 --write-signature --bootnum 0001 --create --label "Arch Linux" --loader 'EFI\arch\archlinux-linux.efi' --unicode
efibootmgr --disk /dev/nvme0n1p1 --part 1 --bootnum 0002 --delete-bootnum
efibootmgr --disk /dev/nvme0n1p1 --part 1 --write-signature --bootnum 0002 --create --label "Arch Linux (Fallback)" --loader 'EFI\arch\archlinux-linux-fallback.efi' --unicode
efibootmgr --disk /dev/nvme0n1p1 --part 1 --bootnum 000 --delete-bootnum
efibootmgr --disk /dev/nvme0n1p1 --part 1 --write-signature --bootnum 0004 --create --label "Arch Linux lts" --loader 'EFI\arch\archlinux-linux-lts.efi' --unicode
efibootmgr --disk /dev/nvme0n1p1 --part 1 --bootnum 000 --delete-bootnum
efibootmgr --disk /dev/nvme0n1p1 --part 1 --write-signature --bootnum 0005 --create --label "Arch Linux lts (Fallback)" --loader 'EFI\arch\archlinux-linux-lts-fallback.efi' --unicode
efibootmgr --bootorder 0001,0002,0003,0000 --verbose

the 0000 entry is Windows
So for me a tool would not have much benefit because it is quite easy to edit the script.

6 points

I've ran into all of those issues you mentioned and yeah, each and every one is annoying, especially that you cannot edit (or even recreate the boot entry).

The tool also fails to set my boot order correctly, but I think that's a limitation of my B550 Tomahawk. Setting the boot order in BIOS works, so whatever.

2 points

Definitely would be interested. I would love it to just print the current EFI boot situation. Anything else would be a bonus. It's such an important part of setting up a system or recovering from failure it would be great if it has a simple and intuitive CLI with good feedback.

1 points

It works when I need it, that's it. Clunky CLI would be for sure more annoying if I had to update those EFI entries often. But that's not usually the case, as I use a bootloader (refind)

1 points

Boot entries cannot be edited, and instead need to be deleted an re-created all over again.

This is the biggest problem IMHO: I'd like to give a number like Boot0001 or a name like "Arch", to:

  • overwrite the content of the matching entry with a flag like --update-content Boot001 "EFI\arch\zfs-6.2.0-nohz.efi" to start using this UKI for the 1st entry, with minor verifications (just that the file exists on the drive and partition) or none at all
  • same for the name: --update-name Boot001 "Arch kernel test"

Boot order cannot be changed trivially, the entire order has to be passed to the flag including the ones that haven't changed position.

That's not as bad, but I would like to do insertions: using anything from the current set of boot entries, I should be able to express the relation I want: if I say Boot001 --after Boot01A, I'd like if Boot01A is absent from the list to get an error, but if it's present and so is Boot001, remove Boot0001 from the order list, and reinsert it right after Boot01A wherever it is.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.