diff options
author | Date Huang <tjjh89017@hotmail.com> | 2024-11-08 21:19:03 +0800 |
---|---|---|
committer | Date Huang <tjjh89017@hotmail.com> | 2024-11-08 21:19:03 +0800 |
commit | a48b8fdc18a654cfe6b4d7cfefecd9338b623c55 (patch) | |
tree | 0fa5f636dcfc61a787ad1aec367327c65f33a95c | |
parent | 4139e1c12c3f8d6abdf42dc3febfffc097a41c7a (diff) | |
download | vyos-1x-a48b8fdc18a654cfe6b4d7cfefecd9338b623c55.tar.gz vyos-1x-a48b8fdc18a654cfe6b4d7cfefecd9338b623c55.zip |
T6861: op-mode: ignore error code 255 if this UEFI doesn't support secure boot
`mokutil --sb-state` will output "This system doesn't support Secure Boot" to stderr.
and return error code 255 if the UEFI system doesn't support secure boot.
Signed-off-by: Date Huang <tjjh89017@hotmail.com>
-rw-r--r-- | python/vyos/utils/system.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/utils/system.py b/python/vyos/utils/system.py index 7b12efb14..a556a8ec4 100644 --- a/python/vyos/utils/system.py +++ b/python/vyos/utils/system.py @@ -145,5 +145,5 @@ def get_secure_boot_state() -> bool: from vyos.utils.boot import is_uefi_system if not is_uefi_system(): return False - tmp = cmd('mokutil --sb-state') + tmp = cmd('mokutil --sb-state', expect=[255]) return bool('enabled' in tmp) |