efivars: kill SystemdOptions efi var support

This has been depracted since v254 (2023). Let's kill it for
good now, it has been long enough with 2y. Noone has shown up who wants
to keep it. And given it doesn't work in SB world anyway, and is not
measured is quite problematic security wise.
This commit is contained in:
Lennart Poettering
2025-02-26 17:28:43 +01:00
parent 2dbc2d1d0f
commit 14871a6529
15 changed files with 9 additions and 295 deletions
-43
View File
@@ -1,43 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "bootctl.h"
#include "bootctl-systemd-efi-options.h"
#include "efi-loader.h"
int verb_systemd_efi_options(int argc, char *argv[], void *userdata) {
int r;
/* This is obsolete and subject to removal */
if (!arg_quiet)
log_notice("Use of the SystemdOptions EFI variable is deprecated.");
if (argc == 1) {
_cleanup_free_ char *line = NULL, *new = NULL;
r = systemd_efi_options_variable(&line);
if (r == -ENODATA)
log_debug("No SystemdOptions EFI variable present in cache.");
else if (r < 0)
return log_error_errno(r, "Failed to read SystemdOptions EFI variable from cache: %m");
else
puts(line);
r = systemd_efi_options_efivarfs_if_newer(&new);
if (r == -ENODATA) {
if (line)
log_notice("Note: SystemdOptions EFI variable has been removed since boot.");
} else if (r < 0)
log_warning_errno(r, "Failed to check SystemdOptions EFI variable in efivarfs, ignoring: %m");
else if (new && !streq_ptr(line, new))
log_notice("Note: SystemdOptions EFI variable has been modified since boot. New value: %s",
new);
} else {
r = efi_set_variable_string(EFI_SYSTEMD_VARIABLE_STR("SystemdOptions"), argv[1]);
if (r < 0)
return log_error_errno(r, "Failed to set SystemdOptions EFI variable: %m");
}
return 0;
}
@@ -1,4 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
int verb_systemd_efi_options(int argc, char *argv[], void *userdata);
-2
View File
@@ -11,7 +11,6 @@
#include "bootctl-reboot-to-firmware.h"
#include "bootctl-set-efivar.h"
#include "bootctl-status.h"
#include "bootctl-systemd-efi-options.h"
#include "bootctl-uki.h"
#include "build.h"
#include "devnum-util.h"
@@ -630,7 +629,6 @@ static int bootctl_main(int argc, char *argv[]) {
{ "set-timeout", 2, 2, 0, verb_set_efivar },
{ "set-timeout-oneshot", 2, 2, 0, verb_set_efivar },
{ "random-seed", VERB_ANY, 1, 0, verb_random_seed },
{ "systemd-efi-options", VERB_ANY, 2, 0, verb_systemd_efi_options },
{ "reboot-to-firmware", VERB_ANY, 2, 0, verb_reboot_to_firmware },
{}
};
-1
View File
@@ -6,7 +6,6 @@ bootctl_sources = files(
'bootctl-reboot-to-firmware.c',
'bootctl-set-efivar.c',
'bootctl-status.c',
'bootctl-systemd-efi-options.c',
'bootctl-uki.c',
'bootctl-util.c',
'bootctl.c',