From 85fcd22a4caf74bc28cbac6ae8e4fe739981788f Mon Sep 17 00:00:00 2001 From: Eugene Shatokhin Date: Mon, 9 Feb 2015 21:00:36 +0300 Subject: [PATCH] cpupower: Use 'performance' instead of '' on failure At least, it will be easier to start the service this way, although this does not solve bug #4810 yet. --- kernel.spec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel.spec b/kernel.spec index 7f3bb40..850b7ef 100644 --- a/kernel.spec +++ b/kernel.spec @@ -29,7 +29,7 @@ %define rpmrel %mkrel 0.%{kpatch}.%{mibrel} %endif %else -%define rpmrel 1 +%define rpmrel 2 %endif # fakerel and fakever never change, they are used to fool @@ -1034,12 +1034,14 @@ CFG_FILE=%{_sysconfdir}/sysconfig/cpupower if ! [ -e "${AVAIL_FILE}" ]; then echo "Warning: CPU frequency scaling is not supported." - sed -i 's/@GOVERNOR@//g' "${CFG_FILE}" + echo "Setting 'performance' governor as the default, just in case." + sed -i 's/@GOVERNOR@/performance/g' "${CFG_FILE}" exit 0 fi -# Set "ondemand" or "powersave" by default. Do not enable cpupower.service -# if neither are supported. +# Set "ondemand" or "powersave" by default, if they are supported, +# "performance" otherwise. +# ? Perhaps it is better to do this in runtime rather than here? if grep "ondemand" "${AVAIL_FILE}" >/dev/null 2>&1; then echo "Info: setting 'ondemand' governor as the default." sed -i 's/@GOVERNOR@/ondemand/g' "${CFG_FILE}" @@ -1047,10 +1049,10 @@ elif grep "powersave" "${AVAIL_FILE}" >/dev/null 2>&1; then echo "Info: setting 'powersave' governor as the default." sed -i 's/@GOVERNOR@/powersave/g' "${CFG_FILE}" else - echo -n "Warning: not setting the default governor. Available governors:" + echo -n "Info: setting 'performance' governor as the default." cat "${AVAIL_FILE}" echo - sed -i 's/@GOVERNOR@//g' "${CFG_FILE}" + sed -i 's/@GOVERNOR@/performance/g' "${CFG_FILE}" exit 0 fi