Update build_appimage.sh

This commit is contained in:
MacRimi
2025-10-06 11:06:19 +02:00
parent 84eec4655a
commit 359de2dbe0

View File

@@ -321,42 +321,73 @@ echo "🔧 Installing hardware monitoring tools..."
mkdir -p "$WORK_DIR/debs" mkdir -p "$WORK_DIR/debs"
cd "$WORK_DIR/debs" cd "$WORK_DIR/debs"
# Download .deb packages # Download .deb packages with better error handling
echo "📥 Downloading ipmitool..." echo "📥 Downloading hardware monitoring tools..."
wget -q http://deb.debian.org/debian/pool/main/i/ipmitool/ipmitool_1.8.19-4_amd64.deb -O ipmitool.deb || true
echo "📥 Downloading lm-sensors..." # Function to download and verify .deb package
wget -q http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0-7.1_amd64.deb -O lm-sensors.deb || true download_deb() {
local url=$1
local output=$2
local name=$3
echo " Downloading $name..."
if wget -q --timeout=30 "$url" -O "$output"; then
# Verify it's a valid .deb file
if file "$output" | grep -q "Debian binary package"; then
echo "$name downloaded successfully"
return 0
else
echo " ⚠️ $name: Invalid .deb file, skipping"
rm -f "$output"
return 1
fi
else
echo " ⚠️ $name: Download failed, skipping"
rm -f "$output"
return 1
fi
}
echo "📥 Downloading nut-client..." # Try to download packages (non-fatal if they fail)
wget -q http://deb.debian.org/debian/pool/main/n/nut/nut-client_2.8.0-7_amd64.deb -O nut-client.deb || true download_deb "http://deb.debian.org/debian/pool/main/i/ipmitool/ipmitool_1.8.19-4_amd64.deb" "ipmitool.deb" "ipmitool" || true
wget -q http://deb.debian.org/debian/pool/main/n/nut/libupsclient6_2.8.0-7_amd64.deb -O libupsclient6.deb || true download_deb "http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0-7.1_amd64.deb" "lm-sensors.deb" "lm-sensors" || true
download_deb "http://deb.debian.org/debian/pool/main/n/nut/nut-client_2.8.0-7_amd64.deb" "nut-client.deb" "nut-client" || true
download_deb "http://deb.debian.org/debian/pool/main/n/nut/libupsclient6_2.8.0-7_amd64.deb" "libupsclient6.deb" "libupsclient6" || true
# Extract binaries from .deb packages # Extract binaries from .deb packages
echo "📦 Extracting binaries..." echo "📦 Extracting binaries from downloaded packages..."
extracted_count=0
for deb in *.deb; do for deb in *.deb; do
if [ -f "$deb" ]; then if [ -f "$deb" ] && file "$deb" | grep -q "Debian binary package"; then
dpkg-deb -x "$deb" "$WORK_DIR/extracted" echo " Extracting $deb..."
dpkg-deb -x "$deb" "$WORK_DIR/extracted" && extracted_count=$((extracted_count + 1))
fi fi
done done
# Copy binaries to AppDir if [ $extracted_count -eq 0 ]; then
if [ -d "$WORK_DIR/extracted/usr/bin" ]; then echo "⚠️ No hardware monitoring tools were downloaded successfully"
echo "📋 Copying monitoring tools to AppDir..." echo " The AppImage will work but without IPMI/sensors support"
cp -r "$WORK_DIR/extracted/usr/bin"/* "$APP_DIR/usr/bin/" 2>/dev/null || true else
fi echo "✅ Extracted $extracted_count package(s)"
# Copy binaries to AppDir
if [ -d "$WORK_DIR/extracted/usr/bin" ]; then
echo "📋 Copying monitoring tools to AppDir..."
cp -r "$WORK_DIR/extracted/usr/bin"/* "$APP_DIR/usr/bin/" 2>/dev/null || true
fi
if [ -d "$WORK_DIR/extracted/usr/sbin" ]; then if [ -d "$WORK_DIR/extracted/usr/sbin" ]; then
cp -r "$WORK_DIR/extracted/usr/sbin"/* "$APP_DIR/usr/bin/" 2>/dev/null || true cp -r "$WORK_DIR/extracted/usr/sbin"/* "$APP_DIR/usr/bin/" 2>/dev/null || true
fi fi
if [ -d "$WORK_DIR/extracted/usr/lib" ]; then if [ -d "$WORK_DIR/extracted/usr/lib" ]; then
mkdir -p "$APP_DIR/usr/lib" mkdir -p "$APP_DIR/usr/lib"
cp -r "$WORK_DIR/extracted/usr/lib"/* "$APP_DIR/usr/lib/" 2>/dev/null || true cp -r "$WORK_DIR/extracted/usr/lib"/* "$APP_DIR/usr/lib/" 2>/dev/null || true
fi
echo "✅ Hardware monitoring tools installed successfully"
fi fi
echo "✅ Hardware monitoring tools installed"
# Build AppImage # Build AppImage
echo "🔨 Building unified AppImage v${VERSION}..." echo "🔨 Building unified AppImage v${VERSION}..."
cd "$WORK_DIR" cd "$WORK_DIR"