diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-12-16 18:27:06 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-12-19 11:43:19 +0100 |
commit | 34ea7e02320f6f91c354a5c329eeb29f998dd731 (patch) | |
tree | 5d0043ff4b6ed73da2140afe170611bfdbee885c /src/boot/bootctl.c | |
parent | cc3254c4462905f9c177dfd40dc0c296e00d00df (diff) | |
download | systemd-34ea7e02320f6f91c354a5c329eeb29f998dd731.tar.gz |
bootctl: let's start splitting up bootctl like we did for systemctl and others
Diffstat (limited to 'src/boot/bootctl.c')
-rw-r--r-- | src/boot/bootctl.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 7721c3d2e3..9b82102d0e 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -14,6 +14,7 @@ #include "alloc-util.h" #include "blkid-util.h" +#include "bootctl-reboot-to-firmware.h" #include "bootspec.h" #include "build.h" #include "chase-symlinks.h" @@ -2499,39 +2500,6 @@ static int verb_systemd_efi_options(int argc, char *argv[], void *userdata) { return 0; } -static int verb_reboot_to_firmware(int argc, char *argv[], void *userdata) { - int r; - - if (argc < 2) { - r = efi_get_reboot_to_firmware(); - if (r > 0) { - puts("active"); - return EXIT_SUCCESS; /* success */ - } - if (r == 0) { - puts("supported"); - return 1; /* recognizable error #1 */ - } - if (r == -EOPNOTSUPP) { - puts("not supported"); - return 2; /* recognizable error #2 */ - } - - log_error_errno(r, "Failed to query reboot-to-firmware state: %m"); - return 3; /* other kind of error */ - } else { - r = parse_boolean(argv[1]); - if (r < 0) - return log_error_errno(r, "Failed to parse argument: %s", argv[1]); - - r = efi_set_reboot_to_firmware(r); - if (r < 0) - return log_error_errno(r, "Failed to set reboot-to-firmware option: %m"); - - return 0; - } -} - static int bootctl_main(int argc, char *argv[]) { static const Verb verbs[] = { { "help", VERB_ANY, VERB_ANY, 0, help }, |