dont log to /data/logcat.txt
[GitHub/mt8127/android_device_alcatel_ttab.git] / ramdisk / factory_init.rc
1 import /init.environ.rc
2 import init.ssd.rc
3 import init.no_ssd.rc
4 import init.ssd_nomuser.rc
5 import init.fon.rc
6
7 on early-init
8 # Set init and its forked children's oom_adj.
9 write /proc/1/oom_score_adj -1000
10
11 # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
12 #write /sys/fs/selinux/checkreqprot 0
13
14 # Set the security context for the init process.
15 # This should occur before anything else (e.g. ueventd) is started.
16 setcon u:r:init:s0
17
18 # Set the security context of /adb_keys if present.
19 restorecon /adb_keys
20
21 start ueventd
22
23 write /proc/bootprof "INIT: usr/eng build setting"
24 # create mountpoints
25 mkdir /mnt 0775 root system
26
27 on init
28
29 sysclktz 0
30
31 loglevel 5
32
33 # Backward compatibility
34 symlink /system/etc /etc
35 symlink /sys/kernel/debug /d
36
37 # Right now vendor lives on the same filesystem as system,
38 # but someday that may change.
39 symlink /system/vendor /vendor
40
41 # Create cgroup mount point for cpu accounting
42 mkdir /acct
43 mount cgroup none /acct cpuacct
44 mkdir /acct/uid
45
46 # Backwards Compat - XXX: Going away in G*
47 symlink /mnt/sdcard /sdcard
48
49 mkdir /system
50 mkdir /data 0771 system system
51 mkdir /cache 0770 system cache
52 mkdir /config 0500 root root
53
54 # See storage config details at http://source.android.com/tech/storage/
55 mkdir /mnt/shell 0700 shell shell
56 mkdir /mnt/media_rw 0700 media_rw media_rw
57 mkdir /storage 0751 root sdcard_r
58
59 # Directory for putting things only root should see.
60 mkdir /mnt/secure 0700 root root
61 # Create private mountpoint so we can MS_MOVE from staging
62 mount tmpfs tmpfs /mnt/secure mode=0700,uid=0,gid=0
63
64 # Directory for staging bindmounts
65 mkdir /mnt/secure/staging 0700 root root
66
67 # Directory-target for where the secure container
68 # imagefile directory will be bind-mounted
69 mkdir /mnt/secure/asec 0700 root root
70
71 # Secure container public mount points.
72 mkdir /mnt/asec 0700 root system
73 mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
74
75 # Filesystem image public mount points.
76 mkdir /mnt/obb 0700 root system
77 mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
78
79 write /proc/sys/kernel/panic_on_oops 1
80 write /proc/sys/kernel/hung_task_timeout_secs 0
81 write /proc/cpu/alignment 4
82 write /proc/sys/kernel/sched_latency_ns 10000000
83 write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
84 write /proc/sys/kernel/sched_compat_yield 1
85 write /proc/sys/kernel/sched_child_runs_first 0
86 write /proc/sys/kernel/randomize_va_space 2
87 write /proc/sys/kernel/kptr_restrict 2
88 write /proc/sys/kernel/dmesg_restrict 1
89 write /proc/sys/vm/mmap_min_addr 32768
90 write /proc/sys/kernel/sched_rt_runtime_us 950000
91 write /proc/sys/kernel/sched_rt_period_us 1000000
92
93 # change key_provisioning
94 mkdir /data/key_provisioning
95 chmod 0777 /data/key_provisioning
96
97 mkdir /dev/cpuctl
98 mount cgroup none /dev/cpuctl cpu
99 chown system system /dev/cpuctl
100 chown system system /dev/cpuctl/tasks
101 chmod 0660 /dev/cpuctl/tasks
102 write /dev/cpuctl/cpu.shares 1024
103 write /dev/cpuctl/cpu.rt_runtime_us 950000
104 write /dev/cpuctl/cpu.rt_period_us 1000000
105
106 mkdir /dev/cpuctl/apps
107 chown system system /dev/cpuctl/apps/tasks
108 chmod 0666 /dev/cpuctl/apps/tasks
109 write /dev/cpuctl/apps/cpu.shares 1024
110 write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
111 write /dev/cpuctl/apps/cpu.rt_period_us 1000000
112
113 #USB function for factory mode
114 # write /sys/class/android_usb/android0/enable 0
115 # write /sys/class/android_usb/android0/idVendor 0e8d
116 # write /sys/class/android_usb/android0/idProduct 2006
117 # write /sys/class/android_usb/android0/f_acm/instances 1
118 # write /sys/class/android_usb/android0/functions mass_storage,adb,acm
119 # write /sys/class/android_usb/android0/enable 1
120 # start adbd
121 # setprop sys.usb.state mass_storage,adb,acm
122
123 mkdir /dev/cpuctl/apps/bg_non_interactive
124 chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
125 chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks
126 # 5.0 %
127 write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
128 write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
129 write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
130
131 # Allow everybody to read the xt_qtaguid resource tracking misc dev.
132 # This is needed by any process that uses socket tagging.
133 chmod 0644 /dev/xt_qtaguid
134
135 # Healthd can trigger a full boot from charger mode by signaling this
136 # property when the power button is held.
137 on property:sys.boot_from_charger_mode=1
138 class_stop charger
139 trigger late-init
140
141 # Load properties from /system/ + /factory after fs mount.
142 on load_all_props_action
143 load_all_props
144
145 # Mount filesystems and start core system services.
146 on late-init
147 trigger early-fs
148 trigger fs
149 trigger post-fs
150 trigger post-fs-data
151
152 # Load properties from /system/ + /factory after fs mount. Place
153 # this in another action so that the load will be scheduled after the prior
154 # issued fs triggers have completed.
155 trigger load_all_props_action
156
157 trigger early-boot
158 trigger boot
159
160 on fs
161 write /proc/bootprof "INIT:Mount_START"
162 mount_all /fstab.mt8127
163
164 #change partition permissions
165 exec /system/bin/chmod 0640 /dev/block/platform/mtk-msdc.0/by-name/boot
166 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/boot
167 exec /system/bin/chmod 0640 /dev/block/platform/mtk-msdc.0/by-name/recovery
168 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/recovery
169 exec /system/bin/chmod 0640 /dev/block/platform/mtk-msdc.0/by-name/secro
170 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/secro
171 exec /system/bin/chmod 0660 /dev/block/platform/mtk-msdc.0/by-name/seccfg
172 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/seccfg
173 exec /system/bin/chmod 0660 /dev/block/platform/mtk-msdc.0/by-name/proinfo
174 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/proinfo
175 exec /system/bin/chmod 0660 /dev/block/platform/mtk-msdc.0/by-name/otp
176 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/otp
177 exec /system/bin/chmod 0660 /dev/block/platform/mtk-msdc.0/by-name/nvram
178 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/nvram
179 exec /system/bin/chmod 0660 /dev/block/platform/mtk-msdc.0/by-name/para
180 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/para
181 exec /system/bin/chmod 0660 /dev/block/platform/mtk-msdc.0/by-name/logo
182 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/logo
183 exec /system/bin/chown root:system /dev/block/platform/mtk-msdc.0/by-name/para
184 write /proc/bootprof "INIT:Mount_END"
185
186 on post-fs
187 # once everything is setup, no need to modify /
188 mount rootfs rootfs / ro remount
189 # mount shared so changes propagate into child namespaces
190 mount rootfs rootfs / shared rec
191 mount tmpfs tmpfs /mnt/secure private rec
192
193 # We chown/chmod /data again so because mount is run as root + defaults
194 chown system system /system/data
195 chmod 0777 /system/data
196
197 # Same reason as /data above
198 chown system cache /cache
199 chmod 0770 /cache
200 # We restorecon /cache in case the cache partition has been reset.
201 restorecon_recursive /cache
202
203 mkdir /cache/recovery 0770 system system
204 restorecon /cache
205 #mount yaffs2 mtd@nvram /nvram nandboot
206 mount ext4 /dev/block/platform/mtk-msdc.0/by-name/SEC_RO /system/secro
207 mount ext4 /dev/block/platform/mtk-msdc.0/by-name/SEC_RO /system/secro ro remount
208
209 # This may have been created by the recovery system with odd permissions
210 chown system cache /cache/recovery
211 chmod 0770 /cache/recovery
212 # This may have been created by the recovery system with the wrong context.
213 restorecon /cache/recovery
214
215 #change permissions on vmallocinfo so we can grab it from bugreports
216 chown root log /proc/vmallocinfo
217 chmod 0440 /proc/vmallocinfo
218
219 chown root log /proc/slabinfo
220 chmod 0440 /proc/slabinfo
221
222 #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
223 chown root system /proc/kmsg
224 chmod 0440 /proc/kmsg
225 chown root system /proc/sysrq-trigger
226 chmod 0220 /proc/sysrq-trigger
227 chown system log /proc/last_kmsg
228 chmod 0440 /proc/last_kmsg
229
230 # create the lost+found directories, so as to enforce our permissions
231 mkdir /cache/lost+found 0770 root root
232
233 # make the selinux kernel policy world-readable
234 chmod 0444 /sys/fs/selinux/policy
235
236 # create the lost+found directories, so as to enforce our permissions
237 mkdir /cache/lost+found 0770 root root
238 #SeLinux
239 restorecon_recursive /protect_f
240 restorecon_recursive /protect_s
241
242 on post-fs-data
243 # We chown/chmod /data again so because mount is run as root + defaults
244 chown system system /data
245 chmod 0771 /data
246 # We restorecon /data in case the userdata partition has been reset.
247 restorecon /data
248
249 # Create dump dir and collect dumps.
250 # Do this before we mount cache so eventually we can use cache for
251 # storing dumps on platforms which do not have a dedicated dump partition.
252 mkdir /data/dontpanic 0750 root log
253
254 # Collect apanic data, free resources and re-arm trigger
255 copy /proc/apanic_console /data/dontpanic/apanic_console
256 chown root log /data/dontpanic/apanic_console
257 chmod 0640 /data/dontpanic/apanic_console
258
259 copy /proc/apanic_threads /data/dontpanic/apanic_threads
260 chown root log /data/dontpanic/apanic_threads
261 chmod 0640 /data/dontpanic/apanic_threads
262
263 write /proc/apanic_console 1
264 # create basic filesystem structure
265 mkdir /data/nvram 2770 root system
266 mkdir /data/misc 01771 system misc
267 mkdir /data/misc/adb 02750 system shell
268 mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
269 mkdir /data/misc/bluetooth 0770 system system
270 mkdir /data/misc/keystore 0700 keystore keystore
271 mkdir /data/misc/keychain 0771 system system
272 mkdir /data/misc/sms 0770 system radio
273 mkdir /data/misc/vpn 0770 system vpn
274 mkdir /data/misc/systemkeys 0700 system system
275 # give system access to wpa_supplicant.conf for backup and restore
276 mkdir /data/misc/wifi 0770 wifi wifi
277 chmod 0660 /data/misc/wifi/wpa_supplicant.conf
278 mkdir /data/local 0771 shell shell
279 mkdir /data/local/tmp 0771 shell shell
280 mkdir /data/data 0771 system system
281 mkdir /data/app-private 0771 system system
282 mkdir /data/app-asec 0700 root root
283 mkdir /data/app-lib 0771 system system
284 mkdir /data/app 0771 system system
285 mkdir /data/property 0700 root root
286 mkdir /data/ssh 0750 root shell
287 mkdir /data/ssh/empty 0700 root root
288
289 # create dalvik-cache, so as to enforce our permissions
290 mkdir /data/dalvik-cache 0771 system system
291
292 # create resource-cache and double-check the perms
293 mkdir /data/resource-cache 0771 system system
294 chown system system /data/resource-cache
295 chmod 0771 /data/resource-cache
296
297 # create the lost+found directories, so as to enforce our permissions
298 mkdir /data/lost+found 0770
299 mkdir /cache/lost+found 0770
300
301 # double check the perms, in case lost+found already exists, and set owner
302 chown root root /data/lost+found
303 chmod 0770 /data/lost+found
304 chown root root /cache/lost+found
305 chmod 0770 /cache/lost+found
306
307 mkdir /data/drm 0770 drm drm
308
309 # dhcp server
310 mkdir /data/misc/dhcp 0770 dhcp dhcp
311 chown dhcp dhcp /data/misc/dhcp
312
313 # device info interface
314 #insmod /system/lib/modules/devinfo.ko
315 #mknod /dev/devmap c 196 0;
316 chmod 0444 /dev/devmap
317 chown root system /dev/devmap
318
319 # load driver base driver
320 insmod /system/lib/modules/mtk_drvb_75.ko
321 mknod /dev/drvb c 176 0
322 chmod 0666 /dev/drvb
323
324 start NvRAMAgent
325
326 ## Custom pos-fs area (START)
327 write /proc/sys/vm/overcommit_memory 1
328 write /proc/sys/vm/min_free_order_shift 4
329 chown root system /sys/module/lowmemorykiller/parameters/adj
330 chmod 0664 /sys/module/lowmemorykiller/parameters/adj
331 chown root system /sys/module/lowmemorykiller/parameters/minfree
332 chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
333
334 # Tweak background writeout
335 write /proc/sys/vm/dirty_expire_centisecs 200
336 write /proc/sys/vm/dirty_background_ratio 5
337
338 # Permissions for System Server and daemons.
339 chown radio system /sys/android_power/state
340 chown radio system /sys/android_power/request_state
341 chown radio system /sys/android_power/acquire_full_wake_lock
342 chown radio system /sys/android_power/acquire_partial_wake_lock
343 chown radio system /sys/android_power/release_wake_lock
344 chown system system /sys/power/autosleep
345 chown system system /sys/power/state
346 chown system system /sys/power/wakeup_count
347 chown radio system /sys/power/wake_lock
348 chown radio system /sys/power/wake_unlock
349 chmod 0660 /sys/power/state
350 chmod 0660 /sys/power/wake_lock
351 chmod 0660 /sys/power/wake_unlock
352
353 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
354 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
355 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
356 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
357 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
358 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
359 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
360 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
361 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
362 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
363 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
364 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
365 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
366 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
367 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
368 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
369 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
370
371 # Assume SMP uses shared cpufreq policy for all CPUs
372 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
373 chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
374
375 chown system system /sys/class/timed_output/vibrator/enable
376 chown system system /sys/class/leds/keyboard-backlight/brightness
377 chown system system /sys/class/leds/lcd-backlight/brightness
378 chown system system /sys/class/leds/button-backlight/brightness
379 chown system system /sys/class/leds/jogball-backlight/brightness
380 chown system system /sys/class/leds/red/brightness
381 chown system system /sys/class/leds/green/brightness
382 chown system system /sys/class/leds/blue/brightness
383 chown system system /sys/class/leds/red/device/grpfreq
384 chown system system /sys/class/leds/red/device/grppwm
385 chown system system /sys/class/leds/red/device/blink
386 chown system system /sys/class/leds/red/brightness
387 chown system system /sys/class/leds/green/brightness
388 chown system system /sys/class/leds/blue/brightness
389 chown system system /sys/class/leds/red/device/grpfreq
390 chown system system /sys/class/leds/red/device/grppwm
391 chown system system /sys/class/leds/red/device/blink
392 chown system system /sys/class/timed_output/vibrator/enable
393 chown system system /sys/module/sco/parameters/disable_esco
394 chown system system /sys/kernel/ipv4/tcp_wmem_min
395 chown system system /sys/kernel/ipv4/tcp_wmem_def
396 chown system system /sys/kernel/ipv4/tcp_wmem_max
397 chown system system /sys/kernel/ipv4/tcp_rmem_min
398 chown system system /sys/kernel/ipv4/tcp_rmem_def
399 chown system system /sys/kernel/ipv4/tcp_rmem_max
400 chown root radio /proc/cmdline
401
402 # Define TCP buffer sizes for various networks
403 # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
404 setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
405 setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
406 setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576
407 setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
408 setprop net.tcp.buffersize.hspa 4094,87380,262144,4096,16384,262144
409 setprop net.tcp.buffersize.hsupa 4094,87380,262144,4096,16384,262144
410 setprop net.tcp.buffersize.hsdpa 4094,87380,262144,4096,16384,262144
411 setprop net.tcp.buffersize.hspap 4094,87380,1220608,4096,16384,1220608
412 setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
413 setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
414 setprop net.tcp.buffersize.evdo 4094,87380,262144,4096,16384,262144
415
416 # Set this property so surfaceflinger is not started by system_init
417 setprop system_init.startsurfaceflinger 0
418
419 # Touch Panel
420 chown root diag /sys/module/tpd_setting/parameters/tpd_calmat
421 chown root diag /sys/module/tpd_setting/parameters/tpd_em_debounce_time
422 chown root diag /sys/module/tpd_debug/parameters/tpd_em_log
423 chown root diag /sys/module/tpd_debug/parameters/tpd_em_log_to_fs
424
425 chmod 0777 /dev/pmem_multimedia
426 chmod 0777 /dev/mt6516-isp
427 chmod 0777 /dev/mt6516-IDP
428 chmod 0777 /dev/mt9p012
429 chmod 0777 /dev/mt6516_jpeg
430 chmod 0777 /dev/FM50AF
431
432 # RTC
433 mkdir /data/misc/rtc 0770 system system
434
435 # M4U
436 #insmod /system/lib/modules/m4u.ko
437 #mknod /dev/M4U_device c 188 0
438 chmod 0444 /dev/M4U_device
439
440 # Sensor
441 chmod 0666 /dev/hwmsensor
442 chmod 0666 /dev/msensor
443 chmod 0666 /dev/gsensor
444 chmod 0666 /dev/alsps
445
446 #VideoCodec
447 insmod /system/lib/modules/vcodec_kernel_driver.ko
448 mknod /dev/Vcodec c 189 0
449 chmod 0666 /dev/Vcodec
450
451
452 mkdir /data/amit/
453
454 # GPIO
455 chmod 0666 /dev/mtgpio
456
457 #NFC
458 rm /data/mtknfc_server
459
460 ## Custom pos_fs area (END)
461
462 # Separate location for storing security policy files on data
463 mkdir /data/security 0711 system system
464
465 # Reload policy from /data/security if present.
466 setprop selinux.reload_policy 1
467
468 # Set SELinux security contexts on upgrade or policy update.
469 restorecon_recursive /data
470
471 # If there is no fs-post-data action in the init.<device>.rc file, you
472 # must uncomment this line, otherwise encrypted filesystems
473 # won't work.
474 # Set indication (checked by vold) that we have finished this action
475 setprop vold.post_fs_data_done 1
476
477 on boot
478
479 start drvbd
480
481 # basic network init
482 ifup lo
483 hostname localhost
484 domainname localdomain
485
486 # Define RIL properties
487 setprop rild.nw.operlist /system/etc/ril/oper.lis
488 # AGPS
489 chmod 0777 /system/bin/mtk_agpsd
490
491 # Start default class, this line is very important!!
492 class_start default
493 class_start core
494
495 on nonencrypted
496 class_start main
497 class_start late_start
498
499 on property:vold.decrypt=trigger_default_encryption
500 start defaultcrypto
501
502 on property:vold.decrypt=trigger_encryption
503 start surfaceflinger
504 start encrypt
505
506 on property:vold.decrypt=trigger_reset_main
507 class_reset main
508
509 on property:vold.decrypt=trigger_load_persist_props
510 load_persist_props
511
512 on property:vold.decrypt=trigger_post_fs_data
513 trigger post-fs-data
514
515 on property:vold.decrypt=trigger_restart_min_framework
516 class_start main
517
518 on property:vold.decrypt=trigger_restart_framework
519 start nvram_daemon
520 class_start main
521 class_start late_start
522 start permission_check
523
524 on property:vold.decrypt=trigger_shutdown_framework
525 class_reset late_start
526 class_reset main
527
528 ## Daemon processes to be run by init.
529 ##
530
531 # Update the second boot logo
532 # service bootlogoupdater /system/bin/boot_logo_updater
533 # oneshot
534
535 service ueventd /sbin/ueventd
536 class core
537 critical
538 seclabel u:r:ueventd:s0
539
540 service logd /system/bin/logd
541 class core
542 socket logd stream 0666 logd logd
543 socket logdr seqpacket 0666 logd logd
544 socket logdw dgram 0222 logd logd
545 seclabel u:r:logd:s0
546
547 service kisd /system/bin/kisd
548 user system
549 group system media
550
551 service console /system/bin/sh
552 class core
553 console
554 disabled
555 user shell
556 group shell log
557 seclabel u:r:shell:s0
558
559 on property:sys.powerctl=*
560 powerctl ${sys.powerctl}
561
562 on property:ro.debuggable=1
563 start console
564
565 # adbd is controlled via property triggers in init.<platform>.usb.rc
566 service adbd /sbin/adbd --root_seclabel=u:r:su:s0
567 class core
568 socket adbd stream 660 system system
569 disabled
570 seclabel u:r:adbd:s0
571
572 # adbd on at boot in emulator
573 on property:ro.kernel.qemu=1
574 start adbd
575 service servicemanager /system/bin/servicemanager
576 class core
577 user system
578 group system
579 critical
580
581 service vold /system/bin/vold
582 class core
583 socket vold stream 0660 root mount
584 ioprio be 2
585
586 # One shot invocation to deal with encrypted volume.
587 service defaultcrypto /system/bin/vdc --wait cryptfs mountdefaultencrypted
588 disabled
589 oneshot
590 # vold will set vold.decrypt to trigger_restart_framework (default
591 # encryption) or trigger_restart_min_framework (other encryption)
592
593 # One shot invocation to encrypt unencrypted volumes
594 service encrypt /system/bin/vdc --wait cryptfs enablecrypto inplace default
595 disabled
596 oneshot
597 # vold will set vold.decrypt to trigger_restart_framework (default
598 # encryption)
599
600 service netd /system/bin/netd
601 class main
602 socket netd stream 0660 root system
603 socket dnsproxyd stream 0660 root inet
604 socket mdns stream 0660 root system
605
606 #service debuggerd /system/bin/debuggerd
607 # class main
608
609 service ril-daemon /system/bin/rild
610 class main
611 socket rild stream 660 root radio
612 socket rild-debug stream 660 radio system
613 user root
614 group radio cache inet misc audio log
615
616 # adbd is controlled via property triggers in init.<platform>.usb.rc
617 service adbd /sbin/adbd
618 class core
619
620 service drvbd /system/bin/drvbd
621 class main
622 user system
623 group system
624
625 ## Custom service area (START)
626 # Please add custom service below
627 service nvram_daemon /system/bin/nvram_daemon
628 class main
629 user root
630 group system
631 oneshot
632
633 service NvRAMAgent /system/bin/nvram_agent_binder
634 user system
635 group system
636
637 service mdlogger /system/bin/mdlogger
638 class main
639 user shell
640 group shell system radio sdcard_rw inet
641 disabled
642 oneshot
643
644 service dualmdlogger /system/bin/dualmdlogger
645 class main
646 user shell
647 group shell system radio sdcard_rw inet
648 disabled
649 oneshot
650
651 service factory_no_image /system/bin/factory
652 disabled
653 oneshot
654
655 service factory_with_image /sbin/factory
656 disabled
657 oneshot
658
659 #
660 ## Custom service area (END)
661
662
663 on property:sys.mtk.no.factoryimage=1
664 start factory_no_image
665
666 on property:sys.mtk.no.factoryimage=0
667 start factory_with_image
668
669 #mass_storage,adb,acm
670 on property:ro.boot.usbconfig=0
671 write /sys/class/android_usb/android0/iSerial $ro.serialno
672 write /sys/class/android_usb/android0/enable 0
673 write /sys/class/android_usb/android0/idVendor 0e8d
674 write /sys/class/android_usb/android0/idProduct 2006
675 write /sys/class/android_usb/android0/f_acm/instances 1
676 write /sys/class/android_usb/android0/functions mass_storage,adb,acm
677 write /sys/class/android_usb/android0/enable 1
678 start adbd
679
680 #acm
681 on property:ro.boot.usbconfig=1
682 write /sys/class/android_usb/android0/enable 0
683 write /sys/class/android_usb/android0/iSerial " "
684 write /sys/class/android_usb/android0/idVendor 0e8d
685 write /sys/class/android_usb/android0/idProduct 2007
686 write /sys/class/android_usb/android0/f_acm/instances 1
687 write /sys/class/android_usb/android0/functions acm
688 write /sys/class/android_usb/android0/bDeviceClass 02
689 write /sys/class/android_usb/android0/enable 1