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

file: Support reading EFI zboot images #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hexchain
Copy link

This type of image is generated when the kernel has CONFIG_EFI_ZBOOT enabled.

Comment on lines 237 to 239
image = f.read(size)

return self.read_version_from_raw(io.BytesIO(image))
Copy link
Member

Choose a reason for hiding this comment

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

Any reason you're prereading it, rather than calling self.read_version_from_raw on the seeked file?

Copy link
Author

@hexchain hexchain Sep 21, 2024

Choose a reason for hiding this comment

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

gzip.decompress throws when it tries to read past the end of the payload.

Copy link
Member

Choose a reason for hiding this comment

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

Can we instead modify read_version_from_raw() and related functions to take an optional size?

@mgorny
Copy link
Member

mgorny commented Sep 21, 2024

Oh, and we're going to need a test for this file format.

@hexchain
Copy link
Author

All done.

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.

2 participants