systemd oneshot service to set sleep boolean on Apple Macbook Pro disks Original by Pier Lim. Posted at https://kerpanic.wordpress.com/2018/03/13/apple-keyboard-get-function-keys-working-properly-in-ubuntu/
/etc/systemd/system/fix_sleep.service
:
[Unit]
Description=Job that disables sleep from stopping nvme hardware on MBP
[Service]
ExecStart=/sbin/fixsleep
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
And the actual script:
/sbin/fixsleep
:
#!/bin/bash
/bin/echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed