This is a small PSA to give some love to the powertop2tuned tool, that took me a couple of hours to learn existed while I was troubleshooting. Simply put, this will allow you to have the powertop auto-tune ‘Good’ settings without having to keep powertop on your system.
First of all: why?
This is guided for those that want to apply powertop’s powersavings while seeking extremely minimal systems or that, like me, use Fedora Atomic and wants to layer as few packages as possible.
I was personally seeking a way to do so but every single result pointed me to using scripts that felt too hacky or learn how to create udev rules, which is kind of tedious and complicated. This is a lot simpler, and a lot faster than both, I believe.
In my personal case, the powertop recommendations usually help me recover about 15-20 extra minutes of battery life on my laptop, and since I just got a new battery for it after the old one died, I went looking for a way to make this happen, and since I found it, I believe sharing is caring for the community.
Ok, show me how.
First of all, you need to actually have powertop and the tools neeeded in the first place. Don’t worry, you’ll be able to uninstall them after we’re done. First of all, depending on whether you’re running our regular editions or Fedora Atomic, respectively, run:
sudo dnf install powertop tuned-utils
or
rpm-ostree install powertop tuned-utils (--apply-now in case you don't want to restart before doing this)
By default it creates the profile in the /etc/tuned directory and it bases it on the currently selected tuned profile. So, my personal recommendation is to run the following command three times, once for the balanced profile (while plugged to the AC), once for the powersaver profile and once again for the balanced profile (while on battery, for the laptop users):
powertop2tuned profile_name --enable
Personally, the profiles I created (and will use the names as reference) are balanced_powertop, balanced-battery_powertop and powersave_powertop.
After that, just change the name of the profiles to the ones you created in /etc/tuned/ppd.conf and save!
How the file should look before the changes
[main]
# The default PPD profile
default=balanced
battery_detection=true
sysfs_acpi_monitor=true
[profiles]
# PPD = TuneD
power-saver=powersave
balanced=balanced
performance=throughput-performance
[battery]
# PPD = TuneD
balanced=balanced-battery
How the file should look after the changes
[main]
# The default PPD profile
default=balanced
battery_detection=true
sysfs_acpi_monitor=true
[profiles]
# PPD = TuneD
power-saver=powersave_powertop
balanced=balanced_powertop
performance=throughput-performance
[battery]
# PPD = TuneD
balanced=balanced-battery_powertop
As soon as you change profiles, it will be applied and you can simply uninstall the packages you installed earlier!
That’s great, but will this enable USB autosuspend like powertop --auto-tune does?
It shouldn’t, but if you want to be sure (or just tinker with and fine tune the things that were enabled, you can edit /etc/tuned/profiles/[name of the profile you created]/tuned.conf.