* [PATCH] bootchooser: export bootchooser_entry_boot function
@ 2024-11-14 14:20 Ahmad Fatoum
2024-11-25 10:28 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [PATCH] bootchooser: export bootchooser_entry_boot function
2024-11-14 14:20 [PATCH] bootchooser: export bootchooser_entry_boot function Ahmad Fatoum
@ 2024-11-25 10:28 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-11-25 10:28 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Thu, 14 Nov 2024 15:20:16 +0100, Ahmad Fatoum wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] bootchooser: export bootchooser_entry_boot function
https://git.pengutronix.de/cgit/barebox/commit/?id=c52cb8fb5710 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-25 10:28 UTC | newest]
Thread overview: 2+ messages (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
2024-11-25 10:28 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox