]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: show reboot-to-firmware info, too
authorLennart Poettering <lennart@poettering.net>
Wed, 27 May 2020 14:34:16 +0000 (16:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 29 May 2020 13:41:46 +0000 (15:41 +0200)
src/boot/bootctl.c

index ab145d65f5bcad3a9a3baab64c6991e911b1319a..11563fc2dee1895f248201afaf49e1d3c36af5c5 100644 (file)
@@ -1245,6 +1245,18 @@ static int verb_status(int argc, char *argv[], void *userdata) {
                 printf("     Firmware: %s%s (%s)%s\n", ansi_highlight(), strna(fw_type), strna(fw_info), ansi_normal());
                 printf("  Secure Boot: %sd\n", enable_disable(is_efi_secure_boot()));
                 printf("   Setup Mode: %s\n", is_efi_secure_boot_setup_mode() ? "setup" : "user");
+
+                r = efi_get_reboot_to_firmware();
+                if (r > 0)
+                        printf(" Boot into FW: %sactive%s\n", ansi_highlight_yellow(), ansi_normal());
+                else if (r == 0)
+                        printf(" Boot into FW: supported\n");
+                else if (r == -EOPNOTSUPP)
+                        printf(" Boot into FW: not supported\n");
+                else {
+                        errno = -r;
+                        printf(" Boot into FW: %sfailed%s (%m)\n", ansi_highlight_red(), ansi_normal());
+                }
                 printf("\n");
 
                 printf("Current Boot Loader:\n");