diff --git a/README.md b/README.md index f005903..939e700 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ a device (e.g. L0s, L0sL1 or L1). sudo autoaspm.py ``` +#### Automatially apply on boot +Copy the `auto-aspm.service` systemd service file into the `/etc/systemd/system/`-directory. Edit the file and change the `WorkingDirectory` to the directory where you have saved the `autoaspm.py` file and replace the path to the python3 interpreter and the path to the script on the `ExecStart` line. Once that is done, run `systemctl daemon-reload` to update systemd service definitions and then run `systemctl enable auto-aspm.service` to run the script on boot or `systemctl enable --now auto-aspm.service` to run now and on boot. + ### Credits - Luis R. Rodriguez for writing the original enable_aspm script: diff --git a/auto-aspm.service b/auto-aspm.service new file mode 100644 index 0000000..b0f438e --- /dev/null +++ b/auto-aspm.service @@ -0,0 +1,11 @@ +[Unit] +Description=Run the autoaspm.py script to enable supported ASPM levels for PCIe devices. + +[Service] +User=root +WorkingDirectory=/root/ +ExecStart=/usr/bin/python3 /root/autoaspm.py +Restart=on-failure + +[Install] +WantedBy=multi-user.target