Skip to content

Instantly share code, notes, and snippets.

@Waltibaba
Created November 13, 2019 21:27
Show Gist options
  • Save Waltibaba/58a2c2473cb111bdaa4fb62ca0639bc6 to your computer and use it in GitHub Desktop.
Save Waltibaba/58a2c2473cb111bdaa4fb62ca0639bc6 to your computer and use it in GitHub Desktop.
suspend hook for tpm issues on kernel 5.1+
#!/bin/bash
# put this in /usr/lib/systemd/system-sleep/
# don't forget to chmod +x it
case $1/$2 in
pre/*)
# echo "Going to $2..."
/usr/bin/rmmod tpm
/usr/bin/rmmod tpm_tis
/usr/bin/rmmod tpm_tis_core
;;
post/*)
# echo "Waking up from $2..."
/usr/bin/modprobe tpm
/usr/bin/modprobe tpm_tis
/usr/bin/modprobe tpm_tis_core
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment