From 0860cebf13a2ae8857b852cd31d4512043486456 Mon Sep 17 00:00:00 2001 From: Tim Panajott Date: Mon, 30 Jun 2025 13:38:21 +0200 Subject: [PATCH 1/3] Create auto-aspm.service Add a systemd service definition file for users that want to apply settings automatically. --- auto-aspm.service | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 auto-aspm.service diff --git a/auto-aspm.service b/auto-aspm.service new file mode 100644 index 0000000..ad09b82 --- /dev/null +++ b/auto-aspm.service @@ -0,0 +1,11 @@ +[Unit] +Description=Run the autoaspm.py script to enable suppoerted 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 From ffb68612dc862911936bc7697fb13839cd217347 Mon Sep 17 00:00:00 2001 From: Tim Panajott Date: Mon, 30 Jun 2025 13:42:11 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) 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: From 0c9d1c4e0f92a00b530a1b3d7cae5eeef92d8cf4 Mon Sep 17 00:00:00 2001 From: Tim Panajott Date: Mon, 30 Jun 2025 13:44:24 +0200 Subject: [PATCH 3/3] Update auto-aspm.service Fix typo --- auto-aspm.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-aspm.service b/auto-aspm.service index ad09b82..b0f438e 100644 --- a/auto-aspm.service +++ b/auto-aspm.service @@ -1,5 +1,5 @@ [Unit] -Description=Run the autoaspm.py script to enable suppoerted ASPM levels for PCIe devices. +Description=Run the autoaspm.py script to enable supported ASPM levels for PCIe devices. [Service] User=root