diff mbox series

[U-Boot,v2] cmd: avb: Fix requested partitions list

Message ID 20190815174947.4316-1-semen.protsenko@linaro.org
State Accepted
Commit bb43c2784704b79eaa383fe38255b2ecf73b46ff
Delegated to: Tom Rini
Headers show
Series [U-Boot,v2] cmd: avb: Fix requested partitions list | expand

Commit Message

Sam Protsenko Aug. 15, 2019, 5:49 p.m. UTC
The requested_partitions[] array should contain only boot partitions.
Usually it's only 'boot' partition, as can be seen in [1]. Also, seems
like the requested_partitions[] are only used when there is no 'vbmeta'
partition [2], which is not a regular use-case.

Make requested_partitions[] contain only 'boot' partition as it was
supposed to be, and also make that array to be a local in
do_avb_verify_part() function, as nobody else needs that.

[1] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/test/avb_slot_verify_unittest.cc#108
[2] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/libavb/avb_slot_verify.c#1461

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
Changes in v2:
  - fix links in commit message (suggested by Eugeniu Rosca)

 cmd/avb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Igor Opaniuk Oct. 16, 2019, 9:38 a.m. UTC | #1
Hi Sam,

On Thu, Aug 15, 2019 at 8:49 PM Sam Protsenko
<semen.protsenko@linaro.org> wrote:
>
> The requested_partitions[] array should contain only boot partitions.
> Usually it's only 'boot' partition, as can be seen in [1]. Also, seems
> like the requested_partitions[] are only used when there is no 'vbmeta'
> partition [2], which is not a regular use-case.
>
> Make requested_partitions[] contain only 'boot' partition as it was
> supposed to be, and also make that array to be a local in
> do_avb_verify_part() function, as nobody else needs that.
>
> [1] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/test/avb_slot_verify_unittest.cc#108
> [2] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/libavb/avb_slot_verify.c#1461
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
> Changes in v2:
>   - fix links in commit message (suggested by Eugeniu Rosca)
>
>  cmd/avb.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/cmd/avb.c b/cmd/avb.c
> index a8a95034ca..a4de5c40a2 100644
> --- a/cmd/avb.c
> +++ b/cmd/avb.c
> @@ -15,11 +15,6 @@
>  #define AVB_BOOTARGS   "avb_bootargs"
>  static struct AvbOps *avb_ops;
>
> -static const char * const requested_partitions[] = {"boot",
> -                                            "system",
> -                                            "vendor",
> -                                            NULL};
> -
>  int do_avb_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  {
>         unsigned long mmc_dev;
> @@ -232,6 +227,7 @@ int do_avb_get_uuid(cmd_tbl_t *cmdtp, int flag,
>  int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,
>                        int argc, char *const argv[])
>  {
> +       const char * const requested_partitions[] = {"boot", NULL};
>         AvbSlotVerifyResult slot_result;
>         AvbSlotVerifyData *out_data;
>         char *cmdline;
> --
> 2.23.0.rc1
>

Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Tom Rini Nov. 1, 2019, 1:29 p.m. UTC | #2
On Thu, Aug 15, 2019 at 08:49:47PM +0300, Sam Protsenko wrote:

> The requested_partitions[] array should contain only boot partitions.
> Usually it's only 'boot' partition, as can be seen in [1]. Also, seems
> like the requested_partitions[] are only used when there is no 'vbmeta'
> partition [2], which is not a regular use-case.
> 
> Make requested_partitions[] contain only 'boot' partition as it was
> supposed to be, and also make that array to be a local in
> do_avb_verify_part() function, as nobody else needs that.
> 
> [1] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/test/avb_slot_verify_unittest.cc#108
> [2] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/libavb/avb_slot_verify.c#1461
> 
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/cmd/avb.c b/cmd/avb.c
index a8a95034ca..a4de5c40a2 100644
--- a/cmd/avb.c
+++ b/cmd/avb.c
@@ -15,11 +15,6 @@ 
 #define AVB_BOOTARGS	"avb_bootargs"
 static struct AvbOps *avb_ops;
 
-static const char * const requested_partitions[] = {"boot",
-					     "system",
-					     "vendor",
-					     NULL};
-
 int do_avb_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long mmc_dev;
@@ -232,6 +227,7 @@  int do_avb_get_uuid(cmd_tbl_t *cmdtp, int flag,
 int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,
 		       int argc, char *const argv[])
 {
+	const char * const requested_partitions[] = {"boot", NULL};
 	AvbSlotVerifyResult slot_result;
 	AvbSlotVerifyData *out_data;
 	char *cmdline;