Skip to content

Conversation

@MatteoPologruto
Copy link
Contributor

@MatteoPologruto MatteoPologruto commented Nov 17, 2025

Motivation

Add a flag to the flash command to allow the user to preserve the home partition

Change description

Add a flag to the flash command to allow the user to preserve the home partition. The flasher will check if both the image currently on the board and the one to be flasher support user partition preservation (so they are not a R0 image).

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@MatteoPologruto MatteoPologruto self-assigned this Nov 17, 2025
@MatteoPologruto MatteoPologruto added the enhancement New feature or request label Nov 17, 2025
@MatteoPologruto MatteoPologruto linked an issue Nov 27, 2025 that may be closed by this pull request
@MatteoPologruto MatteoPologruto marked this pull request as ready for review December 10, 2025 13:00
@MatteoPologruto MatteoPologruto requested a review from a team December 10, 2025 13:00
@Xayton
Copy link
Contributor

Xayton commented Dec 10, 2025

Could you please fix conflicts and provide a test build?

Copy link
Contributor

@Xayton Xayton left a comment

Choose a reason for hiding this comment

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

I have tested it, and user's data was preserved correctly.

return nil
}

func checkBoardGPTTable(ctx context.Context, qdlPath, flashDir *paths.Path) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of a method returning it's output (or string message) just by returning an error. But this can be fine.

At least, add a small comment to the function, explaining why we are checking the GPT and why this is the way we use to know if the board supports preserving user's data or not.

Suggested change
func checkBoardGPTTable(ctx context.Context, qdlPath, flashDir *paths.Path) error {
// Checks the board GPT table and counts the number of partitions, this tells if the board supports preserving or not user's data.
func checkBoardGPTTable(ctx context.Context, qdlPath, flashDir *paths.Path) error {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add option to preserve user partition

2 participants