Skip to main content

EfiBootDude

efibootdude presents a visual (curses) interface to efibootmgr which allows editing the bios boot menu and parameters while running Linux.

  • Installation: pipx install efibootdude
  • Prerequisites:
    • Python 3.11 or newer.
    • Install rhboot/efibootmgr
      • For example, on a Debian derived distro, use sudo apt install efibootmgr.

Demo of efibootdude

efibootdude covers the most commonly used capabilities of efibootmgr; you can:

  • reorder, enable/disable, copy, and remove boot entries
  • choose what to boot on the next reboot (BootNext)
  • set the timeout before auto-booting
  • save your changes and reboot

Note: Copying a boot entry effectively adds a new entry with a different label. For more esoteric uses of efibootmgr (like setting custom boot variables), use efibootmgr directly.

Usage

Essentials before you start

  • Do not run efibootdude as root (i.e. do not use sudo efibootdude); run it as your normal user.
  • efibootdude elevates itself: the first time it needs to write (w) or reboot (b) it prompts for your sudo password.
  • Nothing is written until you press w and confirm at the prompt; press ? at any time for help.

See Privileges: efibootdude elevates to root automatically below for the full story and safety notes.

After running efibootdude and making some changes, you'll see a screen comparable to this:

 wRITE down next tag *:inact copy rmv [v]erbose [T]heme ?:help quit
──────────────────────────────────────────────────────────────────────────────
   BootNext: ---
   BootCurrent: 0007
   Timeout: 2 seconds
>* 0006 Linux Boot Manager               /dev/nvme0n1p1 \EFI\systemd\systemd-b
 * 0000 Enter Setup                      [Firmware]
 * 0001 NVMe: SAMSUNG MZALQ128HBHQ-000L2 [Auto]
 * 0002 UEFI Shell                       [Firmware]
   +ADD Linux Boot Manager Copy          [pending copy]
 * -RMV Ubuntu                           /boot/efi      \EFI\ubuntu\shimx64.ef

At this point

  • The "current" line starts with > and is highlighted.
  • The top line shows actions for the current line; type the underscored letter to effect its action.
  • Type ? for a more complete explanation of the keys, navigation keys, etc.
    • ALWAYS view the help at least once if unfamiliar with this tool, its navigation, and/or uncertain of keys not shown on top line.
  • With this current line, we can:
    • Type u or d to move it up or down in the boot order.
    • Type t to relabel the boot entry (prompts for new name).
    • Type c to copy the boot entry with a new label (prompts for new name).
    • Type r to remove the boot entry.
    • Type m on the Timeout line to change the boot timeout in seconds.
    • Type T to cycle through available themes.
    • And so forth.
  • The entries with * on the left are active boot entries; toggle whether active by typing * for the corresponding entries.
  • Special status lines at the top:
    • BootNext: shows which entry will boot next (use n to set it, or leave as ---)
    • BootCurrent: shows which entry is currently booted (read-only, set by firmware)
    • Timeout: shows boot timeout in seconds (use m to modify)
  • Special indicators:
    • +ADD shows pending copy operations (press r to cancel before writing)
    • -RMV shows entries marked for removal (press r to undo before writing)
  • Press ESC key to abandon any changes and reload the boot information.
  • When ready to write the changes to the BIOS, enter w.
  • When writing the changes, efibootdude drops out of menu mode so you can verify the underlying commands, error codes, and error messages.
  • After you write changes, type b to reboot, if you wish and the boot menu looks OK.
  • BTW, the top-line keys vary per context; e.g.:
    • w is only shown with pending changes, and
    • b is only shown w/o pending changes.

Caveats - Firmware Bugs and efibootmgr Quirks

  • Some operations may not work permanently even though there is no indication from efibootmgr (e.g., on my desktop, I cannot re-label boot entries); copy an entry and later remove the old one as a safe workaround.
  • Some operations may only work (again) after re-booting (e.g., you might find activating an entry does not work, but it does so after a reboot).
  • efibootmgr v18 cannot address Boot0000 by number: --bootnum 0000 fails with Boot entry 0 not found (other numbers work), even though the entry exists and lists fine. Work around it by changing the boot order (--bootorder) instead of the entry's active flag, or delete it from your firmware setup screen.

