aboutsummaryrefslogtreecommitdiff
path: root/rootdir/etc/init.mofd_v1.rc
blob: 7845002ca2bc19462c554ff3e0e2d326815c95a5 (plain)
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
import init.common.rc
import init.debug.rc
import init.diag.rc
import init.avc.rc
import init.wifi.rc
import init.platform.usb.rc
import init.gps.rc
import init.nfc.rc
import init.bt.rc
import init.modem.rc
import init.config_init.rc
import init.logtool.rc

on early-init
# Set boot_min_cap for boot to Android.
    setprop ro.boot.min.cap 0

on init
    export LD_SHIM_LIBS /system/lib/libicuuc.so|libshim_icu.so:/system/lib/hw/camera.vendor.mofd_v1.so|libshim_camera.so:/system/bin/gpsd|libshim_gpsd.so

    write /sys/class/graphics/fbcon/cursor_blink 0
    mkdir /data/system/ 0770 system system
    mkdir /data/misc 01771 system misc
    mkdir /data/misc/audio 0770 audio audio

    chmod 0600 /dev/dri/controlD64
    chmod 0640 /dev/matrix

    # Android creates by-name disk links with the disk controller
    # in the generated path, so that the names pulled out of the GPT
    # can be associated with the correct disk. Create a shortcut to
    # /dev/block/by-name so that we can use the same fstabs everywhere.
    mkdir /dev/block 0755 root root
    symlink /dev/block/pci/pci0000:00/0000:00:01.0/by-name /dev/block/by-name

    write /proc/sys/kernel/hung_task_timeout_secs 0

    # DMA32 zone protection for GFX, Camera allocation limited to first 4GB
    write /proc/sys/vm/lowmem_reserve_ratio "256 32 32"

    #  Mount the sep filesystem
    mount sepfs sepfs /sys/fs/sepfs

    # Configure the proper cpusets
    write /dev/cpuset/system-background/cpus 0-3
    write /dev/cpuset/background/cpus 0-3
    write /dev/cpuset/foreground/boost/cpus 0-3
    write /dev/cpuset/foreground/cpus 0-3
    write /dev/cpuset/cpus 0-3

on boot
#  Permissions for Thermal Management
    chown system system /sys/class/power_supply/bq24192_charger/device/charge_current_limit
    chown system system /sys/module/intel_mid_osip/parameters/force_shutdown_occured
    chown system system /sys/module/intel_mid_osip/parameters/thermal_shutdown_occured
    chown system system /sys/devices/platform/coretemp.0/temp2_threshold1
    chown system system /sys/devices/platform/coretemp.0/temp2_threshold2
    chown system system /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw
    chown system system /sys/fps_throttle/notify
    chown system system /sys/fps_throttle/handshake
    chown media media /dev/i2c-1

#   Disable audio offloading
    setprop audio.offload.disable 1

    chown system system /sys/class/pci_bus/0000:00/device/0000:00:16.1/control
    chown system system /sys/class/pci_bus/0000:00/device/0000:00:16.1/data
    chown system system /sys/class/pci_bus/0000:00/device/0000:00:16.1/data_size
    chown system system /sys/class/pci_bus/0000:00/device/0000:00:16.1/fw_version

# Lte coexistence ( can be enabled the following: NRT / NRT+RT )
# Enable LTE Coexistence NRT (Non Real Time)
    setprop persist.service.cwsmgr.coex 1

# Disable LTE coexistence RT (Real Time). Should be set to 0 to enable.
    setprop persist.service.cwsmgr.nortcoex 0

# Set this property so surfaceflinger is not started by system_init
    setprop system_init.startsurfaceflinger 0

# Reboot in COS on shutdown request when charger is plugged
    setprop ro.rebootchargermode true

#  Enable submix audio path for widi
    setprop widi.audio.module submix

#  Enable HDCP by default for widi
    setprop widi.hdcp.enable auto

#  Enable frc stting for merr
    setprop vppsettings.frc 1

#  Enable slow-motion playback
    setprop video.playback.slow-motion 1

    #set dirty background bytes to 24MB to reduce USB MTP write latencies
    write /proc/sys/vm/dirty_background_bytes 25165824

