[PATCH] bootchooser: export bootchooser_entry_boot function

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Nov 14 06:20:16 PST 2024


When migrating a board to use bootchooser instead of a custom boot
handler, it can be useful to add an intermediate boot target that
decides whether to use bootchooser or the old boot target it replaces.

Make expressing this straight-forward in C by exporting
bootchooser_entry_boot(), so it can be called from the intermediate boot
target's struct bootentry::boot function.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/bootchooser.c  | 2 +-
 include/bootchooser.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/bootchooser.c b/common/bootchooser.c
index 65291c5e59d3..5df7ff764db8 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -868,7 +868,7 @@ int bootchooser_boot(struct bootchooser *bc)
 	return ret;
 }
 
-static int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun)
+int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun)
 {
 	struct bootchooser *bc;
 	int ret;
diff --git a/include/bootchooser.h b/include/bootchooser.h
index 2cfd5b126ab9..31989163b236 100644
--- a/include/bootchooser.h
+++ b/include/bootchooser.h
@@ -31,6 +31,8 @@ struct bootchooser_target *bootchooser_target_first(struct bootchooser *bootchoo
 struct bootchooser_target *bootchooser_target_next(struct bootchooser *bootchooser,
 					       struct bootchooser_target *cur);
 
+int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun);
+
 #define bootchooser_for_each_target(bootchooser, target) \
 	for (target = bootchooser_target_first(bootchooser); target; \
 	     target = bootchooser_target_next(bootchooser, target))
-- 
2.39.5




More information about the barebox mailing list