boot: Keep track of which bootmeths have been used

Add a bitfield which tracks when bootmeths have been used. This will be
needed when global bootmeths can be used later in the iteration.

Fix a missing bootflow_free() while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-09-27 13:18:20 -06:00
parent 37cabfe0b1
commit 07326c0baf
4 changed files with 39 additions and 0 deletions

View File

@@ -199,6 +199,16 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global)
iter->doing_global = true;
iter->have_global = true;
}
/*
* check we don't exceed the maximum bits in methods_done when tracking
* which global bootmeths have run
*/
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && count > BOOTMETH_MAX_COUNT) {
free(order);
return log_msg_ret("tmb", -ENOSPC);
}
iter->method_order = order;
iter->num_methods = count;