mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bootchooser: export bootchooser_entry_boot function
@ 2024-11-14 14:20 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2024-11-14 14:20 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-14 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-14 14:20 [PATCH] bootchooser: export bootchooser_entry_boot function Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox