Add support for Fedora 41 (TuneD) | #786

This commit is contained in:
Giovanni Geraci 2024-11-02 17:30:51 +01:00 committed by GitHub
parent 7b03630a5e
commit 6a13948458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 42 additions and 0 deletions

View File

@ -146,6 +146,7 @@ The AUR [Release Package](https://aur.archlinux.org/packages/auto-cpufreq) is cu
```
- The GNOME Power Profiles daemon is [automatically disabled by auto-cpufreq-installer](https://github.com/AdnanHodzic/auto-cpufreq#1-power_helperpy-script-snap-package-install-only) due to it's conflict with auto-cpufreq.service. However, this doesn't happen with AUR installs, which can lead to problems (e.g., [#463](https://github.com/AdnanHodzic/auto-cpufreq/issues/463)) if not masked manually.
- Open a terminal and run `sudo systemctl mask power-profiles-daemon.service` (then `enable` and `start` the auto-cpufreq.service if you haven't already).
- The TuneD daemon(enabled by default with Fedora 41) is [automatically disabled by auto-cpufreq-installer](https://github.com/AdnanHodzic/auto-cpufreq#1-power_helperpy-script-snap-package-install-only) due to it's conflict with auto-cpufreq.service.
### Gentoo Linux (GURU Repository)

View File

@ -94,6 +94,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, stats, g
else:
gnome_power_detect_install()
gnome_power_stop_live()
tuned_stop_live()
tlp_service_detect()
while True:
try:
@ -107,6 +108,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, stats, g
countdown(2)
except KeyboardInterrupt:
gnome_power_start_live()
tuned_start_live()
print()
break
conf.notifier.stop()

View File

@ -324,6 +324,8 @@ def deploy_daemon():
gnome_power_detect_install()
gnome_power_svc_disable()
tuned_svc_disable()
tlp_service_detect() # output warning if TLP service is detected
call("/usr/local/bin/auto-cpufreq-install", shell=True)
@ -372,6 +374,8 @@ def remove_daemon():
gnome_power_rm_reminder()
gnome_power_svc_enable()
tuned_svc_enable()
# run auto-cpufreq daemon remove script
call("/usr/local/bin/auto-cpufreq-remove", shell=True)

View File

@ -25,6 +25,7 @@ bluetoothctl_exists = does_command_exists("bluetoothctl")
powerprofilesctl_exists = does_command_exists("powerprofilesctl")
systemctl_exists = does_command_exists("systemctl")
tlp_stat_exists = does_command_exists("tlp-stat")
tuned_stat_exists = does_command_exists("tuned")
# detect if gnome power profile service is running
if not IS_INSTALLED_WITH_SNAP:
@ -99,10 +100,18 @@ def gnome_power_stop_live():
call(["powerprofilesctl", "set", "balanced"])
call(["systemctl", "stop", "power-profiles-daemon"])
# stops tuned (live)
def tuned_stop_live():
if systemctl_exists and tuned_stat_exists:
call(["systemctl", "stop", "tuned"])
# starts gnome >= 40 power profiles (live)
def gnome_power_start_live():
if systemctl_exists: call(["systemctl", "start", "power-profiles-daemon"])
def tuned_start_live():
if systemctl_exists: call(["systemctl", "start", "tuned"])
# enable gnome >= 40 power profiles (uninstall)
def gnome_power_svc_enable():
if systemctl_exists:
@ -117,6 +126,17 @@ def gnome_power_svc_enable():
print("If this causes any problems, please submit an issue:")
print(GITHUB+"/issues")
def tuned_svc_enable():
if systemctl_exists:
try:
print("* Enabling TuneD\n")
call(["systemctl", "unmask", "tuned"])
call(["systemctl", "enable", "--now", "tuned"])
except:
print("\nUnable to enable GNOME power profiles")
print("If this causes any problems, please submit an issue:")
print(GITHUB+"/issues")
# gnome power profiles current status
def gnome_power_svc_status():
if systemctl_exists:
@ -209,6 +229,17 @@ def disable_power_profiles_daemon():
print("If this causes any problems, please submit an issue:")
print(GITHUB+"/issues")
def disable_tuned_daemon():
# always disable TuneD daemon
try:
print("\n* Disabling TuneD daemon")
call(["systemctl", "disable", "--now", "tuned"])
call(["systemctl", "mask", "tuned"])
except:
print("\nUnable to disable TuneD daemon")
print("If this causes any problems, please submit an issue:")
print(GITHUB+"/issues")
# default gnome_power_svc_disable func (balanced)
def gnome_power_svc_disable():
snap_pkg_check = 0
@ -245,6 +276,10 @@ def gnome_power_svc_disable():
disable_power_profiles_daemon()
def tuned_svc_disable():
if systemctl_exists and tuned_stat_exists:
disable_tuned_daemon()
# cli
@click.command()
#@click.option("--gnome_power_disable", help="Disable GNOME Power profiles service (default: balanced), reference:\n https://bit.ly/3bjVZW1", type=click.Choice(['balanced', 'performance'], case_sensitive=False))