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 <joseph@balena.io>
  • Loading branch information
jakogut committed Jun 14, 2024
1 parent bc0b6bf commit 0f1af2c
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 0f1af2c

Please sign in to comment.