summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDate Huang <tjjh89017@hotmail.com>2024-11-08 21:19:03 +0800
committerDate Huang <tjjh89017@hotmail.com>2024-11-08 21:19:03 +0800
commita48b8fdc18a654cfe6b4d7cfefecd9338b623c55 (patch)
tree0fa5f636dcfc61a787ad1aec367327c65f33a95c
parent4139e1c12c3f8d6abdf42dc3febfffc097a41c7a (diff)
downloadvyos-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.py2
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)