Add Squashfs support for LZMA Magic Numbers

2013-08-03
2013-08-03
  • Ahmad Hazimeh
    Ahmad Hazimeh
    2013-08-03

    Squashfs devs already made patches for adding qshs and shsq magic numbers support with LZMA.
    https://sourceforge.net/p/squashfs/patches/20/
    It would be nice to apply them to 7-zip as well.
    Do you think it's applicable?

    Off topic: Could there be a way by which Squashfs can be modifiable as well? I'm having trouble rebuilding with mksquashfs, even when setting it to use the magic number the original file was compiled with.
    I'm trying to edit a file in a router firmware:
    http://downloads.linksys.com/downloads/firmware/WAG320N-EU-ANNEXA-ETSI-1.00.12,0.zip
    I used the 'dd' command to copy the squashfs + lzma portion of the file:
    http://www.mediafire.com/?jmp23zhr8rnt1j3

    I applied the patch above, edited the mksquashfs.c file, line 5287, and replaced SQUASHFS_MAGIC with SQUASHFS_MAGIC_LZMA_SWAP and compiled it (I tried the SQUASHFS_MAGIC_LZMA, but the output file was the exact opposite of what I expected).
    When I ran mksquashfs with the proper settings, it gave a file with the destined LZMA magic number, but its "structure", as revealed by binwalk, was totally different than that of the unmodified filesystem.

    Hence, if you could add squashfs read\write functionality, with magic number support, to 7-zip, such that it rebuilds the filesystem with the exact settings, you'd do us a great favor (since a majority of WAG320N owners suffer from its lack of customization).

    Thanks,
    Ahmad

     
  • Igor Pavlov
    Igor Pavlov
    2013-08-03

    I changed Squashfs code for new version already.
    If next alpha version of 7-zip will not support some Squashfs archives, please write here again.