test: Update 3 files
This commit is contained in:
46
build-base/opt/install_upx.sh
Executable file
46
build-base/opt/install_upx.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# check we're running as root
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine architecture
|
||||
ARCH=$(uname -m)
|
||||
case $ARCH in
|
||||
x86_64)
|
||||
UPX_ARCH="amd64"
|
||||
;;
|
||||
aarch64)
|
||||
UPX_ARCH="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Download and install UPX v5.0.1
|
||||
UPX_VERSION="5.0.1"
|
||||
UPX_FILE="upx-${UPX_VERSION}-${UPX_ARCH}_linux.tar.xz"
|
||||
UPX_URL="https://github.com/upx/upx/releases/download/v${UPX_VERSION}/${UPX_FILE}"
|
||||
|
||||
echo "Downloading UPX ${UPX_VERSION} for ${UPX_ARCH}..."
|
||||
curl -L -o "${UPX_FILE}" "${UPX_URL}"
|
||||
|
||||
# Extract UPX
|
||||
tar -xf "${UPX_FILE}"
|
||||
|
||||
# Install to /usr/local/bin
|
||||
cp "upx-${UPX_VERSION}-${UPX_ARCH}_linux/upx" /usr/local/bin/
|
||||
chmod +x /usr/local/bin/upx
|
||||
|
||||
# Verify installation
|
||||
upx --version
|
||||
|
||||
# Cleanup
|
||||
rm -rf "${UPX_FILE}" "upx-${UPX_VERSION}-${UPX_ARCH}_linux"
|
||||
|
||||
echo "UPX ${UPX_VERSION} installed successfully!"
|
Reference in New Issue
Block a user