diff --git a/postinst.d/10-nvidia-drivers b/postinst.d/10-nvidia-drivers index f1cd4b4..7f75dfe 100755 --- a/postinst.d/10-nvidia-drivers +++ b/postinst.d/10-nvidia-drivers @@ -1,12 +1,20 @@ #!/usr/bin/env sh -NVDSRC="${NVDSRC:-/usr/src/nvidia-drivers}" +run() { + echo "$*" + exec "$@" +} + [ -e "${0}.disabled" ] && exit 0 which make >/dev/null 2>&1 || exit 0 + +NVDSRC="${NVDSRC:-/usr/src/nvidia-drivers}" [ -d "${NVDSRC}" ] || exit 0 + V="${1:-`uname -r`}" SYSSRC="/lib/modules/${V}/source" +SYSOUT="/lib/modules/${V}/build" echo "Build NVIDIA module..." >&2 cd "${NVDSRC}" -exec make module-install SYSSRC="${SYSSRC}" PWD="${NVDSRC}" +run make module-install SYSSRC="${SYSSRC}" KBUILD_OUTPUT="${SYSOUT}" PWD="${NVDSRC}"