0

I'm using Fedora 30 on a laptop. I've tried setting power tune parameters using the systemd service that comes with powertop (powertop.service) and that didn't work. I then tried creating a shell script along with a custom .service file to run it at boot and that doesn't work either, checking the parameters after a reboot with powertop shows them not to have been changed. Running the script after logging in works.

custom script '/root/bin/powertune-HPEnvy.sh'

#!/bin/sh
 echo '1' > '/sys/module/snd_hda_intel/parameters/power_save'; 
 echo 'auto' > '/sys/bus/i2c/devices/i2c-0/device/power/control'; 
 echo 'auto' > '/sys/bus/i2c/devices/i2c-2/device/power/control'; 
 echo 'auto' > '/sys/bus/i2c/devices/i2c-6/device/power/control'; 
 echo 'auto' > '/sys/bus/i2c/devices/i2c-1/device/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:02:00.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:14.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:08.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:15.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.4/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:01:00.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:15.1/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:14.2/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:04.0/power/control'; 
 echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/power/control'; 




 echo 'enabled' > '/sys/class/net/wlp1s0/device/power/wakeup'; 
 echo 'enabled' > '/sys/bus/usb/devices/usb1/power/wakeup'; 
 echo 'enabled' > '/sys/bus/usb/devices/usb2/power/wakeup'; 

custom systemd service '/etc/systemd/system/powertune-HPEnvy.service'

[Unit]
Description=Set HP Envy 15-as133cl powersaving

[Service]
Type=oneshot
ExecStart=/root/bin/powertune-HPEnvy.sh


[Install]
WantedBy=multi-user.target
0

I've gotten it to work by changing

WantedBy=multi-user.target 

to

WantedBy=basic.target

then adding a sleep 10 to the beginning of the shell script, and then disabling/reenabling the systemd service. Now on reboot, the script takes effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.