Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:24.04 AS builder

RUN --mount=type=cache,target=/var/cache/apt,id=builder-apt-cache \
--mount=type=cache,target=/var/lib/apt,id=builder-apt-lib \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
git \
liblzma-dev \
liblzo2-dev \
patch \
zlib1g-dev \
&& mkdir -p /sasquatch

WORKDIR /sasquatch

ADD https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.4/squashfs4.4.tar.gz .
RUN tar -zxvf squashfs4.4.tar.gz

COPY patches /sasquatch/patches
RUN patch -d squashfs4.4 -p1 < patches/0_sasquatch_4.4.patch && \
patch -d squashfs4.4 -p1 < patches/1_fix_dangling_pointer.patch && \
cd squashfs4.4/squashfs-tools && \
make

FROM ubuntu:24.04

RUN --mount=type=cache,target=/var/cache/apt,id=runtime-apt-cache \
--mount=type=cache,target=/var/lib/apt,id=runtime-apt-lib \
apt-get update && \
apt-get install -y --no-install-recommends \
liblzma5 \
liblzo2-2 \
zlib1g

COPY --from=builder /sasquatch/squashfs4.4/squashfs-tools/sasquatch /usr/local/bin/sasquatch

WORKDIR /work

ENTRYPOINT [ "/usr/local/bin/sasquatch" ]
20 changes: 10 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Script to download squashfs-tools v4.3, apply the patches, perform a clean build, and install.
# Script to download squashfs-tools v4.4, apply the patches, perform a clean build, and install.

# If not root, perform 'make install' with sudo
if [ $UID -eq 0 ]
Expand All @@ -18,20 +18,20 @@ fi
# Make sure we're working in the same directory as the build.sh script
cd $(dirname `readlink -f $0`)

# Download squashfs4.3.tar.gz if it does not already exist
if [ ! -e squashfs4.3.tar.gz ]
# Download squashfs4.4.tar.gz if it does not already exist
if [ ! -e squashfs4.4.tar.gz ]
then
wget https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.3/squashfs4.3.tar.gz
wget https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.4/squashfs4.4.tar.gz
fi

# Remove any previous squashfs4.3 directory to ensure a clean patch/build
rm -rf squashfs4.3
# Remove any previous squashfs4.4 directory to ensure a clean patch/build
rm -rf squashfs4.4

# Extract squashfs4.3.tar.gz
tar -zxvf squashfs4.3.tar.gz
# Extract squashfs4.4.tar.gz
tar -zxvf squashfs4.4.tar.gz

# Patch, build, and install the source
cd squashfs4.3
patch -p0 < ../patches/patch0.txt
cd squashfs4.4
patch -p1 < ../patches/*.patch
cd squashfs-tools
make && $SUDO make install
Loading