sasquatch icon indicating copy to clipboard operation
sasquatch copied to clipboard

Containerised build environment (Ubuntu 24.04 + squashfs-tools 4.4)

Open aliask opened this issue 1 year ago • 0 comments

Overview

Create a Dockerfile to enable a portable build environment, and sync patch to build with squashfs-tools 4.4

Details

The Dockerfile is based on Ubuntu 24.04, and uses multiple stages to produce a minimal final product, with the final image size sitting at about 75mb.

This branch also incorporates the updates prepared by @cole-h to update to squashfs-tools 4.4 in #56.

Finally, building on newer GCC highlights a dangling pointer error in LzmaEnc.c:

LZMA/lzma465/C/LzmaEnc.c: In function ‘LzmaEnc_CodeOneMemBlock’:
LZMA/lzma465/C/LzmaEnc.c:2161:19: error: storing the address of local variable ‘outStream’ in ‘*(CLzmaEnc *)pp.rc.outStream’ [-Werror=dangling-pointer=]
 2161 |   p->rc.outStream = &outStream.funcTable;
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
LZMA/lzma465/C/LzmaEnc.c:2145:20: note: ‘outStream’ declared here
 2145 |   CSeqOutStreamBuf outStream;
      |                    ^~~~~~~~~
LZMA/lzma465/C/LzmaEnc.c:2139:45: note: ‘pp’ declared here
 2139 | SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
      |                              ~~~~~~~~~~~~~~~^~
cc1: all warnings being treated as errors
make: *** [<builtin>: LZMA/lzma465/C/LzmaEnc.o] Error 1

I have separated the fix for this problem into a dedicated patch file for ease of review.

I know this PR probably won't ever be merged, but sasquatch is still useful for reading vendor-specific SquashFS implementations, and until the upstream project can support these tweaks I guess this is the next best thing.

aliask avatar Oct 16 '24 12:10 aliask