fix: update NVIDIA to 590.48.01, add sha256 verification for installer

- 550.54.15 did not exist on NVIDIA CDN (404)
- updated to 590.48.01 (latest stable, 396MB)
- download sha256sum file first, verify installer before extracting
- re-download if file is missing, empty, or sha256 mismatch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 18:10:31 +03:00
parent e5c1ef2c33
commit 559fc2961d
2 changed files with 31 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
ALPINE_VERSION=3.21 ALPINE_VERSION=3.21
KERNEL_VERSION=6.6 KERNEL_VERSION=6.6
NVIDIA_DRIVER_VERSION=550.54.15 NVIDIA_DRIVER_VERSION=590.48.01
GO_VERSION=1.23.6 GO_VERSION=1.23.6

View File

@@ -41,13 +41,29 @@ fi
# Install build dependencies # Install build dependencies
apk add --quiet gcc make perl linux-lts-dev wget apk add --quiet gcc make perl linux-lts-dev wget
# Download official NVIDIA .run installer (proprietary) # Download official NVIDIA .run installer (proprietary) with sha256 verification
BASE_URL="https://download.nvidia.com/XFree86/Linux-x86_64/${NVIDIA_VERSION}"
RUN_FILE="/var/tmp/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run" RUN_FILE="/var/tmp/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run"
if [ ! -f "$RUN_FILE" ]; then SHA_FILE="/var/tmp/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run.sha256sum"
verify_run() {
[ -s "$SHA_FILE" ] || return 1
[ -s "$RUN_FILE" ] || return 1
cd /var/tmp
sha256sum -c "$SHA_FILE" --status 2>/dev/null
}
if ! verify_run; then
rm -f "$RUN_FILE" "$SHA_FILE"
echo "=== downloading NVIDIA ${NVIDIA_VERSION} installer ===" echo "=== downloading NVIDIA ${NVIDIA_VERSION} installer ==="
wget -q --show-progress \ wget -q -O "$SHA_FILE" "${BASE_URL}/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run.sha256sum"
-O "$RUN_FILE" \ echo "sha256: $(cat "$SHA_FILE")"
"https://download.nvidia.com/XFree86/Linux-x86_64/${NVIDIA_VERSION}/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run" wget --show-progress -O "$RUN_FILE" "${BASE_URL}/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run"
echo "=== verifying sha256 ==="
cd /var/tmp && sha256sum -c "$SHA_FILE" || { echo "ERROR: sha256 mismatch"; rm -f "$RUN_FILE"; exit 1; }
echo "sha256 OK"
else
echo "=== NVIDIA installer verified from cache ==="
fi fi
# Extract installer contents # Extract installer contents
@@ -57,9 +73,17 @@ EXTRACT_DIR="/var/tmp/nvidia-extract-${NVIDIA_VERSION}"
rm -rf "$EXTRACT_DIR" rm -rf "$EXTRACT_DIR"
"$RUN_FILE" --extract-only --target "$EXTRACT_DIR" "$RUN_FILE" --extract-only --target "$EXTRACT_DIR"
# Find kernel source directory (proprietary: kernel/, open: kernel-open/)
KERNEL_SRC=""
for d in "$EXTRACT_DIR/kernel" "$EXTRACT_DIR/kernel-modules-sources" "$EXTRACT_DIR/kernel-source"; do
[ -f "$d/Makefile" ] && KERNEL_SRC="$d" && break
done
[ -n "$KERNEL_SRC" ] || { echo "ERROR: kernel source dir not found in:"; ls "$EXTRACT_DIR/"; exit 1; }
echo "kernel source: $KERNEL_SRC"
# Build kernel modules from extracted source # Build kernel modules from extracted source
echo "=== building kernel modules ($(nproc) cores) ===" echo "=== building kernel modules ($(nproc) cores) ==="
cd "$EXTRACT_DIR/kernel" cd "$KERNEL_SRC"
make -j$(nproc) KERNEL_UNAME="$KVER" SYSSRC="$KDIR" modules 2>&1 | tail -5 make -j$(nproc) KERNEL_UNAME="$KVER" SYSSRC="$KDIR" modules 2>&1 | tail -5
# Collect outputs # Collect outputs