-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kernel: banner: Allow for external boot banner #72400
Conversation
Makes the boot banner function weak, this resolves an issue when building with llext enabled which uses different build options than a normal zephyr build Upstream PR: zephyrproject-rtos/zephyr#72400 Signed-off-by: Jamie McCrae <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works on-target.
do not like this approach of adding weak symbols so that can be impemented somewhere else. Basically what this mean is an introduction of an adhoc interface or API. We have been trying to minimize the use of weak symbols, because of how unreliable they are when multiple symbols are defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular complaint about weak symbols, I think they're a fine tool in the right contexts.
But here? I mean, we already allow the banner to be configured. We already allow the banner to be disabled. We already allow apps to register early SYS_INIT() hooks to print their own banners[1] in any way they want.
What's the value in adding another dial to an already complicated whizgig? Who needs this? Frankly I'd argue that the only real value to a banner is that it's "standard" and can be reliably used to identify Zephyr apps across platforms and versions.
Not worth a -1. But I guess maybe I'm saying I'd prefer to see features removed from this area vs. added.
[1] Even before the official one. Ours is actually quite late in the startup sequence; it happens out of the main thread after all the kernel init is already done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MCUboot has had a custom boot banner added which replaces the zephyr one
If so, why would you not just set CONFIG_BOOT_BANNER=n
and let MCUboot do its thing?
If someone wants a boot banner, it makes sense to use a single option, if people have existing applications then updating zephyr would have no impact for them, if they have the boot banner off for their build then nothing will change, adding a new option then means suddenly everyone has it enabled. I don't see the point in having multiple options for the same thing, and what if someone enables them both, the output would just be weird.
So would you be opposed to having this defined as an API with a Kconfig to suppress the output so that applications can provide their own function? |
Makes the boot banner function weak, this resolves an issue when building with llext enabled which uses different build options than a normal zephyr build Upstream PR: zephyrproject-rtos/zephyr#72400 Signed-off-by: Jamie McCrae <[email protected]>
I have added a banner API and adjusted MCUboot to use this |
Adds a new Kconfig CONFIG_BOOT_BANNER_EXTERNAL_IMPLEMENTATION which allows for applications/modules to implement their own boot banner Signed-off-by: Jamie McCrae <[email protected]>
Update Zephyr fork of MCUboot to revision: TODO Brings following Zephyr relevant fixes: - 3240371d zephyr: Update boot banner implementation Signed-off-by: Jamie McCrae <[email protected]>
Adds release notes on the new external boot banner functionality Signed-off-by: Jamie McCrae <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still think this is sort of silly, given that a printk() out of a SYS_INIT() hook is absolutely isomorphic to a BOOT_BANNER_EXTERNAL_IMPLEMENTATION.
But no -1, this is obviously harmless. I'm going to remove myself from the bikeshed now. :)
one could also do it without all the changes to zephyr...
resulting in:
|
This is pretty much what we do for our downstream applications. |
Except that doesn't work for this usecase as mentioned earlier:
|
hmm, I am not sure I understand the usecase here. The code is not adding any options, the app will decide what it wants to print regardless of any options related to boot banner coming from zephyr. |
Allowing it to be controlled using the same existing Kconfig, e.g.:
Instead of adding a new Kconfig, and this disables the normal boot banner output because it includes a modified version of it in the output:
You can't have a Kconfig de-select something, so the only way to add another one would be to have |
MCUBOOT_BOOT_BANNER can then control the custom banner you can introduce in mcuboot using something similar to what I have in my example. You do not need to use the zephyr built-in banner |
As said above:
And this makes things worse because then everyone out of tree that is using MCUboot that has set |
Architecture WG:
|
@@ -427,7 +425,10 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3) | |||
#if defined(CONFIG_STACK_POINTER_RANDOM) && (CONFIG_STACK_POINTER_RANDOM != 0) | |||
z_stack_adjust_initialized = 1; | |||
#endif /* CONFIG_STACK_POINTER_RANDOM */ | |||
|
|||
#if defined(CONFIG_BOOT_BANNER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boot_banner
should also run when CONFIG_BOOT_BANNER=n
to handle the delayed boot option which does not depend on the boot banner.
Makes the boot banner function weak, this resolves an issue when building with llext enabled which uses different build options than a normal zephyr build Upstream PR: zephyrproject-rtos/zephyr#72400 Signed-off-by: Jamie McCrae <[email protected]> (cherry picked from commit d22aede)
Also includes fix for MCUboot
Background:
MCUboot has had a custom boot banner added which replaces the zephyr one to include information on the MCUboot build, with a normal zephyr build this works fine due to the linker dropping the original function and using the one that MCUboot has, but with llext enabled in the build, the build fails because the function is defined multiple times. This resolves the issue by making the zephyr one weak which allows for applications to replace it with an alternative implementation