Bug#988450: bootctl systemd-efi-options doesn't work

Thomas Mühlbacher tmuehlbacher at posteo.net
Thu May 13 10:03:57 BST 2021


Package: systemd
Version: 247.3-5

The `systemd-efi-options` subcommand of `bootctl` fails to read the EFI
variable. Even after setting one, which does works. This variable then
also actually works when booting, for example the `debug` option is then
used by systemd. I am on an AMD Thinkpad E495, however I was also able
to reproduce this on an Intel system with a BIOS from a different
vendor.

```shell
# bootctl systemd-efi-options
Failed to query SystemdOptions EFI variable: No data available
# bootctl systemd-efi-options 'debug'
# bootctl systemd-efi-options
Failed to query SystemdOptions EFI variable: No data available
$ hd /sys/firmware/efi/efivars/SystemdOptions-8cf2644b-4b0b-428f-9387-6d876050dc67
00000000  07 00 00 00 64 00 65 00  62 00 75 00 67 00 00 00  |....d.e.b.u.g...|
00000010
```

When using this subcommand to read the variable, from what I can tell,
this function is called:

https://salsa.debian.org/systemd-team/systemd/-/blob/debian/247.3-5/src/basic/efivars.c#L398

Looking at the code a little, it appears that it only tries to read the
EFI variable from `/run/systemd/efivars/`, which appears to be a cache
dir for EFI vars to avoid the overhead of reading from
`/sys/firmware/efi/efivars/`. However this directory does not exist on
my system, even after running the command to set the `SystemdOptions`
var.

-- 
Cheers,
Thomas Mühlbacher



More information about the Pkg-systemd-maintainers mailing list