/[gentoo-x86]/eclass/nvidia-driver.eclass
Gentoo

Contents of /eclass/nvidia-driver.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Fri Dec 21 20:38:44 2007 UTC (6 years, 9 months ago) by cardoe
Branch: MAIN
Changes since 1.9: +2 -2 lines
remove old style nvidia-driver version number since they're gone. this fixes bug #202104

1 cardoe 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 cardoe 1.10 # $Header: /var/cvsroot/gentoo-x86/eclass/nvidia-driver.eclass,v 1.9 2007/10/01 18:54:39 cardoe Exp $
4 cardoe 1.1
5     #
6     # Original Author: Doug Goldstein <cardoe@gentoo.org>
7     # Purpose: Provide useful messages for nvidia-drivers based on currently
8     # installed Nvidia card
9     #
10 cardoe 1.4 inherit versionator
11 cardoe 1.1
12     DEPEND="sys-apps/pciutils"
13    
14 cardoe 1.2 # the data below is derived from
15     # http://us.download.nvidia.com/XFree86/Linux-x86_64/100.14.11/README/appendix-a.html
16    
17 cardoe 1.1 drv_96xx="0110 0111 0112 0113 0170 0171 0172 0173 0174 0175 0176 0177 0178 \
18     0179 017a 017c 017d 0181 0182 0183 0185 0188 018a 018b 018c 01a0 01f0 0200 \
19     0201 0202 0203 0250 0251 0253 0258 0259 025b 0280 0281 0282 0286 0288 0289 \
20     028c"
21    
22     drv_71xx="0020 0028 0029 002c 002d 00a0 0100 0101 0103 0150 0151 0152 0153"
23    
24 cardoe 1.9 mask_96xx=">=x11-drivers/nvidia-drivers-97.0.0"
25 cardoe 1.10 mask_71xx=">=x11-drivers/nvidia-drivers-72.0.0"
26 cardoe 1.4
27 cardoe 1.1 # Retrieve the PCI device ID for each Nvidia video card you have
28     nvidia-driver-get-card() {
29     local NVIDIA_CARD="$(/usr/sbin/lspci -d 10de: -n | \
30     awk '/ 0300: /{print $3}' | cut -d: -f2 | tr '\n' ' ')"
31    
32     if [ -n "$NVIDIA_CARD" ]; then
33     echo "$NVIDIA_CARD";
34     else
35     echo "0000";
36     fi
37     }
38    
39     nvidia-driver-get-mask() {
40     local NVIDIA_CARDS="$(nvidia-driver-get-card)"
41     for card in $NVIDIA_CARDS; do
42     for drv in $drv_96xx; do
43     if [ "x$card" = "x$drv" ]; then
44     echo "$mask_96xx";
45     return 0;
46     fi
47     done
48    
49     for drv in $drv_71xx; do
50     if [ "x$card" = "x$drv" ]; then
51     echo "$mask_71xx";
52     return 0;
53     fi
54     done
55    
56     done
57    
58     echo "";
59     return 1;
60     }
61    
62     nvidia-driver-check-warning() {
63     local NVIDIA_MASK="$(nvidia-driver-get-mask)"
64     if [ -n "$NVIDIA_MASK" ]; then
65 cardoe 1.7 version_compare "${NVIDIA_MASK##*-}" "${PV}"
66 cardoe 1.4 r=$?
67    
68 cardoe 1.7 if [ "x$r" = "x1" ]; then
69 cardoe 1.4 ewarn "***** WARNING *****"
70 swegener 1.8 ewarn
71 cardoe 1.4 ewarn "You are currently installing a version of nvidia-drivers that is"
72     ewarn "known not to work with a video card you have installed on your"
73     ewarn "system. If this is intentional, please ignore this. If it is not"
74     ewarn "please perform the following steps:"
75     ewarn
76     ewarn "Add the following mask entry to /etc/portage/package.mask by"
77     if [ -d "${ROOT}/etc/portage/package.mask" ]; then
78     ewarn "echo \"$NVIDIA_MASK\" > /etc/portage/package.mask/nvidia-drivers"
79     else
80     ewarn "echo \"$NVIDIA_MASK\" >> /etc/portage/package.mask"
81     fi
82     ewarn
83     ewarn "Failure to perform the steps above could result in a non-working"
84     ewarn "X setup."
85     ewarn
86     ewarn "For more information please read:"
87     ewarn "http://www.nvidia.com/object/IO_32667.html"
88     ebeep 5
89 cardoe 1.1 fi
90     fi
91     }

  ViewVC Help
Powered by ViewVC 1.1.20