acpi/boot: skip ACPI BOOT test on UEFI systems.
diff mbox series

Message ID 20190918095103.11319-1-alex.hung@canonical.com
State Superseded
Headers show
Series
  • acpi/boot: skip ACPI BOOT test on UEFI systems.
Related show

Commit Message

Alex Hung Sept. 18, 2019, 9:51 a.m. UTC
BOOT table is for PC-AT BIOS, and UEFI systems shall use
SimpleBootFlag variable is stored in NVRAM.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/boot/boot.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Colin King Sept. 18, 2019, 9:53 a.m. UTC | #1
On 18/09/2019 11:51, Alex Hung wrote:
> BOOT table is for PC-AT BIOS, and UEFI systems shall use
> SimpleBootFlag variable is stored in NVRAM.
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/boot/boot.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/acpi/boot/boot.c b/src/acpi/boot/boot.c
> index 081b8b37..2bd93659 100644
> --- a/src/acpi/boot/boot.c
> +++ b/src/acpi/boot/boot.c
> @@ -35,6 +35,10 @@ static int boot_init(fwts_framework *fw)
>  		fwts_log_error(fw, "Cannot read ACPI tables.");
>  		return FWTS_ERROR;
>  	}
> +	if (!access("/sys/firmware/efi", R_OK)) {
> +		fwts_log_error(fw, "ACPI BOOT table is depreciated on UEFI firmware, skipping test");
> +		return FWTS_SKIP;
> +	}
>  	if (table == NULL || (table && table->length == 0)) {
>  		fwts_log_error(fw, "ACPI BOOT table does not exist, skipping test");
>  		return FWTS_SKIP;
> 

Acked-by: Colin Ian King <colin.king@canonical.com>

Patch
diff mbox series

diff --git a/src/acpi/boot/boot.c b/src/acpi/boot/boot.c
index 081b8b37..2bd93659 100644
--- a/src/acpi/boot/boot.c
+++ b/src/acpi/boot/boot.c
@@ -35,6 +35,10 @@  static int boot_init(fwts_framework *fw)
 		fwts_log_error(fw, "Cannot read ACPI tables.");
 		return FWTS_ERROR;
 	}
+	if (!access("/sys/firmware/efi", R_OK)) {
+		fwts_log_error(fw, "ACPI BOOT table is depreciated on UEFI firmware, skipping test");
+		return FWTS_SKIP;
+	}
 	if (table == NULL || (table && table->length == 0)) {
 		fwts_log_error(fw, "ACPI BOOT table does not exist, skipping test");
 		return FWTS_SKIP;