mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-12 21:57:27 +03:00
bootctl: highlight SecureBoot enabled state in green
(cherry picked from commit 4ed9e2619c630679b2fac1fc0eb4ab4b55f02871) (cherry picked from commit 97712df9c8b69e0bde261096b0540a063490efbe)
This commit is contained in:
parent
a4d0fe64fa
commit
6218be1a7f
@ -65,6 +65,10 @@ static inline const char* enable_disable(bool b) {
|
||||
return b ? "enable" : "disable";
|
||||
}
|
||||
|
||||
static inline const char* enabled_disabled(bool b) {
|
||||
return b ? "enabled" : "disabled";
|
||||
}
|
||||
|
||||
/* This macro's return pointer will have the "const" qualifier set or unset the same way as the input
|
||||
* pointer. */
|
||||
#define empty_to_null(p) \
|
||||
|
@ -406,9 +406,15 @@ int verb_status(int argc, char *argv[], void *userdata) {
|
||||
printf("%sSystem:%s\n", ansi_underline(), ansi_normal());
|
||||
printf(" Firmware: %s%s (%s)%s\n", ansi_highlight(), strna(fw_type), strna(fw_info), ansi_normal());
|
||||
printf(" Firmware Arch: %s\n", get_efi_arch());
|
||||
printf(" Secure Boot: %sd (%s)\n",
|
||||
enable_disable(IN_SET(secure, SECURE_BOOT_USER, SECURE_BOOT_DEPLOYED)),
|
||||
secure_boot_mode_to_string(secure));
|
||||
printf(" Secure Boot: %s%s%s",
|
||||
IN_SET(secure, SECURE_BOOT_USER, SECURE_BOOT_DEPLOYED) ? ansi_highlight_green() : ansi_normal(),
|
||||
enabled_disabled(IN_SET(secure, SECURE_BOOT_USER, SECURE_BOOT_DEPLOYED)),
|
||||
ansi_normal());
|
||||
|
||||
if (secure != SECURE_BOOT_DISABLED)
|
||||
printf(" (%s)\n", secure_boot_mode_to_string(secure));
|
||||
else
|
||||
printf("\n");
|
||||
|
||||
s = tpm2_support();
|
||||
printf(" TPM2 Support: %s%s%s\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user