avocado
avocado copied to clipboard
Adding check if secureboot is enabled or not
The function checks if secureboot is enabled or not from the OS side. The command output of "lsprop /proc/device-tree/ibm,secure-boot" is used to check the OS status.
Dear contributor, Avocado is currently at the end of sprint #105, therefore we are in feature freeze state. Please avoid merging changes that do not fall into these categories:
- Bug fixes
- Documentation updates
The feature freeze will be active until the release planned on 05/06/2024.
@vaishnavibhat fix static fails make use of double qoutes here if '00000002' in line:
lsprop is a tool provided by powerpc-utils. It is used to get information about /proc files .
For secureboot check: #lsprop /proc/device-tree/ibm,secure-boot /proc/device-tree/ibm,secure-boot 00000002
0 incase of secure boot disabled, 1 (enable and log only - trusted boot) and 2 (enable and enforce - secure boot)
#man lsprop LSPROP(8) Linux on Power Service Tools LSPROP(8)
NAME lsprop - list properties
SYNOPSIS lsprop [-R] [-m max-bytes] [-w num-words] [FILE...]
OVERVIEW lsprop program is a member of the ppc64-utils suite of utils. Use it to list properties
DESCRIPTION lsprop displays properties for FILEs like Open Firmware .properties word. If the FILE is not set, the current directory is used.
OPTIONS -R Process recursively
-m max-bytes
Read only first max-bytes bytes from the FILEs
-w num-words
Display up to num-words words per line
Linux Sep 2010 LSPROP(8)
lsprop is a tool provided by powerpc-utils. It is used to get information about /proc files .
For secureboot check: #lsprop /proc/device-tree/ibm,secure-boot /proc/device-tree/ibm,secure-boot 00000002
0 incase of secure boot disabled, 1 (enable and log only - trusted boot) and 2 (enable and enforce - secure boot)
#man lsprop LSPROP(8) Linux on Power Service Tools LSPROP(8)
NAME lsprop - list properties
SYNOPSIS lsprop [-R] [-m max-bytes] [-w num-words] [FILE...]
OVERVIEW lsprop program is a member of the ppc64-utils suite of utils. Use it to list properties
DESCRIPTION lsprop displays properties for FILEs like Open Firmware .properties word. If the FILE is not set, the current directory is used.
OPTIONS -R Process recursively
-m max-bytes Read only first max-bytes bytes from the FILEs -w num-words Display up to num-words words per line
Linux Sep 2010 LSPROP(8)
Hi @vaishnavibhat thank you for the description. So IIUIC the whole is_os_secureboot_enabled
method will only work on powerpc. Therefore, I would propose to do an arch check and create and raise for example UnsupportedMachineError
for unsupported architectures.
@vaishnavibhat Please fix the duplicate comit.. ammend the same do not create new commit
Resending the patch after taking care of the review comments.
@richtja Please see if this is mergable
@richtja Addressed the review comments. Please me know if this looks good.
Thank you