File: prep_fugu.sh

package info (click to toggle)
android-platform-frameworks-base 1%3A14~beta1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 326,092 kB
  • sloc: java: 2,032,373; xml: 343,016; cpp: 304,181; python: 3,683; ansic: 2,090; sh: 1,871; makefile: 117; sed: 19
file content (48 lines) | stat: -rwxr-xr-x 1,633 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

cpubase=/sys/devices/system/cpu
gov=cpufreq/scaling_governor

adb root
adb wait-for-device
thermal=$(adb shell "getprop persist.service.thermal")
echo "thermal status: $thermal"
if [ $thermal -eq 1 ]
then
    echo "Trying to setprop persist.service.thermal 0 and reboot"
    adb shell "setprop persist.service.thermal 0"
    adb reboot
    adb wait-for-device
    thermal=$(adb shell "getprop persist.service.thermal")
    if [ $thermal -eq 1 ]
    then
        echo "thermal property is still 1. Abort."
        exit -1
    fi
    echo "Successfully setup persist.service.thermal to 0"
fi

adb shell stop perfprod

# cores
# 1833000 1750000 1666000 1583000 1500000 1416000 1333000 1250000
# 1166000 1083000 1000000 916000 833000 750000 666000 583000 500000

cpu=0
S=1166000
while [ $((cpu < 3)) -eq 1 ]; do
    echo "Setting cpu ${cpu} & $(($cpu + 1)) cluster to $S hz"
    # cpu0/online doesn't exist, because you can't turned it off, so ignore results of this command
    adb shell "echo 1 > $cpubase/cpu${cpu}/online" &> /dev/null
    adb shell "echo userspace > $cpubase/cpu${cpu}/$gov"
    adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_max_freq"
    adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_min_freq"
    adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_setspeed"
    cpu=$(($cpu + 2))
done

#/sys/class/devfreq/dfrgx/available_frequencies is empty, so set to min
echo "performance mode, 457 MHz"
adb shell "echo performance > /sys/class/devfreq/dfrgx/governor"
adb shell "echo 457000 > /sys/class/devfreq/dfrgx/min_freq"
adb shell "echo 457000 > /sys/class/devfreq/dfrgx/max_freq"