# Set debugfs ownership to media
   chown media media /sys/kernel/debug/sst/fw_ssp_reg
   chown media media /sys/kernel/debug/sst/shim_dump
   chown media media /sys/kernel/debug/sst/sram_ia_lpe_mailbox
   chown media media /sys/kernel/debug/sst/sram_lpe_checkpoint
   chown media media /sys/kernel/debug/sst/sram_lpe_ia_mailbox
   chown media media /sys/kernel/debug/sst/lpe_stack

on post-fs-data
    mkdir /data/misc/firmware 0770 system system

    mkdir /data/silent_lake 0777 system system

    #Invoke fuel gauging helper binary to restore config data
    chmod 0770 /dev/max170xx
    chown system system /dev/max170xx
    chown system system /sys/class/power_supply/max17047_battery/model_name
    chown system system /sys/class/power_supply/max17047_battery/serial_number
    symlink /dev/max170xx /dev/fg
    mkdir /data/sensorhubdcal 0755 system system
    start fg_conf

    mkdir /data/logs
    chown system log /data/logs
    chmod 0770 /data/logs

    # Enable Dynamic Turbo feature
    setprop persist.thermal.turbo.dynamic 1

    mkdir /data/misc/dnsmasq 0755 root root
    mkdir /data/misc/dnsmasq/dalvik-cache 0755 root root
    restorecon_recursive /data/misc/dnsmasq

    restorecon_recursive /data/modem

on post-fs
    # Assume SMP uses shared cpufreq policy for all CPUs
    chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    chown system system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
    chmod 0660 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
    chown system system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
    chmod 0660 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
    chown system system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
    chmod 0660 /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq

    # Volume keys wakeup capability
    chmod 0664 /sys/devices/platform/gpio-keys/enabled_wakeup
    chmod 0664 /sys/devices/platform/gpio-keys/disabled_wakeup
    chown media system /sys/devices/platform/gpio-keys/enabled_wakeup
    chown media system /sys/devices/platform/gpio-keys/disabled_wakeup

#  Permissions for Sensors
    # accelerometer lsm303dlhc
    chown system system /sys/bus/i2c/devices/5-0019/lis3dh/enable
    chown system system /sys/bus/i2c/devices/5-0019/lis3dh/poll

    #barometer lps331ap
    chown system system /sys/bus/i2c/devices/5-005c/enable
    chown system system /sys/bus/i2c/devices/5-005c/poll

    #compass lsm303dlhc
    chown system system /sys/bus/i2c/devices/5-001e/lsm303cmp/enable
    chown system system /sys/bus/i2c/devices/5-001e/lsm303cmp/poll

    #als/ps apds990x
    chmod 0755 /dev/apds990x_lsensor
    chmod 0755 /dev/apds990x_psensor

    # SEP (Chaabi)
    copy /system/etc/security/sep_policy.conf /sys/fs/sepfs/load
    chown system system /dev/dx_sep_q0
    chmod 0666 /dev/dx_sep_q0
    chown system system /dev/dx_sep_q1
    chmod 0666 /dev/dx_sep_q1

    #Gyroscope l3g4200d
    chown system system /sys/bus/i2c/devices/5-0068/poll
    chown system system /sys/bus/i2c/devices/5-0068/enable

# Permissions for monzax
    chown system system /dev/monzax
    chmod 0660 /dev/monzax

# Permissions for LED
    chown system system /sys/class/leds/intel_keypad_led/brightness

# For Indicator LED
    chown system system /sys/class/leds/red/brightness
    chown system system /sys/class/leds/green/brightness
    chown system system /sys/class/leds/red/blink
    chown system system /sys/class/leds/green/blink
    chmod 0644 /sys/class/leds/red/brightness
    chmod 0644 /sys/class/leds/green/brightness
    chmod 0644 /sys/class/leds/red/blink
    chmod 0644 /sys/class/leds/green/blink

#For Quick Charge control
    chown system system /proc/smb1357_qc_disable

#For Disable Charging control
	chown system system /proc/smb1357_disable_chrg

# For Audio headset ringtone volume index when ringer mode is vibrate
    setprop ro.audio.vibra.ring.vol.idx 5

