Skip to content

Instantly share code, notes, and snippets.

@vinzenzweber
Last active March 16, 2019 20:30
Show Gist options
  • Save vinzenzweber/3f197d9c9090a2e960f3350893c08949 to your computer and use it in GitHub Desktop.
Save vinzenzweber/3f197d9c9090a2e960f3350893c08949 to your computer and use it in GitHub Desktop.
arch
#!/bin/sh
cd /
umount /sys/firmware/efi/efivars/
mount -t efivarfs rw /sys/firmware/efi/efivars/
cd /sys/firmware/efi/efivars/
chattr -i "gpu-power-prefs-*"
rm gpu-power-prefs-*
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9
chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"
cd /
umount /sys/firmware/efi/efivars/
while true; do
read -p "Do you wish to reboot?" yn
case $yn in
[Yy]* ) reboot; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment