selftests/kexec: update get_secureboot_mode
authorMimi Zohar <zohar@linux.ibm.com>
Mon, 1 Apr 2019 17:39:44 +0000 (13:39 -0400)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 17 Apr 2019 21:32:44 +0000 (15:32 -0600)
commitb433a52aa28733e0650c5e83efdccfd0637b981a
tree1956c2d9916ef1e0698426828a770db82651c1ad
parent726ff75f294672d9accc57b2d5cc7e98e337d2c6
selftests/kexec: update get_secureboot_mode

The get_secureboot_mode() function unnecessarily requires both
CONFIG_EFIVAR_FS and CONFIG_EFI_VARS to be enabled to determine if the
system is booted in secure boot mode.  On some systems the old EFI
variable support is not enabled or, possibly, even implemented.

This patch first checks the efivars filesystem for the SecureBoot and
SetupMode flags, but falls back to using the old EFI variable support.

The "secure_boot_file" and "setup_mode_file" couldn't be quoted due to
globbing.  This patch also removes the globbing.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/kexec/kexec_common_lib.sh