#!/sbin/runscript # Copyright 1999-2005 Peter Urquhart # Distributed under the terms of the GNU General Public License v2 depend() { before xdm } start() { ebegin "Applying modified mask for graphics card" rmmod nvidia /usr/bin/nvtuner $MASK_CUSTOM $MEM_LOC &>/dev/null modprobe nvidia eend $? } stop() { ebegin "Reverting to standard mask for graphics card" rmmod nvidia /usr/bin/nvtuner $MASK_DEFAULT $MEM_LOC &>/dev/null modprobe nvidia eend $? } #if [ -e "/proc/config.gz" ] # then if [ `gzcat /proc/config.gz | grep "CONFIG_MODULE_UNLOAD=y` != "" ] # then unload="true" # fi #fi #if [ `lsmod | cut -d " " -f 1 | grep "nvidia"` = "" ] # then nvidia_not_loaded="true" #fi #if [[ $unload || $nvidia_not_loaded ]] # then rmmod nvidia # else ewarn "Cannot unload module. Please recompile kernel with module unloading support" #fi # Structure # # 1) Check if we have module unloading support # a) Look for /proc/config.gz first # b) Failing that, check uname -r and look in /usr/src/$ver/.config # 2) If we don't have module unloading support, warn and explain what to do, try to run once # 3) If we do have module unloading support, run as many times as necessary to get it working? # Or a set number of times? # 4) Each run consists of checking if the module is loaded, rmmod'ing if necessary, applying # the new mask, reloading the module. # 5) After each run, check if it took. If so, rock on. If not, keep trying, or run up to a set # number of times, then error out, give up and load the module anyway. # 6) Stop is the same, but with the original mask #