-
Notifications
You must be signed in to change notification settings - Fork 766
zephyr: Add a bool Kconfig option for swap move #1352
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
Conversation
The Kconfig system used by Zephyr does not allow the defaults for choice options to be overridden. To compensate for this, create a new boolean config option that will determine what the default is for the boot mode. This allows the kconfig override file for various Zephyr boards to change the default to swap move. Signed-off-by: David Brown <[email protected]>
Making this a draft for additional integration testing with Zephyr. |
I think this should be benign until other changes are made in Zephyr, so it'd be nice to get this in, so we can work toward getting Zephyr transitioned to using it. |
For named choice (like that one you modified) you can modify it using additional Kconfig. Although override a choice might be unproductive for this particular need. |
I'd be open to suggestions on how to make this work, but what you've suggested definitely doesn't work when used in a Kconfig.defconfig file. It is stated in the Kconfig documentation that this is a limitation. |
@@ -194,10 +194,21 @@ config BOOT_VALIDATE_SLOT0_ONCE | |||
low end devices with as a compromise lowering the security level. | |||
If unsure, leave at the default value. | |||
|
|||
config BOOT_PREFER_SWAP_MOVE |
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.
I would name this option with prefix MCUBOOT instead of BOOT - reason is that this will be used from boards defconfig files in zephyr, this would be right visible that it is for MCUBOOT.
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.
@d3zd3z One nit ^^
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.
Hmm, it makes it different than the rest of the options, but I can certainly do it that way if that makes it clearer.
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.
Thinking more about this. I don't think it makes sense to add an MCUBOOT prefix to this, unless we change all of the rest of the options as well. This is the Zephyr config file, and any of these will be showing up in board defconfigs.
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.
okay, I won't insist
@@ -194,10 +194,21 @@ config BOOT_VALIDATE_SLOT0_ONCE | |||
low end devices with as a compromise lowering the security level. | |||
If unsure, leave at the default value. | |||
|
|||
config BOOT_PREFER_SWAP_MOVE |
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.
okay, I won't insist
The Kconfig system used by Zephyr does not allow the defaults for choice
options to be overridden. To compensate for this, create a new boolean
config option that will determine what the default is for the boot mode.
This allows the kconfig override file for various Zephyr boards to
change the default to swap move.
Signed-off-by: David Brown [email protected]