diff options
| author | Simon Glass <[email protected]> | 2025-10-15 16:44:04 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-10-22 14:16:56 -0600 |
| commit | 396c9b59644081a05a8b078eadc2c4aead37160d (patch) | |
| tree | db0dccaedd78ccdf1cd357b24e1f268ecc435135 /boot | |
| parent | 8bc918ed97b4c79eecd56969a2898a8c75886c5a (diff) | |
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 <[email protected]>
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/bootflow.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c index 7ed076c898f..deb5f42ba65 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -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) |
