-
-
Notifications
You must be signed in to change notification settings - Fork 11
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 zstd decompressor since initrd has no content size header #12
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
=======================================
Coverage 84.42% 84.42%
=======================================
Files 16 16
Lines 745 745
=======================================
Hits 629 629
Misses 116 116
Continue to review full report at Codecov.
|
ecleankernel/file.py
Outdated
@@ -123,7 +123,8 @@ def decompress_raw(self) -> bytes: | |||
# Technically a redundant import, this is just | |||
# to make your IDE happy :) | |||
import zstandard | |||
return zstandard.ZstdDecompressor().decompress(f.read()) | |||
return zstandard.ZstdDecompressor().decompress( | |||
f.read(), 200*1024*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this 200M, though?
yes, yes it is - somehow managed to pick the wrong commit, don't rebase at night! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I've missed your update and I have completely forgotten about this. Could you take a look at this last comment. I'll be happy to merge it afterwards.
Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
It seems the kernel image and/or initrd may not include content size when compressed with zstd - switch to the zstd stream reader and read in chunks of 1MB until EOF
See the section above https://pypi.org/project/zstandard/ - Stream Reader API for details