diff mbox series

[1/1] avb2.0: add proper dependencies to libavb

Message ID 1531380864-23600-1-git-send-email-igor.opaniuk@linaro.org
State New
Headers show
Series [1/1] avb2.0: add proper dependencies to libavb | expand

Commit Message

Igor Opaniuk July 12, 2018, 7:34 a.m. UTC
Provide proper dependencies for LIBAVB: (FASTBOOT and !BLK):
1. CONFIG_FASTBOOT is needed, as fastboot buffer is re-used (which
is initially used in the fastboot protocol for downloads)
2. !CONFIG_BLK, as current implementation currently
doesn't support non-legacy block API.

Reported-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
---
 lib/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eugeniu Rosca July 12, 2018, 9:27 a.m. UTC | #1
Hi Igor,

Thanks for the fix. See my comments below.

On Thu, Jul 12, 2018 at 10:34:24AM +0300, Igor Opaniuk wrote:
> Provide proper dependencies for LIBAVB: (FASTBOOT and !BLK):
> 1. CONFIG_FASTBOOT is needed, as fastboot buffer is re-used (which
> is initially used in the fastboot protocol for downloads)
> 2. !CONFIG_BLK, as current implementation currently
> doesn't support non-legacy block API.
> 
> Reported-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
> ---
>  lib/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/Kconfig b/lib/Kconfig
> index a77bf1c..4780e7e 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -191,7 +191,7 @@ menu "Android Verified Boot"
>  
>  config LIBAVB
>  	bool "Android Verified Boot 2.0 support"
> -	depends on ANDROID_BOOT_IMAGE
> +	depends on ANDROID_BOOT_IMAGE && FASTBOOT && !BLK

Since libavb library alone is highly portable (it compiles fine with
several compilers), I'm not sure if's the best choice to make it
dependent on FASTBOOT (obviously it is not dependent on it). The
dependency is rather introduced by commit 3af30e4443aa ("avb2.0:
implement AVB ops"), which re-uses CONFIG_LIBAVB Kconfig symbol to wire
common/avb_verify.c to Kbuild.

So, unless you have some counter-proposal, I vote for adding a new
Kconfig symbol for common/avb_verify.c, which then can be marked as
dependent on FASTBOOT. This will also keep the hopes alive about
testing libavb on sandbox.

Thanks,
Eugeniu.
Igor Opaniuk July 12, 2018, 1:02 p.m. UTC | #2
Hi Eugeniu,

Makes sense, will re-send this patch soon with changes based on your
suggestions. Thanks

Regards,
Igor

On 12 July 2018 at 12:27, Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> Hi Igor,
>
> Thanks for the fix. See my comments below.
>
> On Thu, Jul 12, 2018 at 10:34:24AM +0300, Igor Opaniuk wrote:
>> Provide proper dependencies for LIBAVB: (FASTBOOT and !BLK):
>> 1. CONFIG_FASTBOOT is needed, as fastboot buffer is re-used (which
>> is initially used in the fastboot protocol for downloads)
>> 2. !CONFIG_BLK, as current implementation currently
>> doesn't support non-legacy block API.
>>
>> Reported-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
>> Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
>> ---
>>  lib/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/Kconfig b/lib/Kconfig
>> index a77bf1c..4780e7e 100644
>> --- a/lib/Kconfig
>> +++ b/lib/Kconfig
>> @@ -191,7 +191,7 @@ menu "Android Verified Boot"
>>
>>  config LIBAVB
>>       bool "Android Verified Boot 2.0 support"
>> -     depends on ANDROID_BOOT_IMAGE
>> +     depends on ANDROID_BOOT_IMAGE && FASTBOOT && !BLK
>
> Since libavb library alone is highly portable (it compiles fine with
> several compilers), I'm not sure if's the best choice to make it
> dependent on FASTBOOT (obviously it is not dependent on it). The
> dependency is rather introduced by commit 3af30e4443aa ("avb2.0:
> implement AVB ops"), which re-uses CONFIG_LIBAVB Kconfig symbol to wire
> common/avb_verify.c to Kbuild.
>
> So, unless you have some counter-proposal, I vote for adding a new
> Kconfig symbol for common/avb_verify.c, which then can be marked as
> dependent on FASTBOOT. This will also keep the hopes alive about
> testing libavb on sandbox.
>
> Thanks,
> Eugeniu.
diff mbox series

Patch

diff --git a/lib/Kconfig b/lib/Kconfig
index a77bf1c..4780e7e 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -191,7 +191,7 @@  menu "Android Verified Boot"
 
 config LIBAVB
 	bool "Android Verified Boot 2.0 support"
-	depends on ANDROID_BOOT_IMAGE
+	depends on ANDROID_BOOT_IMAGE && FASTBOOT && !BLK
 	default n
 	help
 	  This enables support of Android Verified Boot 2.0 which can be used