Skip to content
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

dataman KConfig for persistent storage #24412

Merged
merged 1 commit into from
Feb 26, 2025
Merged

dataman KConfig for persistent storage #24412

merged 1 commit into from
Feb 26, 2025

Conversation

alexcekay
Copy link
Member

@alexcekay alexcekay commented Feb 25, 2025

Solved Problem

Boards without (or with a very small) persistent storage will face unexpected problems, when a user configures dataman to use persistent storage. While such boards can set the parameter to a default value of RAM for storage it is still possible to start dataman manually with the -f option on such boards and face problems.

Solution

Use KConfig to select if dataman should support persistent storage. It is kept by default on y so the behavior does not change for all existing boards

Changelog Entry

For release notes:

Feature Option to configure if dataman should support persistent storage

Test coverage

Tested both options on the bench.
Info: This option is set to n for a downstream board, that we did not upstream yet.

@alexcekay alexcekay requested a review from niklaut February 25, 2025 10:27
@alexcekay alexcekay marked this pull request as ready for review February 25, 2025 13:08
@alexcekay alexcekay requested a review from dagar February 25, 2025 13:09
Copy link
Contributor

@niklaut niklaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, nice!

@alexcekay alexcekay merged commit 5d2814f into main Feb 26, 2025
62 checks passed
@alexcekay alexcekay deleted the pr-dataman-config branch February 26, 2025 11:48
@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 26, 2025

How does the system fail now when the user tries setting SYS_DM_BACKEND to default (SD card) with build that has DATAMAN_PERSISTENT_STORAGE=n?

@alexcekay
Copy link
Member Author

When SYS_DM_BACKEND is set to 0 (default (SD card)) the startup script executes the following:

if param compare SYS_DM_BACKEND 0
then
	# dataman start default
	dataman start
fi

So dataman is started without any specific settings. In the case of no persistent storage being supported and no explicit backend being given, the default backend will be RAM. So it will start with RAM as backend. When persistent storage is supported, the default backend is SD Card.

When explicitly trying to start the dataman with -f it will print a WARN that this option is not allowed and fall back to RAM, to avoid dataman not being started at all.

@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 26, 2025

So dataman is started without any specific settings. In the case of no persistent storage being supported and no explicit backend being given, the default backend will be RAM. So it will start with RAM as backend.

So the warning will not be there in that case? The parameter setting of default (SD card) will just not be applied? Should we remove he "SD card" string form the parameter option and just call it *default"?

@alexcekay
Copy link
Member Author

So the warning will not be there in that case? The parameter setting of default (SD card) will just not be applied?

Yes, this is the current behavior.

Should we remove he "SD card" string form the parameter option and just call it *default"?

This is one option. I originally wanted to change the parameter description based on KConfig, but this is not supported.
When just calling it "default" we should however document somewhere else what this actually means, i.e. that default is persistent storage, when the board supports it, otherwise RAM. I can add this to my list of things to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants