bootstd: support scanning a single partition

The "bootflow" command currently doesn't support scanning a single
partition. This is inconvenient in setups with multiple bootable
partitions within a single disk, but only one is desired.

Support scanning a single disk partition. Specifically, support the
syntax:
	bootflow scan mmc1:4
which scans only mmc device 1, partition 4.

Signed-off-by: Nam Cao <namcao@linutronix.de>
This commit is contained in:
Nam Cao 2024-02-21 13:41:44 +01:00 committed by Tom Rini
parent c15d73d189
commit 1132471405
4 changed files with 43 additions and 2 deletions

View file

@ -217,6 +217,9 @@ static int iter_incr(struct bootflow_iter *iter)
}
}
if (iter->flags & BOOTFLOWIF_SINGLE_PARTITION)
return BF_NO_MORE_DEVICES;
/* No more bootmeths; start at the first one, and... */
iter->cur_method = 0;
iter->method = iter->method_order[iter->cur_method];