Patchwork [2/2] securebootcert: need to check the efivars interface existence while checking the variable db and kek

login
register
mail settings
Submitter Ivan Hu
Date May 16, 2013, 8:35 a.m.
Message ID <1368693307-19633-1-git-send-email-ivan.hu@canonical.com>
Download mbox | patch
Permalink /patch/244244/
State Accepted
Headers show

Comments

Ivan Hu - May 16, 2013, 8:35 a.m.
Checking the variable db and kek needs the efivars interface, not var interface.
Adding the checking the efivars interface existence for skipping the test instead of giving fails.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/securebootcert/securebootcert.c |    5 +++++
 1 file changed, 5 insertions(+)
Colin King - May 16, 2013, 9:34 a.m.
On 16/05/13 09:35, Ivan Hu wrote:
> Checking the variable db and kek needs the efivars interface, not var interface.
> Adding the checking the efivars interface existence for skipping the test instead of giving fails.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/securebootcert/securebootcert.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/uefi/securebootcert/securebootcert.c b/src/uefi/securebootcert/securebootcert.c
> index 8325a5d..4baf3a9 100644
> --- a/src/uefi/securebootcert/securebootcert.c
> +++ b/src/uefi/securebootcert/securebootcert.c
> @@ -330,6 +330,11 @@ static int securebootcert_init(fwts_framework *fw)
>  		return FWTS_ABORTED;
>  	}
>  
> +	if (!fwts_uefi_efivars_iface_exist()) {
> +		fwts_log_info(fw, "Cannot detect efivars interface. Aborted.");
> +		return FWTS_ABORTED;
> +	}
> +
>  	return FWTS_OK;
>  }
>  
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung - May 21, 2013, 6:02 a.m.
On 05/16/2013 04:35 PM, Ivan Hu wrote:
> Checking the variable db and kek needs the efivars interface, not var interface.
> Adding the checking the efivars interface existence for skipping the test instead of giving fails.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/securebootcert/securebootcert.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/uefi/securebootcert/securebootcert.c b/src/uefi/securebootcert/securebootcert.c
> index 8325a5d..4baf3a9 100644
> --- a/src/uefi/securebootcert/securebootcert.c
> +++ b/src/uefi/securebootcert/securebootcert.c
> @@ -330,6 +330,11 @@ static int securebootcert_init(fwts_framework *fw)
>   		return FWTS_ABORTED;
>   	}
>
> +	if (!fwts_uefi_efivars_iface_exist()) {
> +		fwts_log_info(fw, "Cannot detect efivars interface. Aborted.");
> +		return FWTS_ABORTED;
> +	}
> +
>   	return FWTS_OK;
>   }
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/uefi/securebootcert/securebootcert.c b/src/uefi/securebootcert/securebootcert.c
index 8325a5d..4baf3a9 100644
--- a/src/uefi/securebootcert/securebootcert.c
+++ b/src/uefi/securebootcert/securebootcert.c
@@ -330,6 +330,11 @@  static int securebootcert_init(fwts_framework *fw)
 		return FWTS_ABORTED;
 	}
 
+	if (!fwts_uefi_efivars_iface_exist()) {
+		fwts_log_info(fw, "Cannot detect efivars interface. Aborted.");
+		return FWTS_ABORTED;
+	}
+
 	return FWTS_OK;
 }