├── README.md ├── build.sh └── patches ├── README.md └── patch0.txt /README.md: -------------------------------------------------------------------------------- 1 | About 2 | ========= 3 | 4 | The `sasquatch` project is a set of patches to the standard unsquashfs utility (part of squashfs-tools) that attempts to add support for as many hacked-up vendor-specific SquashFS implementations as possible. 5 | 6 | If the vendor has done something simple like just muck a bit with the header fields, `sasquatch` should sort it out. 7 | 8 | If the vendor has made changes to the underlying LZMA compression options, or to how these options are stored in the compressed data blocks, `sasquatch` will attempt to automatically resolve such customizations via a brute-force method. 9 | 10 | Additional advanced command line options have been added for testing/debugging. 11 | 12 | Very beta. 13 | 14 | Prerequisites 15 | ============= 16 | 17 | You need a C/C++ compiler, plus the liblzma, liblzo and zlib development libraries: 18 | 19 | ```bash 20 | $ sudo apt-get install build-essential liblzma-dev liblzo2-dev zlib1g-dev 21 | ``` 22 | 23 | Installation 24 | ============ 25 | 26 | The included `build.sh` script will download squashfs-tools v4.3, patch the source, then build and install `sasquatch`: 27 | 28 | ```bash 29 | $ ./build.sh 30 | ``` 31 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to download squashfs-tools v4.3, apply the patches, perform a clean build, and install. 3 | 4 | # If not root, perform 'make install' with sudo 5 | if [ $UID -eq 0 ] 6 | then 7 | SUDO="" 8 | else 9 | SUDO="sudo" 10 | fi 11 | 12 | # Install prerequisites 13 | if hash apt-get &>/dev/null 14 | then 15 | $SUDO apt-get install build-essential liblzma-dev liblzo2-dev zlib1g-dev 16 | fi 17 | 18 | # Make sure we're working in the same directory as the build.sh script 19 | cd $(dirname `readlink -f $0`) 20 | 21 | # Download squashfs4.3.tar.gz if it does not already exist 22 | if [ ! -e squashfs4.3.tar.gz ] 23 | then 24 | wget https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.3/squashfs4.3.tar.gz 25 | fi 26 | 27 | # Remove any previous squashfs4.3 directory to ensure a clean patch/build 28 | rm -rf squashfs4.3 29 | 30 | # Extract squashfs4.3.tar.gz 31 | tar -zxvf squashfs4.3.tar.gz 32 | 33 | # Patch, build, and install the source 34 | cd squashfs4.3 35 | patch -p0 < ../patches/patch0.txt 36 | cd squashfs-tools 37 | make && $SUDO make install 38 | -------------------------------------------------------------------------------- /patches/README.md: -------------------------------------------------------------------------------- 1 | Squashfs-Tools Version 2 | ====================== 3 | 4 | The patches contained in this directory were built against squashfs tools v4.3, available on [Sourceforge](http://sourceforge.net/projects/squashfs/files/). 5 | 6 | Modified Files 7 | ============== 8 | 9 | The following files have been modified from their original version: 10 | 11 | * compressor.c 12 | * compressor.h 13 | * error.h 14 | * lzma_wrapper.c 15 | * Makefile 16 | * process_fragments.c 17 | * read_fs.c 18 | * squashfs_fs.h 19 | * unsquashfs.c 20 | * LZMA/lzmalt/WindowOut.h 21 | * LZMA/lzmalt/LZMADecoder.c 22 | * LZMA/lzmadaptive/C/7zip/Compress/LZMA_Lib/ZLib.cpp 23 | * LZMA/lzmadaptive/C/7zip/Compress/LZMA_Lib/lzmadaptive.h 24 | 25 | -------------------------------------------------------------------------------- /patches/patch0.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devttys0/sasquatch/bd864a1b037bf57ca7d64a292a60ba0d6459611f/patches/patch0.txt --------------------------------------------------------------------------------