diff options
author | Christian Breunig <christian@breunig.cc> | 2024-08-26 20:23:32 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-09-16 17:28:50 +0200 |
commit | b78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33 (patch) | |
tree | e4769e5024246c8cd84cd4318b6cc3fc9a4d7fee /python/vyos/utils/boot.py | |
parent | 56cd7de907ef26ae27909a5d468768bb6e1e7f6f (diff) | |
download | vyos-1x-b78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33.tar.gz vyos-1x-b78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33.zip |
T861: op-mode: "show version" will display secure boot state
vyos@vyos:~$ show ver
...
Architecture: x86_64
Boot via: installed image
System type: KVM guest
Secure Boot: enabled
...
Diffstat (limited to 'python/vyos/utils/boot.py')
-rw-r--r-- | python/vyos/utils/boot.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/vyos/utils/boot.py b/python/vyos/utils/boot.py index 3aecbec64..708bef14d 100644 --- a/python/vyos/utils/boot.py +++ b/python/vyos/utils/boot.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors <maintainers@vyos.io> +# Copyright 2023-2024 VyOS maintainers and contributors <maintainers@vyos.io> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -33,3 +33,7 @@ def boot_configuration_success() -> bool: if int(res) == 0: return True return False + +def is_uefi_system() -> bool: + efi_fw_dir = '/sys/firmware/efi' + return os.path.exists(efi_fw_dir) and os.path.isdir(efi_fw_dir) |