Skip to content

Instantly share code, notes, and snippets.

@brostosjoined
Created February 24, 2025 08:06
Show Gist options
  • Select an option

  • Save brostosjoined/14bc4e36bd786e2beb41fd912fe65335 to your computer and use it in GitHub Desktop.

Select an option

Save brostosjoined/14bc4e36bd786e2beb41fd912fe65335 to your computer and use it in GitHub Desktop.
A script to make Bombsquad latest server version to run on older ubuntu distros
#!/bin/bash
# crafted; by brostos
# Place this script inside the main server folder
# Fixes the error below
# ./bombsquad_headless: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./bombsquad_headless)
# ./bombsquad_headless: /lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.30' not found (required by ./bombsquad_headless)
# ./bombsquad_headless: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC 2.33' not found (required by ./bombsquad_headless)
# ./bombsquad_headless: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by ./bombsquad_headless)
cwd= pwd
glibcVer="2.34"
ARCH=$(uname -m)
case "$ARCH" in
"x86_64")
INTERPRETER_ARCH="-x86-64"
;;
"i686")
INTERPRETER_ARCH=""
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt install -y g++-11
# Download and build GLIBC
mkdir -p ~/glibc_install
cd ~/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-$glibcVer.tar.gz
tar zxvf glibc-$glibcVer.tar.gz
cd glibc-$glibcVer
mkdir -p build
cd build
../configure --prefix=/opt/glibc-$glibcVer
make -j4
sudo make install
# Define the destination directory for libraries
DEST_DIR="/opt/glibc-$glibcVer/lib"
# Create the destination directory if it doesn't exist
mkdir -p $DEST_DIR
# Array of required libraries
Libs=(
"libpython3.12.so.1.0" # Dont hardcode the python lib version
"libstdc++.so.6"
"libgcc_s.so.1"
"libz.so.1"
"libexpat.so.1"
"libssl.so.1.1"
"libcrypto.so.1.1"
)
# Copy required libraries to the destination directory
for lib in "${Libs[@]}"; do
cp "/lib/x86_64-linux-gnu/$lib" /opt/glibc-2.34/lib
done
cp "/lib/$ARCH-linux-gnu/$lib" "$DEST_DIR"
# Function to check if patchelf is installed and install it if not
check_and_install_patchelf() {
if ! command -v patchelf &> /dev/null; then
echo "patchelf could not be found. Installing patchelf..."
sudo apt-get update
sudo apt-get install -y patchelf
fi
}
# Call the function to check if patchelf is installed
check_and_install_patchelf
# Use patchelf to set the interpreter and rpath
patchelf --set-interpreter /opt/glibc-$glibcVer/lib/ld-linux$INTERPRETER_ARCH.so.2 --set-rpath $DEST_DIR $cwd/dist/bombsquad_headless
echo "Libraries copied and bombsquad_headless patched successfully."
@brostosjoined
Copy link
Author

brostosjoined commented Feb 24, 2025

can work with future version of bombsquad just replace line 52 for the python version used by the game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment