mirror of
https://abf.rosa.ru/djam/kernel-6.7-xanmod.git
synced 2025-02-24 01:22:47 +00:00
cpupower: Use 'performance' instead of '<not_supported>' on failure
At least, it will be easier to start the service this way, although this does not solve bug #4810 yet.
This commit is contained in:
parent
1f160d2b5e
commit
85fcd22a4c
1 changed files with 8 additions and 6 deletions
14
kernel.spec
14
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@/<not_supported>/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@/<not_supported>/g' "${CFG_FILE}"
|
||||
sed -i 's/@GOVERNOR@/performance/g' "${CFG_FILE}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue