boot: Try all bootmeths on the final partition

At present, normally when one bootmeth fails on a partition, we move on
and try the next bootmeth. However, this was not the case for the final
partition due to a bug. Rework the logic so that all partitions are
treated the same.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-22 14:16:56 -06:00
committed by Tom Rini
parent 8bc918ed97
commit 396c9b5964
+16 -18
View File
@@ -221,27 +221,25 @@ static int iter_incr(struct bootflow_iter *iter)
if (iter->err == BF_NO_MORE_DEVICES)
return BF_NO_MORE_DEVICES;
if (iter->err != BF_NO_MORE_PARTS) {
/* Get the next boothmethod */
if (++iter->cur_method < iter->num_methods) {
iter->method = iter->method_order[iter->cur_method];
return 0;
}
/* Get the next boothmethod */
if (++iter->cur_method < iter->num_methods) {
iter->method = iter->method_order[iter->cur_method];
return 0;
}
/*
* If we have finished scanning the global bootmeths, start the
* normal bootdev scan
*/
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && global) {
iter->num_methods = iter->first_glob_method;
iter->doing_global = false;
/*
* If we have finished scanning the global bootmeths, start the
* normal bootdev scan
* Don't move to the next dev as we haven't tried this
* one yet!
*/
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && global) {
iter->num_methods = iter->first_glob_method;
iter->doing_global = false;
/*
* Don't move to the next dev as we haven't tried this
* one yet!
*/
inc_dev = false;
}
inc_dev = false;
}
if (iter->flags & BOOTFLOWIF_SINGLE_PARTITION)