Skip to content

Commit

Permalink
os-helpers-efi: silence secure boot variable checks
Browse files Browse the repository at this point in the history
If the SecureBoot variable is non-existent, the parsed value is not an
integer, and test complains. Redirect stderr to silence this.

Change-type: patch
Signed-off-by: Joseph Kogut <[email protected]>
  • Loading branch information
jakogut committed Sep 12, 2024
1 parent 9b7de1c commit 517ea77
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ parse_efivar_val() {
# return zero if secure boot is enabled
secureboot_enabled() {
test "$(parse_efivar_val \
/sys/firmware/efi/efivars/SecureBoot-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1
/sys/firmware/efi/efivars/SecureBoot-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1 \
2>/dev/null
}

# return zero if system is in setup mode
setup_mode_enabled() {
test "$(parse_efivar_val \
/sys/firmware/efi/efivars/SetupMode-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1
/sys/firmware/efi/efivars/SetupMode-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1 \
2>/dev/null
}

# return zero if system is in user mode
Expand Down

0 comments on commit 517ea77

Please sign in to comment.