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

Added algorithm to auto-parse .bmap 2.0 files and write accordingly #320

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

kergos
Copy link

@kergos kergos commented Aug 11, 2023

This update addresses issue #15.

Since the class BmapBdevCopy from the bmaptools package expects a file stream to work properly and in this implementation we work with chunks of data, a custom algorithm for writing bmap 2.0 images is created.

In client.py a bmap file in the same folder as the image supplied with mtda-cli storage write image.wic is searched. If there is no .bmap or the parsing of the .bmap file goes wrong, the image is written just like before. The algorithm was tested with 2 different images with holes. Each currently supported format (raw, bz, gz, xz and zst) was used for both of them and successfully flashed to a storage.

Credits go also to @fmoessbauer for supporting this endeavor.

@chombourger
Copy link
Collaborator

Kudos to both of you for implementing this very much desired feature

@kergos
Copy link
Author

kergos commented Aug 11, 2023

I forgot about the code formatting guidelines... sorry.
I will fix it up on Monday and issue another pull request.

@kergos kergos closed this Aug 11, 2023
@kergos kergos reopened this Aug 11, 2023
@chombourger chombourger removed the check label Aug 11, 2023
@chombourger
Copy link
Collaborator

No worries, we have these CI checks to catch such minor issues 😀

@chombourger
Copy link
Collaborator

Please make sure to squash your 2 commits together (we'd like to avoid having a first commit and a second commit fixing the first)

mtda/main.py Outdated Show resolved Hide resolved
In `client.py` a bmap file in the same folder as the image supplied with `mtda-cli storage write image.wic` is searched.
If there is no .bmap  or the parsing of the .bmap file goes wrong,
the image is written just like before. The algorithm was tested with 2 different images with holes.
Each currently supported format (raw, bz, gz, xz and zst) was tested for both of them and successfully flashed to a storage.

Signed-off-by: Manuel Josef Matzinger <[email protected]>
@chombourger
Copy link
Collaborator

Looks good to me

@chombourger chombourger merged commit 01d7ef9 into siemens:master Aug 14, 2023
7 checks passed
@chombourger chombourger added this to the 0.21 milestone Aug 14, 2023
@kergos kergos deleted the add-bmap2.0-functionality branch August 14, 2023 08:11
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.

2 participants