kaitai_struct_formats icon indicating copy to clipboard operation
kaitai_struct_formats copied to clipboard

SquashFS superblock

Open abitrolly opened this issue 4 years ago • 15 comments

https://github.com/AgentD/squashfs-tools-ng/blob/master/doc/format.txt

abitrolly avatar Aug 05 '20 03:08 abitrolly

The superblock is parsed till the end, but lacks details.

abitrolly avatar Aug 05 '20 03:08 abitrolly

@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?

image

abitrolly avatar Aug 05 '20 07:08 abitrolly

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.

KOLANICH avatar Aug 05 '20 08:08 KOLANICH

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 avatar Aug 05 '20 08:08 KOLANICH

@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.

abitrolly avatar Aug 05 '20 09:08 abitrolly

BTW, why not just squashfs in the sense that it is expected that the rest of gonna be added later?

KOLANICH avatar Aug 05 '20 20:08 KOLANICH

@KOLANICH because I am not sure when there will be next time to add the rest.

abitrolly avatar Aug 06 '20 00:08 abitrolly

@abitrolly, once the spec is published by the name, it is not easy to change it

KOLANICH avatar Aug 06 '20 06:08 KOLANICH

@KOLANICH git mv squashfs_superblock.ksy squashfs.ksy?

abitrolly avatar Aug 06 '20 10:08 abitrolly

@abitrolly, I guess, yes.

KOLANICH avatar Aug 06 '20 20:08 KOLANICH

Anything standing by to get this merged?

abitrolly avatar Aug 20 '20 19:08 abitrolly

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 :-)

armijnhemel avatar Mar 14 '21 21:03 armijnhemel

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 avatar Mar 31 '22 15:03 tisoft

@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.

abitrolly avatar Mar 31 '22 17:03 abitrolly

I have added my extensions this PR in #596. I'm open to comments there. 😄

tisoft avatar Apr 03 '22 13:04 tisoft