diff options
| author | Tom Rini <[email protected]> | 2023-07-18 09:55:32 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-07-18 09:55:32 -0400 |
| commit | 890233ca5569e5787d8407596a12b9fca80952bf (patch) | |
| tree | 966b9beb01a0ca57045bec4b4da2e16cb792757f /cmd | |
| parent | 13aa090b87a0fbdfe690011669b9fdb96bb1ccc7 (diff) | |
| parent | 4dc5e26242101f9090209e659e60422634c8bbcf (diff) | |
Merge branch '2023-07-17-assorted-updates'
- Merge in some Kconfig dependencies fixes, typo fixes, erofs update,
shell portability fix, an env save fix, better mbr+gpt support, and
some android A/B enhancements.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/ab_select.c | 20 | ||||
| -rw-r--r-- | cmd/mbr.c | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/cmd/ab_select.c b/cmd/ab_select.c index 3e46663d6ea..bfb67b8236b 100644 --- a/cmd/ab_select.c +++ b/cmd/ab_select.c @@ -16,10 +16,19 @@ static int do_ab_select(struct cmd_tbl *cmdtp, int flag, int argc, struct blk_desc *dev_desc; struct disk_partition part_info; char slot[2]; + bool dec_tries = true; - if (argc != 4) + if (argc < 4) return CMD_RET_USAGE; + for (int i = 4; i < argc; i++) { + if (strcmp(argv[i], "--no-dec") == 0) { + dec_tries = false; + } else { + return CMD_RET_USAGE; + } + } + /* Lookup the "misc" partition from argv[2] and argv[3] */ if (part_get_info_by_dev_and_name_or_num(argv[2], argv[3], &dev_desc, &part_info, @@ -27,7 +36,8 @@ static int do_ab_select(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; } - ret = ab_select_slot(dev_desc, &part_info); + + ret = ab_select_slot(dev_desc, &part_info, dec_tries); if (ret < 0) { printf("Android boot failed, error %d.\n", ret); return CMD_RET_FAILURE; @@ -41,9 +51,9 @@ static int do_ab_select(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } -U_BOOT_CMD(ab_select, 4, 0, do_ab_select, +U_BOOT_CMD(ab_select, 5, 0, do_ab_select, "Select the slot used to boot from and register the boot attempt.", - "<slot_var_name> <interface> <dev[:part|#part_name]>\n" + "<slot_var_name> <interface> <dev[:part|#part_name]> [--no-dec]\n" " - Load the slot metadata from the partition 'part' on\n" " device type 'interface' instance 'dev' and store the active\n" " slot in the 'slot_var_name' variable. This also updates the\n" @@ -53,4 +63,6 @@ U_BOOT_CMD(ab_select, 4, 0, do_ab_select, " - If 'part_name' is passed, preceded with a # instead of :, the\n" " partition name whose label is 'part_name' will be looked up in\n" " the partition table. This is commonly the \"misc\" partition.\n" + " - If '--no-dec' is set, the number of tries remaining will not\n" + " decremented for the selected boot slot\n" ); diff --git a/cmd/mbr.c b/cmd/mbr.c index c269833eb82..ec99b662834 100644 --- a/cmd/mbr.c +++ b/cmd/mbr.c @@ -244,7 +244,7 @@ static int do_verify_mbr(struct blk_desc *dev, const char *str) for (i = 0; i < count; i++) { struct disk_partition p; - if (part_get_info(dev, i + 1, &p)) + if (part_get_info_by_type(dev, i + 1, PART_TYPE_DOS, &p)) goto fail; if ((partitions[i].size && p.size != partitions[i].size) || |
