WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@martacarbone
Copy link
Contributor

@martacarbone martacarbone commented Dec 15, 2025

Motivation

closes #44

Simple check: knowing the version of the image to be flashed on the board and the version of the image currently on the board, return if it is possible to preserve the user partition during the flash operation.

If one of the current version or target version is R0, return False.

Change description

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.

@mirkoCrobu mirkoCrobu requested a review from a team December 15, 2025 17:47
@mirkoCrobu mirkoCrobu added the enhancement New feature or request label Dec 15, 2025
@mirkoCrobu mirkoCrobu marked this pull request as ready for review December 16, 2025 08:21
@lucarin91 lucarin91 changed the base branch from main to issue_41_flasher_api December 16, 2025 08:29
// according to the current and target OS image versions.
//
// Preservation is supported if both versions are not the R0 image.
func IsUserPartitionPreservationSupported(conn remote.RemoteConn, targetImageVersion OSImageRelease) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make this a pure function; take current and target and returns if it is possible ot not to preserve user partition.

Suggested change
func IsUserPartitionPreservationSupported(conn remote.RemoteConn, targetImageVersion OSImageRelease) bool {
func IsUserPartitionPreservationSupported(current, target string) bool {

@mirkoCrobu
Copy link
Contributor

We don't have the approval requirement to squash and merge this PR?!

@lucarin91
Copy link
Contributor

We don't have the approval requirement to squash and merge this PR?!

@mirkoCrobu I would wait for this #157 first.

@lucarin91 lucarin91 changed the title Issue 44 flasher api feat(pkg/board): add IsUserPartitionPreservationSupported function Dec 16, 2025
@lucarin91 lucarin91 changed the title feat(pkg/board): add IsUserPartitionPreservationSupported function feat(pkg/boards): add IsUserPartitionPreservationSupported function Dec 16, 2025
Base automatically changed from issue_41_flasher_api to main December 16, 2025 11:01
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.

3 participants