Skip to contentSkip to conversation

cmd: avb: Fix requested partitions list

PATCH New Sam Protsenko 3 participants 3 messages Aug 15, 2019 – Nov 1, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cmd: avb: Fix requested partitions list

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

---
Changes in v2:
- fix links in commit message (suggested by Eugeniu Rosca)

 cmd/avb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
cmd/avb.c +1 -5
index a8a95034ca..a4de5c40a2 100644
@@ -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;
Signature · 1 line
2.23.0.rc1
#1 lore raw

PATCH v2 1/1 cmd: avb: Fix requested partitions list

Hi Sam,

Quoted 46 lines · Sam Protsenko

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

---
Changes in v2:
- fix links in commit message (suggested by Eugeniu Rosca)

 cmd/avb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
cmd/avb.c +1 -6
index a8a95034ca..a4de5c40a2 100644
@@ -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;
--
Quoted 2 lines

2.23.0.rc1

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
#2 lore raw

PATCH v2 1/1 cmd: avb: Fix requested partitions list

In reply to Sam Protsenko
Quoted 9 lines · Sam Protsenko

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.

Quoted 5 lines

[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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191101/37e245a3/attachment.sig>