Fix NVIDIA module version selection and add load diagnostics
This commit is contained in:
@@ -20,12 +20,20 @@ DIST_DIR="$2"
|
||||
[ -n "$NVIDIA_VERSION" ] || { echo "usage: $0 <nvidia-version> <dist-dir>"; exit 1; }
|
||||
[ -n "$DIST_DIR" ] || { echo "usage: $0 <nvidia-version> <dist-dir>"; exit 1; }
|
||||
|
||||
# Detect kernel version from installed headers
|
||||
KVER=$(ls /usr/src/ 2>/dev/null | grep '^linux-headers-' | sed 's/linux-headers-//' | head -1)
|
||||
# Detect kernel version from installed headers (pick highest version if multiple).
|
||||
detect_kver() {
|
||||
ls /usr/src/ 2>/dev/null \
|
||||
| grep '^linux-headers-' \
|
||||
| sed 's/linux-headers-//' \
|
||||
| sort -V \
|
||||
| tail -1
|
||||
}
|
||||
|
||||
KVER="$(detect_kver)"
|
||||
if [ -z "$KVER" ]; then
|
||||
echo "=== installing linux-lts-dev ==="
|
||||
apk add --quiet linux-lts-dev
|
||||
KVER=$(ls /usr/src/ | grep '^linux-headers-' | sed 's/linux-headers-//' | head -1)
|
||||
KVER="$(detect_kver)"
|
||||
fi
|
||||
KDIR="/usr/src/linux-headers-${KVER}"
|
||||
echo "=== NVIDIA ${NVIDIA_VERSION} (proprietary) for kernel ${KVER} ==="
|
||||
|
||||
Reference in New Issue
Block a user