Commit f600db8c authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Make CPU speed adjustements big/little compatible

parent 1a2d2023
...@@ -83,11 +83,13 @@ do ...@@ -83,11 +83,13 @@ do
MENUTITLE="Configure \Z1$DISTRO $DISTROID\Z0" MENUTITLE="Configure \Z1$DISTRO $DISTROID\Z0"
# read cpu speed # read cpu speed
num=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq 2> /dev/null) POLICY="policy0"
[[ $(grep -c '^processor' /proc/cpuinfo) -ge 4 ]] && POLICY="policy4"
num=$(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_min_freq 2> /dev/null)
if [[ -f /etc/default/cpufrequtils && ! -z "${num##*[!0-9]*}" ]]; then if [[ -f /etc/default/cpufrequtils && ! -z "${num##*[!0-9]*}" ]]; then
FREQENCIES="\n"$(LC_ALL="C" cpufreq-info | grep policy | sed "s/ current policy: //" | sed 's/.*/\u&/' | tail -1)"\n" FREQENCIES="\n"$(LC_ALL="C" cpufreq-info | grep policy | sed "s/ current policy: //" | sed 's/.*/\u&/' | tail -1)"\n"
LISTLENGTH=$((LISTLENGTH + 2)) LISTLENGTH=$((LISTLENGTH + 2))
FREQENCIES="\nSoC runs between \Z1$(($(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq) / 1000))\Z0 and \Z1$(($(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq) / 1000)) MHz\Z0 using \Z1$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)\Z0 governor.\n" FREQENCIES="\nSoC runs between \Z1$(($(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_min_freq) / 1000))\Z0 and \Z1$(($(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_max_freq) / 1000)) MHz\Z0 using \Z1$(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_governor)\Z0 governor.\n"
fi fi
[[ -n "${BOARD_NAME/ /}" ]] && MENUTITLE=$MENUTITLE" based \Z1Armbian\Z0 for the \Z1${BOARD_NAME}\Z0 " [[ -n "${BOARD_NAME/ /}" ]] && MENUTITLE=$MENUTITLE" based \Z1Armbian\Z0 for the \Z1${BOARD_NAME}\Z0 "
......
...@@ -1031,11 +1031,13 @@ function jobs () ...@@ -1031,11 +1031,13 @@ function jobs ()
# CPU speed and governor # CPU speed and governor
# #
"CPU" ) "CPU" )
generic_select "$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies)" "Select minimum CPU speed" POLICY="policy0"
[[ $(grep -c '^processor' /proc/cpuinfo) -ge 4 ]] && POLICY="policy4"
generic_select "$(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_available_frequencies)" "Select minimum CPU speed"
MIN_SPEED=$PARAMETER MIN_SPEED=$PARAMETER
generic_select "$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies)" "Select maximum CPU speed" "$PARAMETER" generic_select "$(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_available_frequencies)" "Select maximum CPU speed" "$PARAMETER"
MAX_SPEED=$PARAMETER MAX_SPEED=$PARAMETER
generic_select "$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors)" "Select CPU governor" generic_select "$(cat /sys/devices/system/cpu/cpufreq/$POLICY/scaling_available_governors)" "Select CPU governor"
GOVERNOR=$PARAMETER GOVERNOR=$PARAMETER
if [[ -n $MIN_SPEED && -n $MAX_SPEED && -n $GOVERNOR ]]; then if [[ -n $MIN_SPEED && -n $MAX_SPEED && -n $GOVERNOR ]]; then
dialog --colors --title " Apply and save changes " --backtitle "$BACKTITLE" --yes-label "OK" --no-label "Cancel" --yesno \ dialog --colors --title " Apply and save changes " --backtitle "$BACKTITLE" --yes-label "OK" --no-label "Cancel" --yesno \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment