forked from SlimRoms/device_lge_hammerhead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01mpdecision
42 lines (37 loc) · 1.18 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
#!/system/bin/sh
#
# Check if we have a full mpdecision replacement, if not rename
# mpdecision 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.
# Otherwise we would kill the prebuilt completly
# Open source mpdecision sys path
MSM_MPD=/sys/kernel/msm_mpdecision/conf/
# Prebuilt mpdecision stock
MPD=/system/bin/mpdecision
# Prebuilt disabled mpdecision
MPD_DISABLED=/system/bin/mpdecision_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