Add scripts to make dev easier

This commit is contained in:
Jeremy Soller 2018-02-14 13:56:01 -07:00
parent 0bea02cb05
commit b84c05f9bb
3 changed files with 62 additions and 0 deletions

6
scripts/rebuild.sh Executable file
View File

@ -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

28
scripts/turn_off_gpu.sh Executable file
View File

@ -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

28
scripts/turn_on_gpu.sh Executable file
View File

@ -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