5

After spending hours debugging a problem where systemd-boot started skipping its boot menu and in general ignoring its configuration file /loader/loader.conf (on the EFI partition), I've discovered that I can invoke the boot menu by pressing down some key at start-up, and that the problem is caused by certain EFI variable which I have apparently inadvertently created. (I do not know how this happened, but the issue appeared shortly after I re-installed Ubuntu 18.04.1 on one partition.)

In particular, I've discovered that had the variable LoaderConfigTimeout-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f set to 0 somehow, which overrode the timeout defined in /loader/loader.conf, and I also had the variable LoaderEntryDefault-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f defined, which was overriding the default menu entry set in /loader/loader.conf.

See the bottom of "systemd-boot UEFI Boot Manager" page on freedesktop.org for the list of EFI variables used by systemd-boot. Their values can be inspected with, for example

cat /sys/firmware/efi/efivars/LoaderConfigTimeout-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

After I made the boot menu appear by pressing some key, and then pressed d twice to set and unset a new default entry, this removed my LoaderEntryDefault-... variable. However, I am still stuck with LoaderConfigTimeout-.... I know that I can change the timeout by using t T(Shift-t) keys in the menu, which modifies LoaderConfigTimeout-..., but I want to remove it altogether, so that the configuration in /loader/loader.conf be used again.

What is the correct and safe way to modify and unset EFI variables, such as LoaderConfigTimeout-...?

Alexey
  • 1,323

1 Answers1

4

In systemd-boot, press ShiftT or Num - enough times that the setting reaches zero, and one more time to unset it completely removing the variable.

On Linux, first use chattr -i on the /sys/… file to remove the kernel-applied protection, then use rm to delete the variable entirely.

In the UEFI Shell, use dmpstore -d <name> (with optional -guid <guid>) to delete a variable (see documentation in UEFI Shell Spec 2.0, page 113).

grawity
  • 501,077