How to permanently save powertop's suggestions?
I run powertop then it suggests that I should disable xy, etc. However, after I exit powertop, reboot the pc, and start it again[powertop], it brings up the same tips again! So how can I permanently save the suggestions of powertop?
Solution 1:
Quick answer :
You just need to save them in /etc/rc.local
.
Detailed answer
-
In a terminal run:
sudo powertop --html=powertop.html
Step 1 generates a html file in your home directory. Click on that file so that it opens in your internet browser.
In the browser, go to "Tuning" tab. It gives all the tunings you have to tweak (on the left), and the commands that are implementing them (on the right).
-
Save these commands in
/etc/rc.local
.To do that, in a terminal, run:
gksu gedit /etc/rc.local
Write the commands before the line that reads
exit 0
, and save the file.
Solution 2:
Saving to rc.local as stagelll mentions is probably the simplest way to do it, but it's obviously only good for a local fix.
Another way would be to craft a udev rule that applies the setting for the device in question. udev rules are more complicated to write but are safer to share with others.
For example, powertop suggested this:
echo 'on' > '/sys/bus/usb/devices/3-10/power/control';
which solved the particular issue I was interested in. But 3-10
is a bus number that's going to vary from system to system, depending on how the usb devices are attached. After a bit of research and fiddling, I made a file /etc/udev/rules.d/10-usb-avocent-kvm-pm.rules
with this rule, which sets power/control to on for my devices, wherever it might be connected in the USB subsystem:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0624", ATTR{idProduct}=="0013", ATTR{product}=="SC Secure KVM", TEST=="power/control", ATTR{power/control}:="on"