summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2012-04-06 01:52:26 +0000
committerDoug Goldstein <cardoe@gentoo.org>2012-04-06 01:52:26 +0000
commitd1810730fb5b58341e4c5ce147c58a77fa86268c (patch)
tree331047eb409e1f17139d64f466087016488eee51 /x11-drivers/nvidia-drivers
parentmarked x86 per bug 410889 (diff)
downloadgentoo-2-d1810730fb5b58341e4c5ce147c58a77fa86268c.tar.gz
gentoo-2-d1810730fb5b58341e4c5ce147c58a77fa86268c.tar.bz2
gentoo-2-d1810730fb5b58341e4c5ce147c58a77fa86268c.zip
Add support for creating device nodes for NVIDIA graphics cards when not using X. Users of CUDA only specificially need this. Work for this done by Rick Farina <sidhayn@gmail.com> bug #376527
(Portage version: 2.1.10.55/cvs/Linux x86_64)
Diffstat (limited to 'x11-drivers/nvidia-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/ChangeLog8
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-udev.sh17
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia.udev-rule1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild9
4 files changed, 33 insertions, 2 deletions
diff --git a/x11-drivers/nvidia-drivers/ChangeLog b/x11-drivers/nvidia-drivers/ChangeLog
index 073ea53f91c6..59f8c2a86649 100644
--- a/x11-drivers/nvidia-drivers/ChangeLog
+++ b/x11-drivers/nvidia-drivers/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for x11-drivers/nvidia-drivers
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.327 2012/03/26 18:11:12 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.328 2012/04/06 01:52:26 cardoe Exp $
+
+ 06 Apr 2012; Doug Goldstein <cardoe@gentoo.org> nvidia-drivers-295.33.ebuild,
+ +files/nvidia.udev-rule, +files/nvidia-udev.sh:
+ Add support for creating device nodes for NVIDIA graphics cards when not
+ using X. Users of CUDA only specificially need this. Work for this done by
+ Rick Farina <sidhayn@gmail.com> bug #376527
26 Mar 2012; Doug Goldstein <cardoe@gentoo.org> nvidia-drivers-295.33.ebuild:
ebuild updates that were meant to be committed part of the original commit.
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh
new file mode 100644
index 000000000000..9487b08e7a5e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ $# -ne 1 ]; then
+ echo "Invalid args" >&2
+ exit 1
+fi
+
+case $1 in
+ add|ADD)
+ /opt/bin/nvidia-smi > /dev/null
+ ;;
+ remove|REMOVE)
+ rm -f /dev/nvidia*
+ ;;
+esac
+
+exit 0
diff --git a/x11-drivers/nvidia-drivers/files/nvidia.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule
new file mode 100644
index 000000000000..4b5dd6d2ee44
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule
@@ -0,0 +1 @@
+ACTION=="add|remove", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}"
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild
index 305c17ca2ee1..649200b9defa 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild,v 1.2 2012/03/26 18:11:12 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-295.33.ebuild,v 1.3 2012/04/06 01:52:26 cardoe Exp $
EAPI="2"
@@ -330,6 +330,13 @@ src_install() {
"${WORKDIR}"/nvidia
insinto /etc/modprobe.d
newins "${WORKDIR}"/nvidia nvidia.conf || die
+
+ # Ensures that our device nodes are created when not using X
+ insinto /lib/udev
+ doins "${FILESDIR}"/nvidia-udev.sh
+
+ insinto /lib/udev/rules.d
+ newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
elif use x86-fbsd; then
insinto /boot/modules
doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die