-
Notifications
You must be signed in to change notification settings - Fork 7
/
init.p940.rc
executable file
·262 lines (208 loc) · 9.14 KB
/
init.p940.rc
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
import init.p940.usb.rc
on init
export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1
mkdir /storage/sdcard0 0000 system system
mkdir /storage/sdcard1 0000 system system
# Support legacy paths
symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
symlink /storage/sdcard1 /external_sd
symlink /storage/sdcard1 /mnt/external_sd
chown system system /sys/module/lge_handle_panic/parameters/hidden_reset_enable
chmod 660 /sys/module/lge_handle_panic/parameters/hidden_reset_enable
mkdir /persist 0771 system system
on fs
# mount partitions
mount_all /fstab.p940
setprop ro.crypto.fuse_sdcard false
## This needs to run ASAP to set up the framebuffer before zygote kicks in
start pvrsrvinit
on post-fs-data
chown system system /dvp
chmod 0771 /dvp
chown system system /persist
chmod 0771 /persist
mkdir /data/misc/wifi 0775 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/wifi/softap 0771 wifi wifi
mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
chmod 0666 /data/misc/wifi/wpa_supplicant.conf
chmod 0775 /data/misc/wifi
# wifi fw stuff
write /data/misc/wifi/fw_path ""
chown wifi wifi /data/misc/wifi/fw_path
chmod 0660 /data/misc/wifi/fw_path
write /data/misc/wifi/config ""
chmod 0660 /data/misc/wifi/config
chown system wifi /data/misc/wifi/config
write /data/misc/wifi/macAddress ""
chmod 0660 /data/misc/wifi/macAddress
chown system radio /data/misc/wifi/macAddress
# hdcp
mkdir /persist/mhl 0770 radio radio
# add symlink for HDCP key
symlink /persist/en_hdcp.bin /system/vendor/firmware/hdcp.keys
# Create Directory for widevine
mkdir /persist/widevine 0770 drm system
# audio
mkdir /data/audio 0770 media audio
chown media audio /data/audio
chmod 0770 /data/audio
# GPS
chown system system /sys/devices/platform/gps_gpio/poweron
chown system system /sys/devices/platform/gps_gpio/reset
# glgps & libgps & log setting
mkdir /data/gps
chmod 770 /data/gps
chown system system /data/gps
mkdir /data/gps/log
chmod 770 /data/gps/log
chown system system /data/gps/log
mkdir /data/cache
chmod 770 /data/cache
chown system system /data/cache
# create dump dir and collect dumps.
mkdir /data/dontpanic
chown root system /data/dontpanic
chmod 0754 /data/dontpanic
# collect ramconsole data
copy /proc/last_kmsg /data/dontpanic/last_kmsg.txt
chown root log /data/dontpanic/last_kmsg.txt
chmod 0640 /data/dontpanic/last_kmsg.txt
chown system system /sys/devices/platform/omap/omap_i2c.1/i2c-1/1-0049/twl6030_bci/smpl_en
chown system system /sys/devices/platform/omap/omap_i2c.1/i2c-1/1-0049/twl6030_bci/abnormal_wakelock_dis
chown system system /sys/class/power_supply/battery/temp_control
chown radio radio /sys/class/power_supply/battery/charger_mode
chown radio radio /sys/class/power_supply/battery/gauge_control
chown radio radio /sys/class/power_supply/bk_battery/voltage_now
chmod 0664 /sys/devices/platform/omap/omap_i2c.4/i2c-4/4-0036/state
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/interrupt_als
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/interrupt_prox
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/proxidata
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/luxdata
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/DF
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/GA
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/piht
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/pilt
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/pers
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/ppcount
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/wtime
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/ptime
chown system system /sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/atime
chown radio radio /sys/devices/platform/lge-gkpd/key_test_mode
chown radio radio /sys/devices/platform/omap/omap4-keypad/key_saving
# UART2
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chmod 0660 /sys/class/rfkill/rfkill1/state
chmod 0660 /sys/class/rfkill/rfkill1/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/type
chmod 0664 /sys/devices/platform/bd_address/bdaddr_if
chown radio bluetooth /sys/devices/platform/bd_address/bdaddr_if
chown system system /sys/class/mhl_orient/mhl_dev_orient/MHL_orient
on boot
mkdir /data/smc 0770 drmrpc drmrpc
mount debugfs /sys/kernel/debug /sys/kernel/debug
# Flash storage isn't a good entropy source, and only causes locking
# overhead in the kernel. Turn it off.
write /sys/block/mmcblk0/queue/add_random 0
chown system system /sys/devices/virtual/input/lge_touch/keyguard
chown system graphics /sys/class/graphics/fb0/overlays
chown system graphics /sys/class/graphics/fb0/fit_to_screen
chown system graphics /sys/class/graphics/fb0/overlays_rotate
# change permissions for tiler and ion
chmod 0777 /dev/ion
chmod 0777 /dev/tiler
# for HiddenMenu
chown system system /sys/devices/platform/omapdss/display1/enabled
chown system system /sys/devices/platform/omapdss/display1/bestScore
chmod 0660 /sys/devices/platform/omapdss/display1/enabled
chmod 0660 /sys/devices/platform/omapdss/display1/bestScore
# LCD backlight
chown system system /sys/devices/platform/omap/omap_i2c.2/i2c-2/2-0038/brightness
chmod 0664 /sys/devices/platform/omap/omap_i2c.2/i2c-2/2-0038/brightness
# LCD Gamma Tuning
chown system system /sys/devices/omapdss/display0/gamma_tuning
chmod 0660 /sys/devices/omapdss/display0/gamma_tuning
# LED backlight
chown system system /sys/class/leds/button-backlight/br_maintain_on
chmod 0660 /sys/class/leds/button-backlight/br_maintain_on
chown system system /sys/class/leds/button-backlight/brightness
chmod 0660 /sys/devices/platform/keypad_led/leds/button-backlight/brightness
# MUIC
chown system radio /sys/class/muic/tsu5611/state
chmod 0664 /sys/class/muic/tsu5611/state
# USB VID
chown system system /sys/class/android_usb/android0/idVendor
chmod 0664 /sys/class/android_usb/android0/idVendor
# allow system to modify target loads
chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
# increase rmem_max value for downlink data throughput
write /proc/sys/net/core/rmem_max 393213
# increase TCP buffer size
setprop net.tcp.buffersize.default 4096,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576
setprop net.tcp.buffersize.umts 4094,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.hspa 4094,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
# disable IPv6 for mobile network
write /proc/sys/net/ipv6/conf/rmnet0/disable_ipv6 1
write /proc/sys/net/ipv6/conf/rmnet1/disable_ipv6 1
write /proc/sys/net/ipv6/conf/rmnet2/disable_ipv6 1
on charger
# disable second core while charging
write /sys/devices/system/cpu/cpu1/online 0
service charger /charger
class charger
user root
group root
oneshot
service pvrsrvinit /vendor/bin/pvrsrvinit
disabled
user root
group root
oneshot
service p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -ABDKL
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
oneshot
service glgps /system/bin/glgps -c /system/etc/gps_brcm_conf.xml
class main
user system
group net_raw sdcard_rw system radio
on property:dev.bootcomplete=1
exec /system/bin/wifimac