-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathinit.x3.rc
401 lines (334 loc) · 14.9 KB
/
init.x3.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
import init.x3.usb.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
write /sys/class/firmware/timeout 5
mkdir /cal 0770 root system
mkdir /persist-lg 0771 system system
mkdir /mpt 0775 system system
on init
# See storage config details at http://source.android.com/tech/storage/
mkdir /storage 0050 system sdcard_r
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /storage/emulated 0555 root root
export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
mkdir /storage/sdcard1 0000 system system
on fs
mount_all ./fstab.x3
mkdir /data/dontpanic
chown root system /data/dontpanic
chmod 0750 /data/dontpanic
chmod 777 /dev/mtc_eta_log
# Collect ramconsole data for last kmsg
copy /proc/last_kmsg /data/dontpanic/last_kmsg
chown root log /data/dontpanic/last_kmsg
chmod 0640 /data/dontpanic/last_kmsg
# Create this file in case it doesn't exist, needed to switch wifi modes:
write /data/misc/wifi/firmware_path ""
chmod 0666 /data/misc/wifi/firmware_path
on boot
insmod /system/lib/modules/bthid.ko
mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
# --- BRCM
mkdir /data/misc/wifi 0775 wifi radio
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
mkdir /data/nvcam 0700 media camera
# we will remap this as /mnt/sdcard with the sdcard fuse tool
mkdir /data/media 0775 media_rw media_rw
chown media_rw media_rw /data/media
#insmod /system/lib/modules/tlx251_le.ko "major=245"
chmod 0777 /dev/block/platform/sdhci-tegra.3/by-name/NVA
chown system sdcard_rw /dev/block/platform/sdhci-tegra.3/by-name/NVA
chmod 0660 /dev/block/platform/sdhci-tegra.3/by-name/NVA ## NV partition
chown system system /sys/devices/virtual/input/lge_touch/keyguard
# Power control interface
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
write /sys/class/rfkill/rfkill0/state 0
# FactoryTest AT command
chmod 0664 /sys/devices/platform/bd_address/bdaddr_if
chown radio bluetooth /sys/devices/platform/bd_address/bdaddr_if
# bluetooth LPM
chmod 0220 /proc/bluetooth/sleep/lpm
chmod 0220 /proc/bluetooth/sleep/btwrite
chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
# backlight
chown system radio /sys/class/leds/lcd-backlight/brightness
chmod 0664 /sys/class/leds/lcd-backlight/brightness
# key led
chown system radio /sys/class/leds/button-backlight/brightness
chmod 0664 /sys/class/leds/button-backlight/brightness
chown system radio /sys/class/leds/button-backlight/br_maintain_on
chmod 0664 /sys/class/leds/button-backlight/br_maintain_on
chown system radio /sys/devices/platform/gpio-keys.0/key_test_mode
# RGB bridge IC(SSD2825)
chown system radio /sys/devices/platform/spi_tegra.4/spi4.2/gamma_tuning
chown system radio /sys/devices/platform/spi_tegra.4/spi4.2/gamma_saved
chown system system /sys/devices/platform/spi_tegra.4/spi4.2/device_id
chown system system /sys/devices/platform/spi_tegra.4/spi4.2/mipi_lp
chown system system /sys/devices/platform/spi_tegra.4/spi4.2/mipi_hs
chown system system /sys/devices/platform/spi_tegra.4/spi4.2/reg_dump
chmod 0660 /sys/devices/platform/spi_tegra.4/spi4.2/gamma_tuning
chmod 0660 /sys/devices/platform/spi_tegra.4/spi4.2/gamma_saved
chmod 0660 /sys/devices/platform/spi_tegra.4/spi4.2/device_id
chmod 0660 /sys/devices/platform/spi_tegra.4/spi4.2/mipi_lp
chmod 0660 /sys/devices/platform/spi_tegra.4/spi4.2/mipi_hs
chmod 0660 /sys/devices/platform/spi_tegra.4/spi4.2/reg_dump
# fuelgauge
#chown system radio /sys/devices/platform/tegra-i2c.4/i2c-4/4-0036/state
chown system radio /sys/class/power_supply/fuelgauge/device/state
chown system radio /sys/class/power_supply/charger/device/chgcc_ta
# didim
chown system system /sys/devices/nvhost/tegradc.0/smartdimmer/enable
chown system system /sys/devices/nvhost/tegradc.0/smartdimmer/aggressiveness
chown system system /sys/devices/nvhost/tegradc.0/smartdimmer/phase_in_video
# power
chown system system /sys/kernel/tegra_cap/core_cap_level
chown system system /sys/kernel/tegra_cap/core_cap_state
chown system system /sys/module/cpu_tegra/parameters/cpu_user_cap
chown system system /sys/module/cpu_tegra/parameters/force_disable_edp
# sangwon.jeon for gyro and accel.
chmod 0666 dev/mpu
chmod 0666 dev/mpuirq
chmod 0666 dev/slaveirq
chmod 0666 dev/timerirq
# PROXIMITY SENSOR
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/enable_ps_sensor
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/enable_ps_sensor
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/enable_als_sensor
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/enable_als_sensor
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/proxidata
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/proxidata
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/luxdata
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/luxdata
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/ps_hysteresis
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/ps_hysteresis
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/ps_threshold
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/ps_threshold
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/run_calibration
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/run_calibration
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/ppcount
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/ppcount
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/default_calibration
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/default_calibration
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/ps_data
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/ps_data
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/is_white
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/is_white
chown system system /sys/bus/i2c/drivers/apds990x/0-0039/ps_cal_result
chmod 0660 /sys/bus/i2c/drivers/apds990x/0-0039/ps_cal_result
# Power management settings
write /sys/module/cpu_tegra3/parameters/no_lp 0
#write /sys/module/tegra3_emc/parameters/emc_enable 0
#write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
chown system system /sys/devices/system/cpu/cpufreq/interactive/cores_states
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/cores_states
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
write /sys/module/cpu_tegra/parameters/force_policy_max Y
write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2
write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80
write /sys/module/cpu_tegra3/parameters/auto_hotplug 1
write /sys/module/cpuidle/parameters/lp2_in_idle 1
# Interactive dynamic frequecy mode settings
write /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 95
write /sys/devices/system/cpu/cpufreq/interactive/dynamic_freq_mode 1
write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 20000
# Power Save for camera preview and recording
chown media camera /sys/devices/platform/tegra_camera/power_save_preview
chown media camera /sys/devices/platform/tegra_camera/power_save_rec
# Power management for jpeg decode
chown media sdcard_rw /sys/devices/nvavp/jpeg_decode
chown system radio /sys/devices/platform/tegra-i2c.4/i2c-4/4-001c/max77663-rtc.0/enablesmpl
chown system radio /sys/devices/platform/tegra-i2c.4/i2c-4/4-001c/max77663-rtc.0/smplcount
write /sys/block/mmcblk0/queue/read_ahead_kb 2048
write /sys/block/mmcblk1/queue/read_ahead_kb 2048
#LGE_CHANGE_S 20121126, [email protected] [data] TCP increase rmem_max value for downlink data throughput
write /proc/sys/net/core/rmem_max 393213
#LGE_CHANGE_E 20121126, [email protected] [data] TCP increase rmem_max value for downlink data throughput
#LGE_CHANGE_S 20120720, [email protected] [data] 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
#LGE_CHANGE_E 20120720, [email protected] [data] Disable IPv6 for mobile network
#LGE_RIL_START [email protected]
service rawip_rmnet1 /system/bin/init.rmnet 1
user root
group radio cache inet misc
disabled
oneshot
service rawip_rmnet2 /system/bin/init.rmnet 2
user root
group radio cache inet misc
disabled
oneshot
# used to down HSI interfaces on RIL Recovery
service rmnet1_down /system/bin/init.rmnet-down 1
user root
group radio cache inet misc
disabled
oneshot
service rmnet2_down /system/bin/init.rmnet-down 2
user root
group radio cache inet misc
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -aBKAL
class core
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
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
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
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
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
class late_start
on boot
write /sys/class/gpio/export 61
chown system system /sys/devices/platform/gps_gpio/poweron
chown system system /sys/devices/platform/gps_gpio/reset
chown system system /sys/devices/platform/gps_gpio/eclk
chown system system /dev/pts17
mkdir /data/gps
chmod 770 /data/gps
chown system system /data/gps
chmod 770 /system/etc/cert/lge.cer
chown system system /system/etc/cert/lge.cer
chmod 770 /system/etc/hmconfig.txt
chown system system /system/etc/hmconfig.txt
chown audio audio /dev/pts29
mkdir /cal/secclk 0770 system system
chmod 0770 /cal/secclk
chown system system /cal/secclk
chown root radio /sys/devices/platform/baseband_xmm_power/xmm_onoff
setprop nvcpud.enabled true
setprop nvcpud.config_refresh_ms -1
# Torch perms
chown system camera /sys/devices/platform/tegra-i2c.2/i2c-2/2-0053/torch
chmod 0660 /sys/devices/platform/tegra-i2c.2/i2c-2/2-0053/torch
service nvcpud /system/bin/nvcpud
class main
user root
group root
service charger /charger
class charger
user root
group root
oneshot
#service hdmid /system/bin/hdmid
# class core
# socket hdmid stream 0660 root system graphics
# user system
# group system
on boot
chown system system /sys/power/lge_logstart
chmod 0660 /sys/power/lge_logstart
service rdlsc /system/xbin/rdlsc
user root
group root
oneshot
on boot
start rdlsc
service lgsecclk /system/bin/lgsecclkserver
class main
user system
group system sdcard_rw media_rw
# restart when servicemanager is restarted
on property:init.svc.servicemanager=restarting
restart lgsecclk
########################################
# CAPP_DRM
########################################
service lgdrm /system/bin/lgdrmserver
class main
user system
group sdcard_rw media_rw system radio media
service tf_daemon /system/bin/tf_daemon -storageDir /cal/widevine -d
class main
user system
group shell system
oneshot
# restart when servicemanager is restarted
on property:init.svc.servicemanager=restarting
restart lgdrm
on post-fs-data
# create directory for lgdrm
mkdir /data/lgdrm 0770 system media
setprop vold.post_fs_data_done 1
# Set buffer sizes from stock (lower readmax)
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.hsupa 4094,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.hsdpa 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
# Hardware tunable perms
chown root system /sys/devices/platform/spi_tegra.4/spi4.2/gamma_tuning
chown root system /sys/devices/platform/tspdrv/nforce_timed
chmod 0664 /sys/devices/platform/spi_tegra.4/spi4.2/gamma_tuning
chmod 0664 /sys/devices/platform/tspdrv/nforce_timed
restorecon /sys/devices/platform/spi_tegra.4/spi4.2/gamma_tuning
restorecon /sys/devices/platform/tspdrv/nforce_timed
service insmod_rawip /system/bin/init.rawip 1
user root
group radio cache inet misc
disabled
oneshot
service rmmod_rawip /system/bin/init.rawip 0
user root
group radio cache inet misc
disabled
oneshot
on property:dev.bootcomplete=1
write /sys/devices/platform/tegra-i2c.0/i2c-0/0-0039/run_calibration 1