Message ID | 1550506917-25547-2-git-send-email-igor.opaniuk@linaro.org |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
Series | android: implement A/B boot process | expand |
Hi Igor, On Mon, Feb 18, 2019 at 06:21:51PM +0200, Igor Opaniuk wrote: > From: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> > > This sub-command serves for getting the partition index from > partition name. [..] > CMD_PART_INFO_SIZE, > + CMD_PART_INFO_NUMBER IMHO 's/number/index/' (when referring to the id of a partition) would make code and documentation more clear since 'number' can be confused with 'count' while 'index' is unequivocal. Feel free to ignore it though, as the terms seem to be intermixed in various places of Linux/U-Boot (my opinion still stands). The review comment also applies to other patches from this series: - https://patchwork.ozlabs.org/patch/1044153/ ("[U-Boot,v3,2/7] disk: part: Extend API to get partition info") - https://patchwork.ozlabs.org/patch/1044162/ ("[U-Boot,v3,6/7] doc: android: Add simple guide for A/B updates") - https://patchwork.ozlabs.org/patch/1044160/ ("[U-Boot,v3,7/7] env: am57xx: Implement A/B boot process") Best regards, Eugeniu.
Hi Eugeniu, On Mon, Mar 11, 2019 at 12:42 AM Eugeniu Rosca <roscaeugeniu@gmail.com> wrote: > > > Hi Igor, > > On Mon, Feb 18, 2019 at 06:21:51PM +0200, Igor Opaniuk wrote: > > From: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> > > > > This sub-command serves for getting the partition index from > > partition name. > > [..] > > > CMD_PART_INFO_SIZE, > > + CMD_PART_INFO_NUMBER > > IMHO 's/number/index/' (when referring to the id of a partition) would > make code and documentation more clear since 'number' can be confused > with 'count' while 'index' is unequivocal. > > Feel free to ignore it though, as the terms seem to be intermixed in > various places of Linux/U-Boot (my opinion still stands). Agree, will be fixed in v4. > The review comment also applies to other patches from this series: > - https://patchwork.ozlabs.org/patch/1044153/ ("[U-Boot,v3,2/7] disk: > part: Extend API to get partition info") > - https://patchwork.ozlabs.org/patch/1044162/ ("[U-Boot,v3,6/7] doc: > android: Add simple guide for A/B updates") > - https://patchwork.ozlabs.org/patch/1044160/ ("[U-Boot,v3,7/7] env: > am57xx: Implement A/B boot process") > > Best regards, > Eugeniu. > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > https://lists.denx.de/listinfo/u-boot
+ Roman On Thu, Mar 21, 2019 at 5:42 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote: > > Hi Eugeniu, > > > On Mon, Mar 11, 2019 at 12:42 AM Eugeniu Rosca <roscaeugeniu@gmail.com> wrote: > > > > > > Hi Igor, > > > > On Mon, Feb 18, 2019 at 06:21:51PM +0200, Igor Opaniuk wrote: > > > From: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> > > > > > > This sub-command serves for getting the partition index from > > > partition name. > > > > [..] > > > > > CMD_PART_INFO_SIZE, > > > + CMD_PART_INFO_NUMBER > > > > IMHO 's/number/index/' (when referring to the id of a partition) would > > make code and documentation more clear since 'number' can be confused > > with 'count' while 'index' is unequivocal. > > > > Feel free to ignore it though, as the terms seem to be intermixed in > > various places of Linux/U-Boot (my opinion still stands). > > Agree, will be fixed in v4. > > > The review comment also applies to other patches from this series: > > - https://patchwork.ozlabs.org/patch/1044153/ ("[U-Boot,v3,2/7] disk: > > part: Extend API to get partition info") > > - https://patchwork.ozlabs.org/patch/1044162/ ("[U-Boot,v3,6/7] doc: > > android: Add simple guide for A/B updates") > > - https://patchwork.ozlabs.org/patch/1044160/ ("[U-Boot,v3,7/7] env: > > am57xx: Implement A/B boot process") > > > > Best regards, > > Eugeniu. > > _______________________________________________ > > U-Boot mailing list > > U-Boot@lists.denx.de > > https://lists.denx.de/listinfo/u-boot -- Best regards - Freundliche Grüsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk@gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk
Are there any updates of this patch? We need this functionality to retrieve UUID of the partition using it's name. But there are lot of commands that supports only partition index as an argument, so I assume it could be very useful there. This command can be also used alone can be used to find root partition, e.g.: gpt index mmc 0 system system_index setenv bootargs="... root=/dev/mmcblk0p$system_index" On Mon, May 20, 2019 at 4:27 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote: > > + Roman > > > On Thu, Mar 21, 2019 at 5:42 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote: > > > > Hi Eugeniu, > > > > > > On Mon, Mar 11, 2019 at 12:42 AM Eugeniu Rosca <roscaeugeniu@gmail.com> wrote: > > > > > > > > > Hi Igor, > > > > > > On Mon, Feb 18, 2019 at 06:21:51PM +0200, Igor Opaniuk wrote: > > > > From: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> > > > > > > > > This sub-command serves for getting the partition index from > > > > partition name. > > > > > > [..] > > > > > > > CMD_PART_INFO_SIZE, > > > > + CMD_PART_INFO_NUMBER > > > > > > IMHO 's/number/index/' (when referring to the id of a partition) would > > > make code and documentation more clear since 'number' can be confused > > > with 'count' while 'index' is unequivocal. > > > > > > Feel free to ignore it though, as the terms seem to be intermixed in > > > various places of Linux/U-Boot (my opinion still stands). > > > > Agree, will be fixed in v4. > > > > > The review comment also applies to other patches from this series: > > > - https://patchwork.ozlabs.org/patch/1044153/ ("[U-Boot,v3,2/7] disk: > > > part: Extend API to get partition info") > > > - https://patchwork.ozlabs.org/patch/1044162/ ("[U-Boot,v3,6/7] doc: > > > android: Add simple guide for A/B updates") > > > - https://patchwork.ozlabs.org/patch/1044160/ ("[U-Boot,v3,7/7] env: > > > am57xx: Implement A/B boot process") > > > > > > Best regards, > > > Eugeniu. > > > _______________________________________________ > > > U-Boot mailing list > > > U-Boot@lists.denx.de > > > https://lists.denx.de/listinfo/u-boot > > > > -- > Best regards - Freundliche Grüsse - Meilleures salutations > > Igor Opaniuk > > mailto: igor.opaniuk@gmail.com > skype: igor.opanyuk > +380 (93) 836 40 67 > http://ua.linkedin.com/in/iopaniuk
diff --git a/cmd/part.c b/cmd/part.c index bfb6488..653e13c 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -24,6 +24,7 @@ enum cmd_part_info { CMD_PART_INFO_START = 0, CMD_PART_INFO_SIZE, + CMD_PART_INFO_NUMBER }; static int do_part_uuid(int argc, char * const argv[]) @@ -149,6 +150,9 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param) case CMD_PART_INFO_SIZE: snprintf(buf, sizeof(buf), LBAF, info.size); break; + case CMD_PART_INFO_NUMBER: + snprintf(buf, sizeof(buf), "%d", part); + break; default: printf("** Unknown cmd_part_info value: %d\n", param); return 1; @@ -172,6 +176,11 @@ static int do_part_size(int argc, char * const argv[]) return do_part_info(argc, argv, CMD_PART_INFO_SIZE); } +static int do_part_number(int argc, char * const argv[]) +{ + return do_part_info(argc, argv, CMD_PART_INFO_NUMBER); +} + static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) @@ -185,6 +194,8 @@ static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return do_part_start(argc - 2, argv + 2); else if (!strcmp(argv[1], "size")) return do_part_size(argc - 2, argv + 2); + else if (!strcmp(argv[1], "number")) + return do_part_number(argc - 2, argv + 2); return CMD_RET_USAGE; } @@ -206,5 +217,8 @@ U_BOOT_CMD( " part can be either partition number or partition name\n" "part size <interface> <dev> <part> <varname>\n" " - set environment variable to the size of the partition (in blocks)\n" - " part can be either partition number or partition name" + " part can be either partition number or partition name\n" + "part number <interface> <dev> <part> <varname>\n" + " - set environment variable to the partition number using the partition name\n" + " part must be specified as partition name" );