# Permissions for BCU sysfs interface and make generic path to access by apps
    chown system system /sys/devices/platform/bcove_bcu/camflash_ctrl
    symlink /sys/devices/platform/bcove_bcu /dev/bcu

    restorecon_recursive /factory
    restorecon_recursive /config
    restorecon_recursive /logs

# Permissions for Touch Proximity node
    chown system system /proc/asus_touch_proximity_status

# Permissions for Touch Glove Mode
    chown system system /sys/bus/i2c/devices/i2c-7/7-0038/ftsglovemode

# Permissions for Touch dclick Mode
    chown system radio /sys/bus/i2c/devices/i2c-7/7-0038/ftsdclickmode
    chmod 0664 /sys/bus/i2c/devices/i2c-7/7-0038/ftsdclickmode

# Permissions for Touch Gesture Mode
    chown system system /sys/bus/i2c/devices/i2c-7/7-0038/ftsgesturemode

# Permissions for Touch Cover Mode
    chown system system /sys/bus/i2c/devices/i2c-7/7-0038/ftscovermode

# Permissions for keydisabler
    chown root system /sys/bus/i2c/devices/i2c-7/7-0038/ftskeypadenable

#Enable/disable hall sensor irq
on property:persist.asus.coverenabled=1
    write /sys/kernel/hall_sensor_kobject/hall_sensor/activity 1

on property:persist.asus.coverenabled=0
    write /sys/kernel/hall_sensor_kobject/hall_sensor/activity 0
		
# start ril-daemon. class main in init.rc
    setprop ro.rild.start 1

service fg_conf /system/bin/fg_conf -w
    group system
    oneshot
    disabled

on property:init.svc.pvrsrvctl=stopped
    # GPU freq
    chown system system /sys/class/devfreq/dfrgx/max_freq
    chmod 0660 /sys/class/devfreq/dfrgx/max_freq
    chown system system /sys/class/devfreq/dfrgx/min_freq
    chmod 0660 /sys/class/devfreq/dfrgx/min_freq

on property:service.mmgr.smp=1
   write /proc/irq/36/smp_affinity f

on property:service.mmgr.smp=0
    write /proc/irq/36/smp_affinity 1

service audioserver /system/bin/audioserver
    class main
    user audioserver
    # media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
    group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct qcom_diag radio system wakelock
    ioprio rt 4
    writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks

service drm /system/bin/drmserver
    class main
    user drm
    group drm system inet drmrpc readproc sdcard_r
    writepid /dev/cpuset/foreground/tasks

service sensorhubd /system/bin/sensorhubd
    class main
    user root
    group root system readproc
    socket sensorhubd stream 666 system system

on charger
    mount ext4 /dev/block/by-name/system /system ro noatime barrier=1,data=ordered
    mount ext4 /dev/block/by-name/logs /logs nosuid nodev barrier=1,data=ordered

    start watchdogd
    #insmod /lib/modules/rmi4.ko boot_mode=1

    # Invoke fuel gauging helper binary to restore config data
    chmod 0770 /dev/max170xx
    chown system system /dev/max170xx
    symlink /dev/max170xx /dev/fg
    wait /system/bin/fg_conf
    start fg_conf

    chmod 0664 /sys/devices/pci0000:00/0000:00:10.0/hsic_enable
    write /sys/devices/pci0000:00/0000:00:10.0/hsic_enable 0

#Turn on VPROG2 Power rail to avoid power leakage in Sensor

    chmod 0664 /sys/bus/pci/devices/0000:00:16.1/control
    write /sys/bus/pci/devices/0000:00:16.1/control "0 1 0"

on property:persist.asus.instant_camera=1
    write sys/devices/platform/gpio-keys/enabled_wakeup 115
    write sys/devices/platform/gpio-keys/enabled_wakeup 114
    write sys/devices/platform/gpio-keys/enabled_wakeup 249
    write sys/devices/platform/gpio-keys/enabled_wakeup 212

on property:persist.asus.instant_camera=0
    write sys/devices/platform/gpio-keys/disabled_wakeup 115
    write sys/devices/platform/gpio-keys/disabled_wakeup 114
    write sys/devices/platform/gpio-keys/disabled_wakeup 249
    write sys/devices/platform/gpio-keys/disabled_wakeup 212