bootctl: print SystemdOptions from efivarfs if newer than our cache

The logic is that if the options are updated after boot, we *don't* use
the new value. But we still want to print out the changed contents in
bootctl as to not confuse people.

Fixes #19597.
Also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988450.

$ build/bootctl systemd-efi-options
quiet
Note: SystemdOptions EFI variable has been modified since boot. New value: debug

The hint is printed to stderr, so scripts should not be confused.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-06-15 22:01:42 +02:00
parent c67bd42b71
commit ad2d6880ea
3 changed files with 63 additions and 8 deletions
+5
View File
@@ -52,6 +52,7 @@ bool is_efi_secure_boot_setup_mode(void);
int cache_efi_options_variable(void);
int systemd_efi_options_variable(char **line);
int systemd_efi_options_efivarfs_if_newer(char **line);
#else
@@ -90,4 +91,8 @@ static inline int cache_efi_options_variable(void) {
static inline int systemd_efi_options_variable(char **line) {
return -ENODATA;
}
static inline int systemd_efi_options_efivarfs_if_newer(char **line) {
return -ENODATA;
}
#endif