Add support for Fedora 41 (TuneD) | #786
This commit is contained in:
parent
7b03630a5e
commit
6a13948458
|
@ -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.
|
- 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).
|
- 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)
|
### Gentoo Linux (GURU Repository)
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, stats, g
|
||||||
else:
|
else:
|
||||||
gnome_power_detect_install()
|
gnome_power_detect_install()
|
||||||
gnome_power_stop_live()
|
gnome_power_stop_live()
|
||||||
|
tuned_stop_live()
|
||||||
tlp_service_detect()
|
tlp_service_detect()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -107,6 +108,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, stats, g
|
||||||
countdown(2)
|
countdown(2)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
gnome_power_start_live()
|
gnome_power_start_live()
|
||||||
|
tuned_start_live()
|
||||||
print()
|
print()
|
||||||
break
|
break
|
||||||
conf.notifier.stop()
|
conf.notifier.stop()
|
||||||
|
|
|
@ -324,6 +324,8 @@ def deploy_daemon():
|
||||||
gnome_power_detect_install()
|
gnome_power_detect_install()
|
||||||
gnome_power_svc_disable()
|
gnome_power_svc_disable()
|
||||||
|
|
||||||
|
tuned_svc_disable()
|
||||||
|
|
||||||
tlp_service_detect() # output warning if TLP service is detected
|
tlp_service_detect() # output warning if TLP service is detected
|
||||||
|
|
||||||
call("/usr/local/bin/auto-cpufreq-install", shell=True)
|
call("/usr/local/bin/auto-cpufreq-install", shell=True)
|
||||||
|
@ -372,6 +374,8 @@ def remove_daemon():
|
||||||
gnome_power_rm_reminder()
|
gnome_power_rm_reminder()
|
||||||
gnome_power_svc_enable()
|
gnome_power_svc_enable()
|
||||||
|
|
||||||
|
tuned_svc_enable()
|
||||||
|
|
||||||
# run auto-cpufreq daemon remove script
|
# run auto-cpufreq daemon remove script
|
||||||
call("/usr/local/bin/auto-cpufreq-remove", shell=True)
|
call("/usr/local/bin/auto-cpufreq-remove", shell=True)
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ bluetoothctl_exists = does_command_exists("bluetoothctl")
|
||||||
powerprofilesctl_exists = does_command_exists("powerprofilesctl")
|
powerprofilesctl_exists = does_command_exists("powerprofilesctl")
|
||||||
systemctl_exists = does_command_exists("systemctl")
|
systemctl_exists = does_command_exists("systemctl")
|
||||||
tlp_stat_exists = does_command_exists("tlp-stat")
|
tlp_stat_exists = does_command_exists("tlp-stat")
|
||||||
|
tuned_stat_exists = does_command_exists("tuned")
|
||||||
|
|
||||||
# detect if gnome power profile service is running
|
# detect if gnome power profile service is running
|
||||||
if not IS_INSTALLED_WITH_SNAP:
|
if not IS_INSTALLED_WITH_SNAP:
|
||||||
|
@ -99,10 +100,18 @@ def gnome_power_stop_live():
|
||||||
call(["powerprofilesctl", "set", "balanced"])
|
call(["powerprofilesctl", "set", "balanced"])
|
||||||
call(["systemctl", "stop", "power-profiles-daemon"])
|
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)
|
# starts gnome >= 40 power profiles (live)
|
||||||
def gnome_power_start_live():
|
def gnome_power_start_live():
|
||||||
if systemctl_exists: call(["systemctl", "start", "power-profiles-daemon"])
|
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)
|
# enable gnome >= 40 power profiles (uninstall)
|
||||||
def gnome_power_svc_enable():
|
def gnome_power_svc_enable():
|
||||||
if systemctl_exists:
|
if systemctl_exists:
|
||||||
|
@ -117,6 +126,17 @@ def gnome_power_svc_enable():
|
||||||
print("If this causes any problems, please submit an issue:")
|
print("If this causes any problems, please submit an issue:")
|
||||||
print(GITHUB+"/issues")
|
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
|
# gnome power profiles current status
|
||||||
def gnome_power_svc_status():
|
def gnome_power_svc_status():
|
||||||
if systemctl_exists:
|
if systemctl_exists:
|
||||||
|
@ -209,6 +229,17 @@ def disable_power_profiles_daemon():
|
||||||
print("If this causes any problems, please submit an issue:")
|
print("If this causes any problems, please submit an issue:")
|
||||||
print(GITHUB+"/issues")
|
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)
|
# default gnome_power_svc_disable func (balanced)
|
||||||
def gnome_power_svc_disable():
|
def gnome_power_svc_disable():
|
||||||
snap_pkg_check = 0
|
snap_pkg_check = 0
|
||||||
|
@ -245,6 +276,10 @@ def gnome_power_svc_disable():
|
||||||
|
|
||||||
disable_power_profiles_daemon()
|
disable_power_profiles_daemon()
|
||||||
|
|
||||||
|
def tuned_svc_disable():
|
||||||
|
if systemctl_exists and tuned_stat_exists:
|
||||||
|
disable_tuned_daemon()
|
||||||
|
|
||||||
# cli
|
# cli
|
||||||
@click.command()
|
@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))
|
#@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))
|
||||||
|
|
Loading…
Reference in New Issue