-
Notifications
You must be signed in to change notification settings - Fork 210
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
Squashfs #596
base: master
Are you sure you want to change the base?
Squashfs #596
Conversation
Co-authored-by: Petr Pučil <[email protected]>
This reflects the field size in spec as agreed in review comments .
Co-authored-by: Petr Pučil <[email protected]>
Not all inode types are implemented yet, but the most used basic_file, basic_directory and extended_fil) are implemented. The other types shouldn't be a big problem. Export and xattrs tables are not yet implemented. SquashFS uses compressed metadata blocks. To fully support the format, it is needed to uncompress those blocks and parse the resulting bytes. Currently a custom decompress function is used for this. This could probably be replaced with kaitai.compress functions. Unfortunately it is possible for inodes in the inode table to span 2 metablocks. That is why currently a custom concat function is needed, that concatenates the uncompressed bytes from a list of metadata blocks. This format is currently very memory intensive. The real SquashFS implementations use caching to only have those metablocks in memory, that are currently needed. I couldn't find a good solution for that in kaitai. The custom compression function also allows to automatically pad the resulting byte array with 0x00. This is used for sparse files in SquashFS. It is only needed in data blocks, so it is not needed for parsing the metadata. It could be removed from the format and could be handled any the calling application. For now I included it, to have a "complete" format. |
Co-authored-by: Petr Pučil <[email protected]>
fixed kaitai compiler warnings added extended file support fixed data block count calculation
Added support for the SquashFS filesystem.
Based on the SqashFS Superblock from @abitrolly from #308.
Sample application using this structure: https://github.com/tisoft/jsquashfs
Replaces #308