kaitai_struct_formats
kaitai_struct_formats copied to clipboard
SquashFS superblock
https://github.com/AgentD/squashfs-tools-ng/blob/master/doc/format.txt
The superblock is parsed till the end, but lacks details.
@KOLANICH while all the comments are valid, the problem I stuck with is how to make sure that this field is parsed as unix timestamp?
Feel free to rewrite the history and squash the commits into 1 commit, BTW. I don't insist on preserving my authorshiip in such a small change.
the problem I stuck with is how to make sure that this field is parsed as unix timestamp?
What do you mean? A Unix timestamp is just a count of ticks, a number. KS doesn't convert timestamps into calendar time.
@KOLANICH I mean that it is not visible that the field is unix timestamp, and as a result, the generated code will have to figure out how to deal with format conversion itself.
BTW, why not just squashfs
in the sense that it is expected that the rest of gonna be added later?
@KOLANICH because I am not sure when there will be next time to add the rest.
@abitrolly, once the spec is published by the name, it is not easy to change it
@KOLANICH git mv squashfs_superblock.ksy squashfs.ksy
?
@abitrolly, I guess, yes.
Anything standing by to get this merged?
As a general remark: there are many variants of SquashFS that were made by different vendors over the years. Some of these have different headers (example: DD-WRT uses 'hsqt' as a header), others have the same headers as official squashfs but miss essential parts of for example the superblock. I would actually advise against trying to include those :-)
I have used this PR as a base for a plain java squashfs reader.
I will create a PR as soon as I have a stable format. If anyone is interested in having a look, the format is currently located here: https://github.com/tisoft/jsquashfs/blob/main/src/main/kaitai/squashfs.ksy
@tisoft that's awesome. Would be nice to get this finished by someone, because I am unlikely to get back to it as I don't need to solve the original problem - comparing .snap
packages for debugging.
I have added my extensions this PR in #596. I'm open to comments there. 😄