From d3c4fecb95f6dc1016c92f246e0b18d04103f8bc Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Wed, 7 Aug 2024 15:37:50 -0700 Subject: [PATCH] feat: Use an environment variable for the kernel module type selector, default to proprietary for now. --- build-kmod-nvidia.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-kmod-nvidia.sh b/build-kmod-nvidia.sh index c0a43669..58937a99 100755 --- a/build-kmod-nvidia.sh +++ b/build-kmod-nvidia.sh @@ -3,6 +3,7 @@ set -oeux pipefail RELEASE="$(rpm -E '%fedora.%_arch')" +NVIDIA_DRIVER_TYPE="${1:-kernel}" cd /tmp @@ -15,8 +16,8 @@ cp /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/negativo17-fedora-nvidia.repo /e dnf install -y \ akmod-nvidia*.fc${RELEASE} -# Switch to the open source kernel module -sed -i -e 's/kernel$/kernel-open/g' /etc/nvidia/kernel.conf +# Switch to the desired driver flavor +sed -i "s/^MODULE_VARIANT=.*/MODULE_VARIANT=$NVIDIA_DRIVER_TYPE/" /etc/nvidia/kernel.conf # Either successfully build and install the kernel modules, or fail early with debug output rpm -qa |grep nvidia