-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathinit.grouper.rc
617 lines (554 loc) · 30.2 KB
/
init.grouper.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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
import init.grouper.usb.rc
on early-init
# Set init and its forked children's oom_adj.
write /proc/1/oom_score_adj -1000
mount debugfs debugfs /sys/kernel/debug
mount -t cgroup -o timer_slack none /sys/fs/cgroup
# write /sys/fs/cgroup/timer_slack.min_slack_ns 250000
on init
symlink /sdcard /storage/sdcard0
# USB OTG support
mkdir /mnt/media_rw/usbdisk 0700 media_rw media_rw
mkdir /storage/usbdisk 0700 root root
symlink /storage/usbdisk /mnt/usbdisk
symlink /mnt/usbdisk /usbdisk
on early-boot
setprop ro.audio.flinger_standbytime_ms 15000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor intelliactive
on fs
setprop ro.crypto.umount_sd false
setprop ro.crypto.fuse_sdcard true
mount_all /fstab.grouper
swapon_all /fstab.grouper
mkdir /per 0700 root root
mount vfat /dev/block/platform/sdhci-tegra.3/by-name/PER /per ro context=u:object_r:oemfs:s0
on post-fs-data
# change back to bluetooth from system
chown bluetooth net_bt_stack /data/misc/bluetooth
# sensors-config
mkdir /data/sensors 751
# /data/sensors was owned by system/system earlier.
# Force it to root/root if it already exists.
chown root root /data/sensors
mkdir /data/lightsensor 751
# /data/lightsensor was owned by system/system earlier.
# Force it to root/root if it already exists.
chown root root /data/lightsensor
mkdir /data/calibration
mkdir /data/amit
# gps
mkdir /data/gps
chown gps system /data/gps
chmod 770 /data/gps
write /sys/class/gpio/gpio162/value 0
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
on boot
# bluetooth
# UART device
chmod 0660 /dev/ttyHS2
chown bluetooth net_bt_stack /dev/ttyHS2
# power up/down interface
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
# bluetooth MAC address programming
chown bluetooth net_bt_stack ro.bt.bdaddr_path
chown bluetooth net_bt_stack /system/etc/bluetooth
chown bluetooth net_bt_stack /data/misc/bluetooth
setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr"
# 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
# NFC
setprop ro.nfc.port "I2C"
chmod 0660 /dev/pn544
chown nfc nfc /dev/pn544
# backlight
chown system system /sys/class/backlight/pwm-backlight/brightness
# didim
chown system system /sys/class/graphics/fb0/device/smartdimmer/enable
chown system system /sys/class/graphics/fb0/device/smartdimmer/aggressiveness
chown system system /sys/class/graphics/fb0/device/smartdimmer/phase_in_adjustments
# 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/kernel/cluster/active
# Setting the cpuquiet governor resets the sysfs permissions, so we set it here
write /sys/devices/system/cpu/cpuquiet/current_governor balanced
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/no_lp 0
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable 1
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/idle_bottom_freq 102000
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/idle_top_freq 620000
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/down_delay 60
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/up_delay 60
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/mp_overhead 20
write /sys/module/cpuidle/parameters/lp2_in_idle 0
write /sys/devices/system/cpu/cpuquiet/balanced/idle_bottom_freq 102000
write /sys/devices/system/cpu/cpuquiet/balanced/idle_top_freq 620000
write /sys/devices/system/cpu/cpuquiet/balanced/down_delay 60
write /sys/devices/system/cpu/cpuquiet/balanced/up_delay 60
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/down_delay
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/up_delay
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/no_lp
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/idle_bottom_freq
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/idle_top_freq
chown system system /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/mp_overhead
chown system system /sys/devices/system/cpu/cpuquiet/current_governor
chown system system /sys/devices/system/cpu/cpuquiet/balanced/idle_bottom_freq
chown system system /sys/devices/system/cpu/cpuquiet/balanced/idle_top_freq
chown system system /sys/devices/system/cpu/cpuquiet/balanced/down_delay
chown system system /sys/devices/system/cpu/cpuquiet/balanced/up_delay
chown system system /sys/devices/platform/host1x/nvavp/boost_sclk
chown system system /sys/devices/tegradc.0/enable
chown system system /sys/devices/host1x/gr3d/enable_3d_scaling
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/down_delay
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/up_delay
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/no_lp
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/idle_bottom_freq
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/idle_top_freq
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/mp_overhead
chmod 0660 /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/no_lp
chmod 0660 /sys/devices/system/cpu/cpuquiet/current_governor
chmod 0660 /sys/devices/system/cpu/cpuquiet/balanced/idle_bottom_freq
chmod 0660 /sys/devices/system/cpu/cpuquiet/balanced/idle_top_freq
chmod 0660 /sys/devices/system/cpu/cpuquiet/balanced/down_delay
chmod 0660 /sys/devices/system/cpu/cpuquiet/balanced/up_delay
chmod 0660 /sys/devices/platform/host1x/nvavp/boost_sclk
chmod 0660 /sys/devices/tegradc.0/enable
chmod 0660 /sys/devices/host1x/gr3d/enable_3d_scaling
chmod 0660 /sys/kernel/cluster/active
# Intelliactive governor settings
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor intelliactive
write /sys/devices/system/cpu/cpufreq/intelliactive/above_hispeed_delay 40000
write /sys/devices/system/cpu/cpufreq/intelliactive/boost 0
write /sys/devices/system/cpu/cpufreq/intelliactive/boostpulse 1
write /sys/devices/system/cpu/cpufreq/intelliactive/boostpulse_duration 80000
write /sys/devices/system/cpu/cpufreq/intelliactive/go_hispeed_load 95
write /sys/devices/system/cpu/cpufreq/intelliactive/hispeed_freq 1000000
write /sys/devices/system/cpu/cpufreq/intelliactive/io_is_busy 1
write /sys/devices/system/cpu/cpufreq/intelliactive/min_sample_time 20000
write /sys/devices/system/cpu/cpufreq/intelliactive/sampling_down_factor 20000
write /sys/devices/system/cpu/cpufreq/intelliactive/sync_freq 475000
write /sys/devices/system/cpu/cpufreq/intelliactive/target_loads 90
write /sys/devices/system/cpu/cpufreq/intelliactive/timer_rate 10000
write /sys/devices/system/cpu/cpufreq/intelliactive/timer_slack 40000
write /sys/devices/system/cpu/cpufreq/intelliactive/up_threshold_any_cpu_freq 860000
write /sys/devices/system/cpu/cpufreq/intelliactive/up_threshold_any_cpu_load 85
write /sys/devices/system/cpu/cpufreq/intelliactive/two_phase_freq 475000,513000,620000,860000
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
chown system system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
chown system system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
chown system system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/above_hispeed_delay
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/boost
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/boostpulse
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/boostpulse_duration
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/go_hispeed_load
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/hispeed_freq
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/io_is_busy
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/min_sample_time
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/sampling_down_factor
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/sync_freq
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/target_loads
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/timer_rate
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/timer_slack
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/up_threshold_any_cpu_freq
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/up_threshold_any_cpu_load
chown system system /sys/devices/system/cpu/cpufreq/intelliactive/two_phase_freq
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 0660 /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
chmod 0660 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
chmod 0660 /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
chmod 0660 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
chmod 0660 /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
chmod 0660 /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/above_hispeed_delay
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/boost
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/boostpulse
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/boostpulse_duration
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/go_hispeed_load
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/hispeed_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/io_is_busy
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/min_sample_time
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/sampling_down_factor
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/sync_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/target_loads
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/timer_rate
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/timer_slack
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/up_threshold_any_cpu_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/up_threshold_any_cpu_load
chmod 0660 /sys/devices/system/cpu/cpufreq/intelliactive/two_phase_freq
restorecon_recursive /sys/devices/system/cpu/cpufreq/intelliactive
# Sensor
# iio
chown system system /dev/iio:device0
chown system system /sys/bus/iio/devices/trigger0/name
chown system system /sys/bus/iio/devices/iio:device0/accl_enable
chown system system /sys/bus/iio/devices/iio:device0/accl_matrix
chown system system /sys/bus/iio/devices/iio:device0/buffer/length
chown system system /sys/bus/iio/devices/iio:device0/buffer/enable
chown system system /sys/bus/iio/devices/iio:device0/compass_enable
chown system system /sys/bus/iio/devices/iio:device0/compass_matrix
chown system system /sys/bus/iio/devices/iio:device0/dmp_on
chown system system /sys/bus/iio/devices/iio:device0/dmp_int_on
chown system system /sys/bus/iio/devices/iio:device0/gyro_enable
chown system system /sys/bus/iio/devices/iio:device0/gyro_matrix
chown system system /sys/bus/iio/devices/iio:device0/in_accel_scale
chown system system /sys/bus/iio/devices/iio:device0/in_anglvel_scale
chown system system /sys/bus/iio/devices/iio:device0/in_magn_scale
chown system system /sys/bus/iio/devices/iio:device0/key
chown system system /sys/bus/iio/devices/iio:device0/power_state
chown system system /sys/bus/iio/devices/iio:device0/sampling_frequency
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en
chown system system /sys/bus/iio/devices/iio:device0/temperature
chown system system /sys/bus/iio/devices/iio:device0/trigger/current_trigger
# new in MA 5.1.5
chown system system /sys/bus/iio/devices/iio:device0/secondary_name
chown system system /sys/bus/iio/devices/iio:device0/dmp_firmware
chown system system /sys/bus/iio/devices/iio:device0/firmware_loaded
chown system system /sys/bus/iio/devices/iio:device0/dmp_event_int_on
chown system system /sys/bus/iio/devices/iio:device0/dmp_output_rate
chown system system /sys/bus/iio/devices/iio:device0/in_accel_x_offset
chown system system /sys/bus/iio/devices/iio:device0/in_accel_y_offset
chown system system /sys/bus/iio/devices/iio:device0/in_accel_z_offset
chown system system /sys/bus/iio/devices/iio:device0/gyro_fsr
## LPQ
chown system system /sys/bus/iio/devices/iio:device0/quaternion_on
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_z_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_y_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_x_en
chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_r_en
## Screen orientation
chown system system /sys/bus/iio/devices/iio:device0/event_display_orientation
chown system system /sys/bus/iio/devices/iio:device0/display_orientation_on
## SMD
chown system system /sys/bus/iio/devices/iio:device0/event_smd
chown system system /sys/bus/iio/devices/iio:device0/smd_enable
chown system system /sys/bus/iio/devices/iio:device0/smd_threshold
chown system system /sys/bus/iio/devices/iio:device0/smd_delay_threshold
chown system system /sys/bus/iio/devices/iio:device0/smd_delay_threshold2
## AMI compass sensor
chown system system /dev/iio:device1
chown system system /sys/bus/iio/devices/trigger1/name
chown system system /sys/bus/iio/devices/iio:device1/buffer/length
chown system system /sys/bus/iio/devices/iio:device1/buffer/enable
chown system system /sys/bus/iio/devices/iio:device1/compass_enable
chown system system /sys/bus/iio/devices/iio:device1/compass_matrix
chown system system /sys/bus/iio/devices/iio:device1/in_magn_scale
chown system system /sys/bus/iio/devices/iio:device1/power_state
chown system system /sys/bus/iio/devices/iio:device1/sampling_frequency
chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en
chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en
chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en
chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en
chown system system /sys/bus/iio/devices/iio:device1/trigger/current_trigger
chmod 600 /dev/iio:device0
chmod 600 /sys/bus/iio/devices/trigger0/name
chmod 600 /sys/bus/iio/devices/iio:device0/accl_enable
chmod 600 /sys/bus/iio/devices/iio:device0/accl_matrix
chmod 600 /sys/bus/iio/devices/iio:device0/buffer/length
chmod 600 /sys/bus/iio/devices/iio:device0/buffer/enable
chmod 600 /sys/bus/iio/devices/iio:device0/compass_enable
chmod 600 /sys/bus/iio/devices/iio:device0/compass_matrix
chmod 600 /sys/bus/iio/devices/iio:device0/dmp_on
chmod 600 /sys/bus/iio/devices/iio:device0/dmp_int_on
chmod 600 /sys/bus/iio/devices/iio:device0/gyro_enable
chmod 600 /sys/bus/iio/devices/iio:device0/gyro_matrix
chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_scale
chmod 600 /sys/bus/iio/devices/iio:device0/in_anglvel_scale
chmod 600 /sys/bus/iio/devices/iio:device0/in_magn_scale
chmod 600 /sys/bus/iio/devices/iio:device0/key
chmod 600 /sys/bus/iio/devices/iio:device0/power_state
chmod 600 /sys/bus/iio/devices/iio:device0/sampling_frequency
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en
chmod 600 /sys/bus/iio/devices/iio:device0/temperature
chmod 600 /sys/bus/iio/devices/iio:device0/trigger/current_trigger
# new in MA 5.1.5
chmod 600 /sys/bus/iio/devices/iio:device0/secondary_name
chmod 600 /sys/bus/iio/devices/iio:device0/dmp_firmware
chmod 600 /sys/bus/iio/devices/iio:device0/firmware_loaded
chmod 600 /sys/bus/iio/devices/iio:device0/dmp_event_int_on
chmod 600 /sys/bus/iio/devices/iio:device0/dmp_output_rate
chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_x_offset
chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_y_offset
chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_z_offset
chmod 600 /sys/bus/iio/devices/iio:device0/gyro_fsr
## LPQ
chmod 600 /sys/bus/iio/devices/iio:device0/quaternion_on
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_z_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_y_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_x_en
chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_r_en
## Screen orientation
chmod 600 /sys/bus/iio/devices/iio:device0/event_display_orientation
chmod 600 /sys/bus/iio/devices/iio:device0/display_orientation_on
## SMD
chmod 600 /sys/bus/iio/devices/iio:device0/event_smd
chmod 600 /sys/bus/iio/devices/iio:device0/smd_enable
chmod 600 /sys/bus/iio/devices/iio:device0/smd_threshold
chmod 600 /sys/bus/iio/devices/iio:device0/smd_delay_threshold
chmod 600 /sys/bus/iio/devices/iio:device0/smd_delay_threshold2
## AMI compass sensor
chmod 600 /dev/iio:device1
chmod 600 /sys/bus/iio/devices/trigger1/name
chmod 600 /sys/bus/iio/devices/iio:device1/buffer/length
chmod 600 /sys/bus/iio/devices/iio:device1/buffer/enable
chmod 600 /sys/bus/iio/devices/iio:device1/compass_enable
chmod 600 /sys/bus/iio/devices/iio:device1/compass_matrix
chmod 600 /sys/bus/iio/devices/iio:device1/in_magn_scale
chmod 600 /sys/bus/iio/devices/iio:device1/power_state
chmod 600 /sys/bus/iio/devices/iio:device1/sampling_frequency
chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en
chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en
chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en
chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en
chmod 600 /sys/bus/iio/devices/iio:device1/trigger/current_trigger
chown system system /sys/module/cpuidle/parameters/lp2_in_idle
chown system system /sys/module/intelli_plug/parameters/nr_run_profile_sel
chown system system /sys/module/intelli_plug/parameters/cpu_nr_run_threshold
chown system system /sys/module/intelli_plug/parameters/nr_run_hysteresis
chown system system /sys/module/intelli_plug/parameters/screen_off_max
chown system system /sys/module/intelli_plug/parameters/intelli_plug_active
chown system system /sys/module/lowmemorykiller/parameters/adj
chown system system /sys/module/lowmemorykiller/parameters/debug
chown system system /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
chown system system /sys/module/lowmemorykiller/parameters/minfree
chown system system /sys/module/lowmemorykiller/parameters/vmpressure_file_min
chmod 0660 /sys/module/cpuidle/parameters/lp2_in_idle
chmod 0660 /sys/module/intelli_plug/parameters/nr_run_profile_sel
chmod 0600 /sys/module/intelli_plug/parameters/cpu_nr_run_threshold
chmod 0600 /sys/module/intelli_plug/parameters/nr_run_hysteresis
chmod 0600 /sys/module/intelli_plug/parameters/screen_off_max
chmod 0600 /sys/module/intelli_plug/parameters/intelli_plug_active
chmod 0660 /sys/module/lowmemorykiller/parameters/adj
chmod 0660 /sys/module/lowmemorykiller/parameters/debug
chmod 0660 /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
chmod 0660 /sys/module/lowmemorykiller/parameters/minfree
chmod 0660 /sys/module/lowmemorykiller/parameters/vmpressure_file_min
# Power management settings
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/devices/system/cpu/cpufreq/cpuload/enable
chown system system /sys/devices/system/cpu/cpuquiet/current_governor
# Setting the cpuquiet governor resets the sysfs permissions, so we set it here
write /sys/devices/system/cpu/cpuquiet/current_governor balanced
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable 1
write /sys/module/cpuidle_t3/parameters/lp2_0_in_idle 0
restorecon_recursive /sys/devices/system/cpu/cpuquiet/balanced
# Double tap to wake settings
chown system system /sys/android_touch/doubletap_wake
chmod 0664 /sys/android_touch/doubletap_wake
chown system system /sys/android_touch/dt_delta_limit
chmod 0664 /sys/android_touch/dt_delta_limit
chown system system /sys/android_touch/dt_timeout
chmod 0664 /sys/android_touch/dt_timeout
write /sys/android_touch/doubletap_wake 1
# Default Read Ahead value for sdcards
# write /sys/block/mmcblk0/queue/scheduler cfq
write /sys/block/mmcblk0/queue/read_ahead_kb 256
write /sys/block/mmcblk0/queue/nr_requests 256
write /sys/block/mmcblk0/queue/add_random 0
write /sys/block/mmcblk0/queue/rq_affinity 1
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/block/mmcblk0/queue/iosched/group_idle 0
write /sys/block/mmcblk0/queue/iosched/back_seek_penalty 1
write /sys/block/mmcblk0/queue/iosched/quantum 8
write /sys/block/mmcblk0/queue/iosched/slice_async 40
write /sys/block/mmcblk0/queue/iosched/slice_sync 100
write /sys/block/mmcblk0/queue/iosched/fifo_expire_async 250
write /sys/block/mmcblk0/queue/iosched/fifo_expire_sync 120
# write /sys/block/mmcblk0/queue/iosched/slice_async_rq 4
# write /sys/block/mmcblk0/queue/iosched/back_seek_max 2147483647
# write /sys/block/mmcblk0/queue/iosched/target_latency 300
# GPS init
write /sys/class/gpio/export 162
write /sys/class/gpio/gpio162/value 0
write /sys/class/gpio/gpio162/direction out
chown gps system /sys/class/gpio/gpio162/value
chmod 0664 /sys/class/gpio/gpio162/value
chown gps system /dev/ttyHS1
chmod 0660 /dev/ttyHS1
# Load WiFi driver
# BB mapping symbolic name to the logging ttyACM port
symlink /dev/ttyACM2 /dev/log_modem
# Touch
chown system system /dev/elan-iap
chown system system /proc/ektf_dbg
start touch_fw_update
# initialize KSM
write /sys/kernel/mm/ksm/deferred_timer 1
write /sys/kernel/mm/ksm/pages_to_scan 256
write /sys/kernel/mm/ksm/sleep_millisecs 1500
write /sys/kernel/mm/ksm/run 1
# config swap
write /proc/sys/vm/page-cluster 1
write /proc/sys/vm/swappiness 100
write /proc/sys/vm/dirty_ratio 15
write /proc/sys/vm/dirty_background_ratio 5
write /proc/sys/vm/dirty_writeback_centisecs 400
write /proc/sys/vm/min_free_kbytes 3072
# write /sys/block/zram0/max_comp_streams 2
# some additional performance tweaks (to be tested
write /sys/module/lowmemorykiller/parameters/adj "0,300,600,800,900,906"
write /sys/module/lowmemorykiller/parameters/minfree "15360,19200,23040,26880,34415,43737"
write /sys/module/lowmemorykiller/parameters/cost 48
# Enable Adaptive LMK
write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1
write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 49152
# write /sys/devices/tegradc.0/smartdimmer/enable 0
# write /sys/devices/host1x/gr3d/enable_3d_scaling 1
# stop ril-daemon if this is a wifi-only device
on property:ro.carrier=wifi-only
stop ril-daemon
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
# 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 p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf -N \
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
-I/system/etc/wifi/p2p_supplicant_overlay.conf \
-puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin \
-g@android:wpa_wlan0
# 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 dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
class main
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL -f/system/etc/dhcpcd/dhcpcd.conf
class main
disabled
oneshot
service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_eth0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_bt-pan /system/bin/dhcpcd -n
class main
disabled
oneshot
# set hwui properties depending on the screen resolution and the memory size
service set_hwui_params /system/bin/set_hwui_params.sh
class main
user root
group root
oneshot
# virtual sdcard daemon running as media_rw (1023)
service sdcard /system/bin/sdcard -u 1023 -g 1023 -t 4 -l /data/media /mnt/shell/emulated
class late_start
# daemon for the USB OTG storage, running as media_rw (1023) and
# giving write permission to sdcard_rw (1015)
service fuse_usbdisk /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/usbdisk /storage/usbdisk
class late_start
disabled
# bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys
service bugreport /system/bin/dumpstate -d -p -B \
-o /data/data/com.android.shell/files/bugreports/bugreport
class main
disabled
oneshot
keycodes 115 114
# Start GPS daemon
service gpsd /vendor/bin/gpsd -c /system/etc/gps.xml
class main
socket gps seqpacket 0660 gps system
user gps
group system wakelock inet sdcard_rw
# Recovery daemon: configure MSC partition
service recoveryd /system/bin/recoveryd /dev/block/platform/sdhci-tegra.3/by-name/MSC
disabled
class main
user root
group root
oneshot
on property:sys.shutdown.requested=1recovery
start recoveryd
on property:ro.build.type=userdebug
start adbd
# start tf_daemon service
service tf_daemon /vendor/bin/tf_daemon -storageDir /data/tf -d
class main
user root
group shell
# may restart due to /data/tf not existing yet
on property:init.svc.tf_daemon=restarting
mkdir /data/tf
service touch_fw_update /system/bin/touch_fw_update.sh
class main
disabled
user root
group root
oneshot
service sensors-calib /system/bin/sensors-load-calibration.sh
class main
user root
oneshot