-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01mpdecision
76 lines (67 loc) · 2.21 KB
/
01mpdecision
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/system/bin/sh
#
# Check if we have a full mpdecision and thermal engine replacement, if not rename
# mpdecision and thermal engine prebuilt to default service name and let 3rd party
# kernel handel it. This script is just to keep up 3rd party
# compatibility without msm_mpdecision or msm_thermal.
# Otherwise we would kill the prebuilt completly
# Open source mpdecision sys path
MSM_MPD=/sys/kernel/msm_mpdecision/conf/
# Open source thermal engine sys path
MSM_THERMAL=/sys/kernel/msm_thermal/conf/allowed_mid_freq
# Prebuilt mpdecision stock
MPD=/system/bin/mpdecision
# Prebuilt thermal engine stock
THERMAL=/system/bin/thermal-engine-hh
# Prebuilt disabled mpdecision
MPD_DISABLED=/system/bin/mpdecision_disabled
# Prebuilt disabled thermal engine
THERMAL_DISABLED=/system/bin/thermal-engine-hh_disabled
if [ ! -d "$MSM_MPD" ];
then
# No msm_mpdecision found in kernel. Rename prebuilt
# to stock default
if [ -e "$MPD_DISABLED" ];
then
echo "Kernel changed and has no open source msm_mpdecision."
echo "Activating prebuilt mpdecision..."
mount -o remount,rw /system
mv "$MPD_DISABLED" "$MPD"
mount -o remount,r /system
fi
else
# msm_mpdecision found in kernel.
# Disable prebuilt.
if [ -e "$MPD" ];
then
echo "Open source msm_mpdecision detected."
echo "Disable prebuilt mpdecision..."
mount -o remount,rw /system
mv "$MPD" "$MPD_DISABLED"
mount -o remount,r /system
fi
fi
if [ ! -e "$MSM_THERMAL" ];
then
# No msm_thermal engine found in kernel. Rename prebuilt
# to stock default
if [ -e "$THERMAL_DISABLED" ];
then
echo "Kernel changed and has no open source thermal engine."
echo "Activating prebuilt thermal engine..."
mount -o remount,rw /system
mv "$THERMAL_DISABLED" "$THERMAL"
mount -o remount,r /system
fi
else
# msm_thermal engine found in kernel.
# Disable prebuilt.
if [ -e "$THERMAL" ];
then
echo "Open source thermal engine detected."
echo "Disable prebuilt thermal engine..."
mount -o remount,rw /system
mv "$THERMAL" "$THERMAL_DISABLED"
mount -o remount,r /system
fi
fi