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

fix(flash): correct sector offset for sparse chunks #110

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

incognitojam
Copy link
Member

@incognitojam incognitojam commented Mar 19, 2025

Flashing sparse images don't have any test coverage and we don't have a method to read back images from the device yet

@@ -283,7 +283,7 @@ export class qdlDevice {
if (offset % gpt.sectorSize !== 0) {
throw "qdl - Offset not aligned to sector size";
}
const sector = (partition.start + BigInt(offset)) / BigInt(gpt.sectorSize);
const sector = partition.start + BigInt(offset / gpt.sectorSize);
Copy link
Member Author

Choose a reason for hiding this comment

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

There was a typo in the calculation for the sector to flash the chunk to, causing the wrong sectors to be overwritten

@incognitojam incognitojam merged commit 32841e0 into master Mar 19, 2025
8 checks passed
@incognitojam incognitojam deleted the fix-flash-sparse branch March 19, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant