Skip to content

Instantly share code, notes, and snippets.

@guilhem
Last active March 30, 2024 20:50
Show Gist options
  • Save guilhem/d372e8a257d5f67678ea33c662c48f39 to your computer and use it in GitHub Desktop.
Save guilhem/d372e8a257d5f67678ea33c662c48f39 to your computer and use it in GitHub Desktop.
a set of systemd unit to fix tpm errors "tpm tpm0: a tpm error (256) occurred attempting get random"
[Unit]
Description=Execute TPM2 Startup with Delay After Suspend
After=systemd-suspend.service systemd-hybrid-sleep.service systemd-hibernate.service
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/tpm2_startup
[Install]
WantedBy=sleep.target
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment