From 517ea775e5f3f6bb707db4ad7dfc46c78ad4f768 Mon Sep 17 00:00:00 2001 From: Joseph Kogut Date: Fri, 26 Apr 2024 08:39:43 -0700 Subject: [PATCH] os-helpers-efi: silence secure boot variable checks 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 --- .../recipes-support/os-helpers/os-helpers/os-helpers-efi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-balena-common/recipes-support/os-helpers/os-helpers/os-helpers-efi b/meta-balena-common/recipes-support/os-helpers/os-helpers/os-helpers-efi index 8167a1a594..1ef3f8205a 100644 --- a/meta-balena-common/recipes-support/os-helpers/os-helpers/os-helpers-efi +++ b/meta-balena-common/recipes-support/os-helpers/os-helpers/os-helpers-efi @@ -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