Fix: use dl-cdn.alpinelinux.org everywhere for consistent package resolution

Both build-nvidia-module.sh (apk add) and mkimage.sh (--repository) now
explicitly use dl-cdn. Local builder mirror config is ignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-03-07 11:28:14 +03:00
parent 699c8d2473
commit 1feb956e30
3 changed files with 21 additions and 14 deletions

View File

@@ -17,15 +17,19 @@ set -e
NVIDIA_VERSION="$1"
DIST_DIR="$2"
KERNEL_PKG_VERSION="$3"
ALPINE_VERSION="$4"
[ -n "$NVIDIA_VERSION" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version>"; exit 1; }
[ -n "$DIST_DIR" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version>"; exit 1; }
[ -n "$KERNEL_PKG_VERSION" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version>"; exit 1; }
[ -n "$NVIDIA_VERSION" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version> <alpine-version>"; exit 1; }
[ -n "$DIST_DIR" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version> <alpine-version>"; exit 1; }
[ -n "$KERNEL_PKG_VERSION" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version> <alpine-version>"; exit 1; }
[ -n "$ALPINE_VERSION" ] || { echo "usage: $0 <nvidia-version> <dist-dir> <kernel-pkg-version> <alpine-version>"; exit 1; }
# Install the EXACT pinned linux-lts-dev version so builder headers always match ISO kernel.
# If this version is unavailable, apk will fail loudly — do NOT use a floating version here.
# Use dl-cdn.alpinelinux.org — same source as mkimage. If unavailable, apk fails loudly.
echo "=== installing linux-lts-dev=${KERNEL_PKG_VERSION} ==="
apk add --quiet "linux-lts-dev=${KERNEL_PKG_VERSION}"
apk add --quiet \
--repository "https://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" \
"linux-lts-dev=${KERNEL_PKG_VERSION}"
# Detect kernel version from installed headers (pick highest version if multiple).
detect_kver() {
@@ -48,8 +52,10 @@ if [ -d "$CACHE_DIR/modules" ] && [ -f "$CACHE_DIR/bin/nvidia-smi" ]; then
exit 0
fi
# Install build dependencies (linux-lts-dev pinned to same version as initial install above)
apk add --quiet gcc make perl "linux-lts-dev=${KERNEL_PKG_VERSION}" wget
# Install build dependencies (linux-lts-dev pinned, same dl-cdn source)
apk add --quiet \
--repository "https://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" \
gcc make perl "linux-lts-dev=${KERNEL_PKG_VERSION}" wget
# Download official NVIDIA .run installer (proprietary) with sha256 verification
BASE_URL="https://download.nvidia.com/XFree86/Linux-x86_64/${NVIDIA_VERSION}"