Try all power methods with higher priority for acpi_call
This commit is contained in:
parent
7e67c7f4cf
commit
137559106b
|
@ -4,22 +4,6 @@ TRIES=8
|
|||
|
||||
lsmod | grep '^nouveau ' >/dev/null && modprobe -rf nouveau &>/dev/null
|
||||
|
||||
# Trying vgaswitcheroo method
|
||||
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
|
||||
let tries=$TRIES
|
||||
while [ 0 -lt $tries ]; do
|
||||
modprobe -r nvidia \
|
||||
&& echo 'OFF' > /sys/kernel/debug/vgaswitcheroo/switch \
|
||||
&& exit 0
|
||||
|
||||
sleep 0.01
|
||||
let tries--
|
||||
echo "tries left: $tries"
|
||||
done
|
||||
echo "Cann't power off nVidia chip ;-("
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Trying acpi_call method
|
||||
if [ -f /proc/acpi/call ]; then
|
||||
model=`dmidecode $@ -s system-product-name`
|
||||
|
@ -112,5 +96,19 @@ if [ -f /proc/acpi/call ]; then
|
|||
done
|
||||
fi
|
||||
|
||||
# Trying vgaswitcheroo method
|
||||
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
|
||||
let tries=$TRIES
|
||||
while [ 0 -lt $tries ]; do
|
||||
modprobe -r nvidia \
|
||||
&& echo 'OFF' > /sys/kernel/debug/vgaswitcheroo/switch \
|
||||
&& exit 0
|
||||
|
||||
sleep 0.01
|
||||
let tries--
|
||||
echo "tries left: $tries"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "Cann't power off nVidia chip"
|
||||
exit -1
|
||||
|
|
|
@ -4,22 +4,6 @@ TRIES=8
|
|||
|
||||
lsmod | grep '^nouveau ' >/dev/null && modprobe -rf nouveau &>/dev/null
|
||||
|
||||
# Trying vgaswitcheroo method
|
||||
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
|
||||
let tries=$TRIES
|
||||
while [ 0 -lt $tries ]; do
|
||||
echo 'ON' > /sys/kernel/debug/vgaswitcheroo/switch \
|
||||
&& modprobe nvidia \
|
||||
&& exit 0
|
||||
|
||||
sleep 0.01
|
||||
let tries--
|
||||
echo "tries left: $tries"
|
||||
done
|
||||
echo "Cann't power on nVidia chip ;-("
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Trying acpi_call method
|
||||
if [ -f /proc/acpi/call ]; then
|
||||
model=`dmidecode $@ -s system-product-name`
|
||||
|
@ -112,5 +96,19 @@ if [ -f /proc/acpi/call ]; then
|
|||
done
|
||||
fi
|
||||
|
||||
# Trying vgaswitcheroo method
|
||||
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
|
||||
let tries=$TRIES
|
||||
while [ 0 -lt $tries ]; do
|
||||
echo 'ON' > /sys/kernel/debug/vgaswitcheroo/switch \
|
||||
&& modprobe nvidia \
|
||||
&& exit 0
|
||||
|
||||
sleep 0.01
|
||||
let tries--
|
||||
echo "tries left: $tries"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "Cann't power on nVidia chip"
|
||||
exit -1
|
||||
|
|
Loading…
Reference in New Issue