Privileges: efibootdude elevates to root automatically

efibootdude is designed to be launched as your normal, unprivileged user. Reading and writing the UEFI boot variables, however, requires root. Rather than making you launch the whole application with sudo, efibootdude elevates automatically: each privileged action it performs — writing changes with efibootmgr and rebooting — is run through sudo on your behalf. In practice, when you press w (write) or b (reboot), efibootdude becomes root for you without you typing sudo yourself. Only the individual efibootmgr/reboot commands are elevated; the TUI itself keeps running as your normal user.

  • The first time a privileged command runs you may be prompted for your password (unless your sudo credentials are already cached). Because efibootdude briefly leaves curses mode before running the commands, the sudo prompt and the resulting command output and exit codes are shown plainly on the terminal.
  • Tip: run sudo -v in another terminal first if you want to pre-authorize before starting efibootdude and avoid an in-app prompt.
  • Do not launch the whole program as root (sudo efibootdude). It works, but it is unnecessary and needlessly widens the blast radius — let efibootdude elevate only what it needs.

Doing it safely

Elevating only the individual commands (rather than the whole TUI) is the safer design, but you should still understand what you are handing over:

  • Root is blanket authority. Every generated command runs as root. Before anything is executed, efibootdude prints the exact command list and asks Run the above commands? (yes/No). Read that list before answering yes — it is your last chance to catch a mistyped label or the wrong partition.
  • Values are passed to sudo efibootmgr as separated arguments, never through a shell. Labels and device paths cannot break out into additional commands, so a crafted label cannot run arbitrary root commands.
  • Prefer scoping sudo to the two binaries. If you want to skip password prompts, grant passwordless sudo for just efibootmgr and reboot instead of for efibootdude as a whole. With sudo visudo, add a line such as:
    youruser ALL=(root) NOPASSWD: /usr/sbin/efibootmgr, /sbin/reboot
    
    (Paths vary by distro; confirm them with command -v efibootmgr and command -v reboot.) This is safer than NOPASSWD: ALL and safer than whitelisting the TUI wrapper.
  • Boot-menu changes are firmware-level and persistent. A bad write can leave a machine unbootable. Keep a recovery USB and know how to reach your firmware setup screen. The undoable-remove (-RMV) feature and the confirmation prompt reduce mistakes but are not a substitute for a recovery plan.
  • Reboot is immediate. The b key ultimately runs sudo reboot now after a typed confirmation.

About this Project

This project was inspired by Elinvention/efiboots. Relative to that project, the aims of efibootdude are:

  • to be easier to install especially when not in your distro's repos.
  • to clearly present the partition of the boot entries (as a mount point if mounted and, otherwise, the device pathname).
  • to show the underlying commands being run for education, for verification, and for help on investigating issues.

Metadata

Release files for efibootdude 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for efibootdude 1.1.0
File Size Uploaded Provenance Actions
efibootdude-1.1.0.tar.gz 784.4 kB Without provenance Details for efibootdude-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for efibootdude 1.1.0
File Interpreter ABI Platform Actions
efibootdude-1.1.0-py3-none-any.whl Python 3 none any Details for efibootdude-1.1.0-py3-none-any.whl

Total release size: 803.4 kB

Release files / efibootdude-1.1.0.tar.gz

Download URL efibootdude-1.1.0.tar.gz
Size 784.4 kB
Tags Source
SHA-256 checksum
How to use checksums
31c8684e330a413426610e4024fc69786139b58441b4df7b1ee3226c6f131182
BLAKE2b-256 checksum
How to use checksums
0ac72fe67f97896d5f9d068284a736ca51ffc105a4033258c312ab706fa931df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release files / efibootdude-1.1.0-py3-none-any.whl

Download URL efibootdude-1.1.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ede845b91886bff4d5c1dddf065b505fb3c206ff75dd1ab310f35c582ec8003a
BLAKE2b-256 checksum
How to use checksums
5bd484e22fce7a76c984ff08de3e8ae34f7fcd45aeb9f09fece5b996b4d544c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Security for efibootdude 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page