diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh new file mode 100755 index 0000000..b30bbbd --- /dev/null +++ b/scripts/rebuild.sh @@ -0,0 +1,6 @@ +debuild -b -uc -us +sudo dpkg -i ../system76-dkms_0.0.1_amd64.deb +cat /var/lib/dkms/system76/0.0.1/build/make.log +sudo modprobe -r system76 +sudo modprobe system76 +dmesg -w | grep system76 diff --git a/scripts/turn_off_gpu.sh b/scripts/turn_off_gpu.sh new file mode 100755 index 0000000..32397fc --- /dev/null +++ b/scripts/turn_off_gpu.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +modprobe acpi_call + +if lsmod | grep -q acpi_call; then +methods=" +\_SB.PCI0.PEG0.PEGP._OFF +" + +for m in $methods; do + echo -n "Trying $m: " + echo $m > /proc/acpi/call + result=$(cat /proc/acpi/call) + case "$result" in + Error*) + echo "failed" + ;; + *) + echo "works!" + # break # try out outher methods too + ;; + esac +done + +else + echo "The acpi_call module is not loaded, try running 'modprobe acpi_call' or 'insmod acpi_call.ko' as root" + exit 1 +fi diff --git a/scripts/turn_on_gpu.sh b/scripts/turn_on_gpu.sh new file mode 100755 index 0000000..d0f1686 --- /dev/null +++ b/scripts/turn_on_gpu.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +modprobe acpi_call + +if lsmod | grep -q acpi_call; then +methods=" +\_SB.PCI0.PEG0.PEGP._ON +" + +for m in $methods; do + echo -n "Trying $m: " + echo $m > /proc/acpi/call + result=$(cat /proc/acpi/call) + case "$result" in + Error*) + echo "failed" + ;; + *) + echo "works!" + # break # try out outher methods too + ;; + esac +done + +else + echo "The acpi_call module is not loaded, try running 'modprobe acpi_call' or 'insmod acpi_call.ko' as root" + exit 1 +fi