Add check for performance governor in available governors
This commit is contained in:
parent
8ff85e9371
commit
a15e594fba
|
@ -371,10 +371,14 @@ def deploy_daemon():
|
||||||
|
|
||||||
|
|
||||||
def deploy_daemon_performance():
|
def deploy_daemon_performance():
|
||||||
print("\n" + "-" * 21 + " Deploying auto-cpufreq as a daemon " + "-" * 22 + "\n")
|
print("\n" + "-" * 21 + " Deploying auto-cpufreq as a daemon (performance) " + "-" * 22 + "\n")
|
||||||
|
|
||||||
# ToDo:
|
# check that performance is in scaling_available_governors
|
||||||
# add check that performance exists otherwise exit
|
with open("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") as available_governors:
|
||||||
|
if "performance" not in available_governors.read():
|
||||||
|
print("\"perfomance\" governor is unavailable on this system, run:\n"
|
||||||
|
"sudo sudo auto-cpufreq --install\n\n"
|
||||||
|
"to install auto-cpufreq using default \"balanced\" governor.\n")
|
||||||
|
|
||||||
# deploy cpufreqctl script func call
|
# deploy cpufreqctl script func call
|
||||||
cpufreqctl()
|
cpufreqctl()
|
||||||
|
|
|
@ -177,10 +177,9 @@ def main(config, daemon, debug, install, install_performance, live, log, monitor
|
||||||
elif install_performance:
|
elif install_performance:
|
||||||
if os.getenv("PKG_MARKER") == "SNAP":
|
if os.getenv("PKG_MARKER") == "SNAP":
|
||||||
root_check()
|
root_check()
|
||||||
print("This option is only available on non Snap installs"
|
print("This option is only available on non Snap installs\n"
|
||||||
"Please refer to: power_helper.py script for more info\n")
|
"Please refer to auto-cpufreq power_helper.py script for more info\n")
|
||||||
else:
|
else:
|
||||||
print("in performance")
|
|
||||||
root_check()
|
root_check()
|
||||||
running_daemon()
|
running_daemon()
|
||||||
gov_check()
|
gov_check()
|
||||||
|
@ -198,7 +197,6 @@ def main(config, daemon, debug, install, install_performance, live, log, monitor
|
||||||
run("snapctl start --enable auto-cpufreq", shell=True)
|
run("snapctl start --enable auto-cpufreq", shell=True)
|
||||||
deploy_complete_msg()
|
deploy_complete_msg()
|
||||||
else:
|
else:
|
||||||
print("in install")
|
|
||||||
root_check()
|
root_check()
|
||||||
running_daemon()
|
running_daemon()
|
||||||
gov_check()
|
gov_check()
|
||||||
|
|
Loading…
Reference in New Issue