parent
d96a0e5d67
commit
d34971cf61
@ -1,2 +1,2 @@
|
||||
NVIDIA-Linux-x86-270.41.06.run
|
||||
NVIDIA-Linux-x86_64-270.41.06.run
|
||||
NVIDIA-Linux-x86-270.41.19.run
|
||||
NVIDIA-Linux-x86_64-270.41.19.run
|
||||
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -x /usr/lib/rpm/redhat/find-provides ]; then
|
||||
FINDPROV=/usr/lib/rpm/redhat/find-provides
|
||||
else
|
||||
FINDPROV=/usr/lib/rpm/find-provides
|
||||
fi
|
||||
|
||||
$FINDPROV $* | sed -e '/libnvidia-tls.so/d' | sed -e '/libGLcore.so/d' | sed -e '/libGL.so/d'
|
||||
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -x /usr/lib/rpm/redhat/find-requires ]; then
|
||||
FINDREQ=/usr/lib/rpm/redhat/find-requires
|
||||
else
|
||||
FINDREQ=/usr/lib/rpm/find-requires
|
||||
fi
|
||||
|
||||
$FINDREQ $* | sed -e '/libnvidia-tls.so/d' | sed -e '/libGLcore.so/d' | sed -e '/libGL.so/d'
|
||||
|
@ -1,146 +0,0 @@
|
||||
#!/usr/bin/python -tt
|
||||
# -*- coding: UTF-8 -*-
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 only
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# Copyright 2003, 2004 Peter Backlund
|
||||
# Copyright 2004 Thorsten Leemhuis
|
||||
# Copyright 2006 Van Assche Alphonse
|
||||
# Copyright 2006, 2007 Stewart Adam
|
||||
|
||||
import string
|
||||
import os
|
||||
import sys
|
||||
|
||||
from livnaConfigDisplay.const import *
|
||||
from livnaConfigDisplay.const import _
|
||||
|
||||
import livnaConfigDisplay.ConfigDisplay
|
||||
from livnaConfigDisplay.GlxConfig import *
|
||||
from livnaConfigDisplay import Utils
|
||||
from livnaConfigDisplay.ConfigFile import ConfigFile
|
||||
|
||||
class nvidiaConfigDisplay(GlxConfig):
|
||||
def __init__(self):
|
||||
GlxConfig.__init__(self)
|
||||
self.vendor = 'nvidia'
|
||||
self.majorVendor = Utils.getMajorVendor()
|
||||
if self.vendor != Utils.getVendor():
|
||||
print _('The initscript and installed driver vendors do not match!')
|
||||
sys.exit(1)
|
||||
self.ldconf = LD_CONF_FILE % (self.vendor)
|
||||
try:
|
||||
self.doAllBackups()
|
||||
except livnaConfigDisplayError, (bkupErrMsg):
|
||||
print bkupErrMsg
|
||||
sys.exit(1)
|
||||
self.xconfig, self.xconfigpath = self.loadXconfig()
|
||||
self.config = ConfigFile(STATUS_FILE)
|
||||
self.TOP_MOD_DIR = self.getModTopDir()
|
||||
|
||||
# finally, run arg checks.
|
||||
self.run()
|
||||
|
||||
|
||||
def enable(self, isAutoConfigure = True):
|
||||
# Backup the file before make any change.
|
||||
currentDriver = self.getDriver()
|
||||
# Already enabled?
|
||||
if currentDriver == self.majorVendor:
|
||||
print _('Driver already enabled.')
|
||||
return
|
||||
# nVidia modules
|
||||
self.addModulePath("/extensions/nvidia", self.TOP_MOD_DIR)
|
||||
# 'remembering' magic's in here.
|
||||
self.config.setOldDriver(currentDriver)
|
||||
#currentDriver = self.config.getOldDriver()
|
||||
self.toggleDriver(currentDriver, self.majorVendor)
|
||||
# Disable dri and GLcore modules - these are no
|
||||
self.removeModule("dri")
|
||||
self.removeModule("GLcore")
|
||||
# Add glx/dbe/extmod modules when modules section exists
|
||||
if self.xconfig.modules:
|
||||
for module in ["glx", "dbe", "extmod"]:
|
||||
if self.onlyHasModule(module):
|
||||
self.removeModule(module)
|
||||
break
|
||||
else:
|
||||
self.addModule(module)
|
||||
# Problems with Compiz without these. - not needed since 195.xxx
|
||||
#self.addOption(self.majorVendor,"AddARGBGLXVisuals", "True")
|
||||
#self.addOption(self.majorVendor,"DisableGLXRootClipping", "True")
|
||||
Utils.writeXorgConf(self.xconfig, self.xconfigpath)
|
||||
# We have to read saved status file to restore the Xorg configuration.
|
||||
self.restoreconf()
|
||||
|
||||
|
||||
def disable(self, isAutoConfigure = True):
|
||||
self.removeModulePath("/extensions/nvidia", self.TOP_MOD_DIR)
|
||||
# Check if it's already disabled
|
||||
if self.getDriver() != self.majorVendor:
|
||||
print _('Driver already disabled.')
|
||||
return
|
||||
# Backup the file before make any change.
|
||||
prevDriver = self.config.getOldDriver()
|
||||
if prevDriver == self.majorVendor:
|
||||
print _('Will not allow reverting from driver \'%s\' to \'%s\'.') % (self.vendor, self.vendor)
|
||||
print _('Using the \'nouveau\' driver instead.')
|
||||
prevDriver = "nouveau"
|
||||
self.config.setOldDriver("nouveau")
|
||||
self.removeOption(self.majorVendor,"AddARGBGLXVisuals")
|
||||
self.removeOption(self.majorVendor,"DisableGLXRootClipping")
|
||||
self.toggleDriver(self.majorVendor, prevDriver)
|
||||
Utils.writeXorgConf(self.xconfig, self.xconfigpath)
|
||||
# We have to save the status file so it can be restored later
|
||||
self.storeconf()
|
||||
# And return to the Fedora default.
|
||||
self.enableAiglx()
|
||||
|
||||
def printUsage(self):
|
||||
print _("Usage: ") + self.vendor + _("-config-display [ enable|disable ]")
|
||||
|
||||
def run(self):
|
||||
# Check number of arguments
|
||||
# arg = action
|
||||
if len(sys.argv) == 2:
|
||||
arg = sys.argv[1]
|
||||
else:
|
||||
print _('Wrong number of arguments')
|
||||
self.printUsage()
|
||||
sys.exit(1)
|
||||
# Check value of argument
|
||||
if arg.lower() != "enable" and arg.lower() != "disable":
|
||||
print _('Invalid command: %s') % arg.lower()
|
||||
self.printUsage()
|
||||
sys.exit(1)
|
||||
try:
|
||||
if arg == "enable":
|
||||
if self.getActive():
|
||||
self.enable()
|
||||
else:
|
||||
print _('livna-config-display\'s `active\' state is False - Exiting')
|
||||
elif arg == "disable":
|
||||
if self.getActive():
|
||||
self.disable()
|
||||
except:
|
||||
raise # Uncomment me to show the real error
|
||||
print MSG_CONF_APPLY_ERROR
|
||||
try:
|
||||
self.doAllRestores()
|
||||
sys.exit(1)
|
||||
except livnaConfigDisplayError, (bkupErrMsg):
|
||||
#raise # Uncomment me to show the real error
|
||||
print MSG_CONF_RESTORE_ERROR + '\n' + MSG_TRACEBACK % (str(errMsg)) + '\n\n' + str(bkupErrMsg)
|
||||
sys.exit(1)
|
||||
|
||||
app = nvidiaConfigDisplay()
|
@ -1,118 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# chkconfig: 2345 8 92
|
||||
# description: This script will check if a nvidia kernel module is present for\
|
||||
# the running kernel and modify the xorg.conf to the appropriate\
|
||||
# configuration.
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
name='nvidia'
|
||||
exec="/usr/sbin/$name-config-display"
|
||||
prog="`basename $exec`"
|
||||
lockfile="/var/lock/subsys/$name"
|
||||
|
||||
RETVAL=0
|
||||
modname="nvidia.ko"
|
||||
modpath="/lib/modules/$(uname -r)"
|
||||
# Default to no module
|
||||
module="noneWithSomeCrazyNameSoItsNeverFound"
|
||||
# If one exists, then use it.
|
||||
if test -e "${modpath}/extra/${modname}";then
|
||||
module="${modpath}/extra/${modname}"
|
||||
elif test -e "${modpath}/extra/nvidia/${modname}";then
|
||||
module="${modpath}/extra/nvidia/${modname}"
|
||||
elif test -e "${modpath}/kernel/drivers/video/nvidia/${modname}";then
|
||||
module="${modpath}/kernel/drivers/video/nvidia/${modname}"
|
||||
fi
|
||||
|
||||
|
||||
# Try to modify the below the least possible. If you need to change something, try
|
||||
# using the variables above first, as most of the program control is based on
|
||||
# the variables above. If something really needs to be changed, try to make
|
||||
# the change in all the drivers for the sake of consistency.
|
||||
|
||||
# We shouldn't use lock files anymore because the lock file
|
||||
# doesn't mean a driver is disabled or enabled. For example, we start()
|
||||
# at boot and enable the driver. start() makes a lock file. We stop() on
|
||||
# shutdown, which removes the lock file. But what if the user ran *config-display
|
||||
# manually? Or if we don't `*config-display disable` in stop()?
|
||||
|
||||
start() {
|
||||
if action $"Checking for module $modname:" test -f $module;then
|
||||
action $"Enabling the $name driver:" $exec enable
|
||||
RETVAL=$?
|
||||
[ -e /sbin/restorecon ] && /sbin/restorecon /dev/nvidia{ctl,0,1,2,3}
|
||||
else
|
||||
echo -en $"$modname for kernel $(uname -r) was not found." && echo_warning;echo -en '\n'
|
||||
echo -en $"The $name driver will not be enabled until one is found." && echo_warning;echo -en '\n'
|
||||
$exec disable
|
||||
RETVAL=1
|
||||
fi
|
||||
if [ "$RETVAL" -eq "0" ];then
|
||||
#touch $lockfile
|
||||
# this is a nothing assignment so that bash doesn't complain.
|
||||
RETVAL=0
|
||||
else
|
||||
# Let them read the errors or warnings
|
||||
sleep 3
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
stop() {
|
||||
#action $"Disabling the $name driver:" $exec disable
|
||||
#RETVAL=$?
|
||||
RETVAL=0
|
||||
#if [ "$RETVAL" -eq 0 ];then
|
||||
# rm -f $lockfile
|
||||
#fi
|
||||
return
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
restart
|
||||
}
|
||||
|
||||
status() {
|
||||
#if [ -e $lockfile ];then
|
||||
if [ -f $module ] && lsmod | grep ^${modname%%.ko} &>/dev/null ;then
|
||||
echo $"$modname for kernel $(uname -r) was found."
|
||||
echo $"The driver is enabled."
|
||||
else
|
||||
echo $"$modname for kernel $(uname -r) was not found."
|
||||
echo $"The $name driver cannot be enabled until one is found."
|
||||
fi
|
||||
#else
|
||||
# echo $"The $name driver has not been enabled."
|
||||
#fi
|
||||
RETVAL=0
|
||||
}
|
||||
|
||||
fdrstatus() {
|
||||
status $prog
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
$1
|
||||
;;
|
||||
status)
|
||||
fdrstatus
|
||||
;;
|
||||
condrestart)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
@ -1,2 +1,2 @@
|
||||
702868c77b13bba46f0fce26ed7a1fb7 NVIDIA-Linux-x86-270.41.06.run
|
||||
76d94f513731c75bdc4b763a3501cd4e NVIDIA-Linux-x86_64-270.41.06.run
|
||||
c167e32702f56599bd600add97943312 NVIDIA-Linux-x86-270.41.19.run
|
||||
b84143ecb5c0511c5ef9e53e732d9136 NVIDIA-Linux-x86_64-270.41.19.run
|
||||
|
Loading…
Reference in new issue