bbswitch support

This commit is contained in:
Kolan Sh 2012-04-15 21:31:08 +04:00
parent 6651c663bb
commit 4c49d9d40a
2 changed files with 29 additions and 0 deletions

View File

@ -4,6 +4,20 @@ TRIES=8
lsmod | grep '^nouveau ' >/dev/null && modprobe -rf nouveau &>/dev/null
# Trying bbswitch method
if [ -f /proc/acpi/bbswitch ]; then
let tries=$TRIES
while [ 0 -lt $tries ]; do
modprobe -r nvidia \
&& echo 'OFF' > /proc/acpi/bbswitch \
&& exit 0
sleep 0.01
let tries--
echo "tries left: $tries"
done
fi
# Trying acpi_call method
if [ -f /proc/acpi/call ]; then
model=`dmidecode $@ -s system-product-name`

View File

@ -4,6 +4,21 @@ TRIES=8
lsmod | grep '^nouveau ' >/dev/null && modprobe -rf nouveau &>/dev/null
# Trying bbswitch method
if [ -f /proc/acpi/bbswitch ]; then
let tries=$TRIES
while [ 0 -lt $tries ]; do
echo 'ON' > /proc/acpi/bbswitch \
&& modprobe nvidia \
&& exit 0
sleep 0.01
let tries--
echo "tries left: $tries"
done
fi
# Trying acpi_call method
if [ -f /proc/acpi/call ]; then
model=`dmidecode $@ -s system-product-name`