init.rc revision 002aecf6e8eda5d5affe412e20a22458c371a355
1# Copyright (C) 2012 The Android Open Source Project
2#
3# IMPORTANT: Do not create world writable files or directories.
4# This is a common source of Android security bugs.
5#
6
7import /init.environ.rc
8import /init.usb.rc
9import /init.${ro.hardware}.rc
10import /init.usb.configfs.rc
11import /init.${ro.zygote}.rc
12
13on early-init
14    # Set init and its forked children's oom_adj.
15    write /proc/1/oom_score_adj -1000
16
17    # Disable sysrq from keyboard
18    write /proc/sys/kernel/sysrq 0
19
20    # Set the security context of /adb_keys if present.
21    restorecon /adb_keys
22
23    # Shouldn't be necessary, but sdcard won't start without it. http://b/22568628.
24    mkdir /mnt 0775 root system
25
26    start ueventd
27
28on init
29    sysclktz 0
30
31    # Mix device-specific information into the entropy pool
32    copy /proc/cmdline /dev/urandom
33    copy /default.prop /dev/urandom
34
35    # Backward compatibility.
36    symlink /system/etc /etc
37    symlink /sys/kernel/debug /d
38
39    # Link /vendor to /system/vendor for devices without a vendor partition.
40    symlink /system/vendor /vendor
41
42    # Mount cgroup mount point for cpu accounting
43    mount cgroup none /acct cpuacct
44    mkdir /acct/uid
45
46    # Create energy-aware scheduler tuning nodes
47    mkdir /sys/fs/cgroup/stune
48    mount cgroup none /sys/fs/cgroup/stune schedtune
49    mkdir /sys/fs/cgroup/stune/foreground
50    chown system system /sys/fs/cgroup/stune
51    chown system system /sys/fs/cgroup/stune/foreground
52    chown system system /sys/fs/cgroup/stune/tasks
53    chown system system /sys/fs/cgroup/stune/foreground/tasks
54    chmod 0664 /sys/fs/cgroup/stune/tasks
55    chmod 0664 /sys/fs/cgroup/stune/foreground/tasks
56
57    # Mount staging areas for devices managed by vold
58    # See storage config details at http://source.android.com/tech/storage/
59    mount tmpfs tmpfs /mnt mode=0755,uid=0,gid=1000
60    restorecon_recursive /mnt
61
62    mkdir /mnt/secure 0700 root root
63    mkdir /mnt/secure/asec 0700 root root
64    mkdir /mnt/asec 0755 root system
65    mkdir /mnt/obb 0755 root system
66    mkdir /mnt/media_rw 0750 root media_rw
67    mkdir /mnt/user 0755 root root
68    mkdir /mnt/user/0 0755 root root
69    mkdir /mnt/expand 0771 system system
70    mkdir /mnt/appfuse 0711 root root
71
72    # Storage views to support runtime permissions
73    mkdir /mnt/runtime 0700 root root
74    mkdir /mnt/runtime/default 0755 root root
75    mkdir /mnt/runtime/default/self 0755 root root
76    mkdir /mnt/runtime/read 0755 root root
77    mkdir /mnt/runtime/read/self 0755 root root
78    mkdir /mnt/runtime/write 0755 root root
79    mkdir /mnt/runtime/write/self 0755 root root
80
81    # Symlink to keep legacy apps working in multi-user world
82    symlink /storage/self/primary /sdcard
83    symlink /mnt/user/0/primary /mnt/runtime/default/self/primary
84
85    # root memory control cgroup, used by lmkd
86    mkdir /dev/memcg 0700 root system
87    mount cgroup none /dev/memcg memory
88    # app mem cgroups, used by activity manager, lmkd and zygote
89    mkdir /dev/memcg/apps/ 0755 system system
90
91    write /proc/sys/kernel/panic_on_oops 1
92    write /proc/sys/kernel/hung_task_timeout_secs 0
93    write /proc/cpu/alignment 4
94
95    # scheduler tunables
96    # Disable auto-scaling of scheduler tunables with hotplug. The tunables
97    # will vary across devices in unpredictable ways if allowed to scale with
98    # cpu cores.
99    write /proc/sys/kernel/sched_tunable_scaling 0
100    write /proc/sys/kernel/sched_latency_ns 10000000
101    write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
102    write /proc/sys/kernel/sched_compat_yield 1
103    write /proc/sys/kernel/sched_child_runs_first 0
104
105    write /proc/sys/kernel/randomize_va_space 2
106    write /proc/sys/kernel/kptr_restrict 2
107    write /proc/sys/vm/mmap_min_addr 32768
108    write /proc/sys/net/ipv4/ping_group_range "0 2147483647"
109    write /proc/sys/net/unix/max_dgram_qlen 600
110    write /proc/sys/kernel/sched_rt_runtime_us 950000
111    write /proc/sys/kernel/sched_rt_period_us 1000000
112
113    # reflect fwmark from incoming packets onto generated replies
114    write /proc/sys/net/ipv4/fwmark_reflect 1
115    write /proc/sys/net/ipv6/fwmark_reflect 1
116
117    # set fwmark on accepted sockets
118    write /proc/sys/net/ipv4/tcp_fwmark_accept 1
119
120    # disable icmp redirects
121    write /proc/sys/net/ipv4/conf/all/accept_redirects 0
122    write /proc/sys/net/ipv6/conf/all/accept_redirects 0
123
124    # Create cgroup mount points for process groups
125    mkdir /dev/cpuctl
126    mount cgroup none /dev/cpuctl cpu
127    chown system system /dev/cpuctl
128    chown system system /dev/cpuctl/tasks
129    chmod 0666 /dev/cpuctl/tasks
130    write /dev/cpuctl/cpu.shares 1024
131    write /dev/cpuctl/cpu.rt_runtime_us 800000
132    write /dev/cpuctl/cpu.rt_period_us 1000000
133
134    mkdir /dev/cpuctl/bg_non_interactive
135    chown system system /dev/cpuctl/bg_non_interactive/tasks
136    chmod 0666 /dev/cpuctl/bg_non_interactive/tasks
137    # 5.0 %
138    write /dev/cpuctl/bg_non_interactive/cpu.shares 52
139    write /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us 700000
140    write /dev/cpuctl/bg_non_interactive/cpu.rt_period_us 1000000
141
142    # sets up initial cpusets for ActivityManager
143    mkdir /dev/cpuset
144    mount cpuset none /dev/cpuset
145
146    # this ensures that the cpusets are present and usable, but the device's
147    # init.rc must actually set the correct cpus
148    mkdir /dev/cpuset/foreground
149    write /dev/cpuset/foreground/cpus 0
150    write /dev/cpuset/foreground/mems 0
151    mkdir /dev/cpuset/foreground/boost
152    write /dev/cpuset/foreground/boost/cpus 0
153    write /dev/cpuset/foreground/boost/mems 0
154    mkdir /dev/cpuset/background
155    write /dev/cpuset/background/cpus 0
156    write /dev/cpuset/background/mems 0
157
158    # system-background is for system tasks that should only run on
159    # little cores, not on bigs
160    # to be used only by init, so don't change system-bg permissions
161    mkdir /dev/cpuset/system-background
162    write /dev/cpuset/system-background/cpus 0
163    write /dev/cpuset/system-background/mems 0
164
165    mkdir /dev/cpuset/top-app
166    write /dev/cpuset/top-app/cpus 0
167    write /dev/cpuset/top-app/mems 0
168
169    # change permissions for all cpusets we'll touch at runtime
170    chown system system /dev/cpuset
171    chown system system /dev/cpuset/foreground
172    chown system system /dev/cpuset/foreground/boost
173    chown system system /dev/cpuset/background
174    chown system system /dev/cpuset/system-background
175    chown system system /dev/cpuset/top-app
176    chown system system /dev/cpuset/tasks
177    chown system system /dev/cpuset/foreground/tasks
178    chown system system /dev/cpuset/foreground/boost/tasks
179    chown system system /dev/cpuset/background/tasks
180    chown system system /dev/cpuset/system-background/tasks
181    chown system system /dev/cpuset/top-app/tasks
182
183    # set system-background to 0775 so SurfaceFlinger can touch it
184    chmod 0775 /dev/cpuset/system-background
185
186    chmod 0664 /dev/cpuset/foreground/tasks
187    chmod 0664 /dev/cpuset/foreground/boost/tasks
188    chmod 0664 /dev/cpuset/background/tasks
189    chmod 0664 /dev/cpuset/system-background/tasks
190    chmod 0664 /dev/cpuset/top-app/tasks
191    chmod 0664 /dev/cpuset/tasks
192
193
194    # qtaguid will limit access to specific data based on group memberships.
195    #   net_bw_acct grants impersonation of socket owners.
196    #   net_bw_stats grants access to other apps' detailed tagged-socket stats.
197    chown root net_bw_acct /proc/net/xt_qtaguid/ctrl
198    chown root net_bw_stats /proc/net/xt_qtaguid/stats
199
200    # Allow everybody to read the xt_qtaguid resource tracking misc dev.
201    # This is needed by any process that uses socket tagging.
202    chmod 0644 /dev/xt_qtaguid
203
204    # Create location for fs_mgr to store abbreviated output from filesystem
205    # checker programs.
206    mkdir /dev/fscklogs 0770 root system
207
208    # pstore/ramoops previous console log
209    mount pstore pstore /sys/fs/pstore
210    chown system log /sys/fs/pstore/console-ramoops
211    chmod 0440 /sys/fs/pstore/console-ramoops
212    chown system log /sys/fs/pstore/pmsg-ramoops-0
213    chmod 0440 /sys/fs/pstore/pmsg-ramoops-0
214
215    # enable armv8_deprecated instruction hooks
216    write /proc/sys/abi/swp 1
217
218    # Linux's execveat() syscall may construct paths containing /dev/fd
219    # expecting it to point to /proc/self/fd
220    symlink /proc/self/fd /dev/fd
221
222# Healthd can trigger a full boot from charger mode by signaling this
223# property when the power button is held.
224on property:sys.boot_from_charger_mode=1
225    class_stop charger
226    trigger late-init
227
228# Load properties from /system/ + /factory after fs mount.
229on load_system_props_action
230    load_system_props
231
232on load_persist_props_action
233    load_persist_props
234    start logd
235    start logd-reinit
236
237# Indicate to fw loaders that the relevant mounts are up.
238on firmware_mounts_complete
239    rm /dev/.booting
240
241# Mount filesystems and start core system services.
242on late-init
243    trigger early-fs
244    trigger fs
245    trigger post-fs
246
247    # Load properties from /system/ + /factory after fs mount. Place
248    # this in another action so that the load will be scheduled after the prior
249    # issued fs triggers have completed.
250    trigger load_system_props_action
251
252    # Now we can mount /data. File encryption requires keymaster to decrypt
253    # /data, which in turn can only be loaded when system properties are present
254    trigger post-fs-data
255    trigger load_persist_props_action
256
257    # Remove a file to wake up anything waiting for firmware.
258    trigger firmware_mounts_complete
259
260    trigger early-boot
261    trigger boot
262
263
264on post-fs
265    start logd
266    # once everything is setup, no need to modify /
267    mount rootfs rootfs / ro remount
268    # Mount shared so changes propagate into child namespaces
269    mount rootfs rootfs / shared rec
270    # Mount default storage into root namespace
271    mount none /mnt/runtime/default /storage slave bind rec
272
273    # Make sure /sys/kernel/debug (if present) is labeled properly
274    restorecon_recursive /sys/kernel/debug
275
276    # We chown/chmod /cache again so because mount is run as root + defaults
277    chown system cache /cache
278    chmod 0770 /cache
279    # We restorecon /cache in case the cache partition has been reset.
280    restorecon_recursive /cache
281
282    # Create /cache/recovery in case it's not there. It'll also fix the odd
283    # permissions if created by the recovery system.
284    mkdir /cache/recovery 0770 system cache
285
286    # Backup/restore mechanism uses the cache partition
287    mkdir /cache/backup_stage 0700 system system
288    mkdir /cache/backup 0700 system system
289
290    #change permissions on vmallocinfo so we can grab it from bugreports
291    chown root log /proc/vmallocinfo
292    chmod 0440 /proc/vmallocinfo
293
294    chown root log /proc/slabinfo
295    chmod 0440 /proc/slabinfo
296
297    #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
298    chown root system /proc/kmsg
299    chmod 0440 /proc/kmsg
300    chown root system /proc/sysrq-trigger
301    chmod 0220 /proc/sysrq-trigger
302    chown system log /proc/last_kmsg
303    chmod 0440 /proc/last_kmsg
304
305    # make the selinux kernel policy world-readable
306    chmod 0444 /sys/fs/selinux/policy
307
308    # create the lost+found directories, so as to enforce our permissions
309    mkdir /cache/lost+found 0770 root root
310
311on post-fs-data
312    # We chown/chmod /data again so because mount is run as root + defaults
313    chown system system /data
314    chmod 0771 /data
315    # We restorecon /data in case the userdata partition has been reset.
316    restorecon /data
317
318    # start debuggerd to make debugging early-boot crashes easier.
319    start debuggerd
320    start debuggerd64
321
322    # Make sure we have the device encryption key.
323    start vold
324    installkey /data
325
326    # Start bootcharting as soon as possible after the data partition is
327    # mounted to collect more data.
328    mkdir /data/bootchart 0755 shell shell
329    bootchart_init
330
331    # Avoid predictable entropy pool. Carry over entropy from previous boot.
332    copy /data/system/entropy.dat /dev/urandom
333
334    # create basic filesystem structure
335    mkdir /data/misc 01771 system misc
336    mkdir /data/misc/bluedroid 02770 bluetooth net_bt_stack
337    # Fix the access permissions and group ownership for 'bt_config.conf'
338    chmod 0660 /data/misc/bluedroid/bt_config.conf
339    chown bluetooth net_bt_stack /data/misc/bluedroid/bt_config.conf
340    mkdir /data/misc/bluetooth 0770 system system
341    mkdir /data/misc/keystore 0700 keystore keystore
342    mkdir /data/misc/gatekeeper 0700 system system
343    mkdir /data/misc/keychain 0771 system system
344    mkdir /data/misc/net 0750 root shell
345    mkdir /data/misc/radio 0770 system radio
346    mkdir /data/misc/sms 0770 system radio
347    mkdir /data/misc/zoneinfo 0775 system system
348    mkdir /data/misc/vpn 0770 system vpn
349    mkdir /data/misc/shared_relro 0771 shared_relro shared_relro
350    mkdir /data/misc/systemkeys 0700 system system
351    mkdir /data/misc/wifi 0770 wifi wifi
352    mkdir /data/misc/wifi/sockets 0770 wifi wifi
353    mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
354    mkdir /data/misc/ethernet 0770 system system
355    mkdir /data/misc/dhcp 0770 dhcp dhcp
356    mkdir /data/misc/user 0771 root root
357    mkdir /data/misc/perfprofd 0775 root root
358    # give system access to wpa_supplicant.conf for backup and restore
359    chmod 0660 /data/misc/wifi/wpa_supplicant.conf
360    mkdir /data/local 0751 root root
361    mkdir /data/misc/media 0700 media media
362    mkdir /data/misc/vold 0700 root root
363    mkdir /data/misc/boottrace 0771 system shell
364    mkdir /data/misc/update_engine 0700 root root
365    mkdir /data/misc/trace 0700 root root
366
367    # For security reasons, /data/local/tmp should always be empty.
368    # Do not place files or directories in /data/local/tmp
369    mkdir /data/local/tmp 0771 shell shell
370    mkdir /data/data 0771 system system
371    mkdir /data/app-private 0771 system system
372    mkdir /data/app-ephemeral 0771 system system
373    mkdir /data/app-asec 0700 root root
374    mkdir /data/app-lib 0771 system system
375    mkdir /data/app 0771 system system
376    mkdir /data/property 0700 root root
377    mkdir /data/tombstones 0771 system system
378
379    # create dalvik-cache, so as to enforce our permissions
380    mkdir /data/dalvik-cache 0771 root root
381    # create the A/B OTA directory, so as to enforce our permissions
382    mkdir /data/ota 0771 root root
383
384    # create resource-cache and double-check the perms
385    mkdir /data/resource-cache 0771 system system
386    chown system system /data/resource-cache
387    chmod 0771 /data/resource-cache
388
389    # create the lost+found directories, so as to enforce our permissions
390    mkdir /data/lost+found 0770 root root
391
392    # create directory for DRM plug-ins - give drm the read/write access to
393    # the following directory.
394    mkdir /data/drm 0770 drm drm
395
396    # create directory for MediaDrm plug-ins - give drm the read/write access to
397    # the following directory.
398    mkdir /data/mediadrm 0770 mediadrm mediadrm
399
400    mkdir /data/anr 0775 system system
401
402    # symlink to bugreport storage location
403    rm /data/bugreports
404    symlink /data/user_de/0/com.android.shell/files/bugreports /data/bugreports
405
406    # Separate location for storing security policy files on data
407    mkdir /data/security 0711 system system
408
409    # Create all remaining /data root dirs so that they are made through init
410    # and get proper encryption policy installed
411    mkdir /data/backup 0700 system system
412    mkdir /data/ss 0700 system system
413
414    mkdir /data/system 0775 system system
415    mkdir /data/system/heapdump 0700 system system
416
417    mkdir /data/system_de 0770 system system
418    mkdir /data/system_ce 0770 system system
419
420    mkdir /data/misc_de 01771 system misc
421    mkdir /data/misc_ce 01771 system misc
422
423    mkdir /data/user 0711 system system
424    mkdir /data/user_de 0711 system system
425    symlink /data/data /data/user/0
426
427    mkdir /data/media 0770 media_rw media_rw
428    mkdir /data/media/obb 0770 media_rw media_rw
429
430    init_user0
431
432    # Reload policy from /data/security if present.
433    setprop selinux.reload_policy 1
434
435    # Set SELinux security contexts on upgrade or policy update.
436    restorecon_recursive /data
437
438    # Check any timezone data in /data is newer than the copy in /system, delete if not.
439    exec - system system -- /system/bin/tzdatacheck /system/usr/share/zoneinfo /data/misc/zoneinfo
440
441    # If there is no fs-post-data action in the init.<device>.rc file, you
442    # must uncomment this line, otherwise encrypted filesystems
443    # won't work.
444    # Set indication (checked by vold) that we have finished this action
445    #setprop vold.post_fs_data_done 1
446
447on boot
448    # basic network init
449    ifup lo
450    hostname localhost
451    domainname localdomain
452
453    # set RLIMIT_NICE to allow priorities from 19 to -20
454    setrlimit 13 40 40
455
456    # Memory management.  Basic kernel parameters, and allow the high
457    # level system server to be able to adjust the kernel OOM driver
458    # parameters to match how it is managing things.
459    write /proc/sys/vm/overcommit_memory 1
460    write /proc/sys/vm/min_free_order_shift 4
461    chown root system /sys/module/lowmemorykiller/parameters/adj
462    chmod 0664 /sys/module/lowmemorykiller/parameters/adj
463    chown root system /sys/module/lowmemorykiller/parameters/minfree
464    chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
465
466    # Tweak background writeout
467    write /proc/sys/vm/dirty_expire_centisecs 200
468    write /proc/sys/vm/dirty_background_ratio  5
469
470    # Permissions for System Server and daemons.
471    chown radio system /sys/android_power/state
472    chown radio system /sys/android_power/request_state
473    chown radio system /sys/android_power/acquire_full_wake_lock
474    chown radio system /sys/android_power/acquire_partial_wake_lock
475    chown radio system /sys/android_power/release_wake_lock
476    chown system system /sys/power/autosleep
477    chown system system /sys/power/state
478    chown system system /sys/power/wakeup_count
479    chown radio wakelock /sys/power/wake_lock
480    chown radio wakelock /sys/power/wake_unlock
481    chmod 0660 /sys/power/state
482    chmod 0660 /sys/power/wake_lock
483    chmod 0660 /sys/power/wake_unlock
484
485    chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
486    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
487    chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
488    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
489    chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
490    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
491    chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
492    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
493    chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
494    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
495    chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
496    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
497    chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
498    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
499    chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
500    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
501    chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
502    chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
503    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
504    chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
505    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
506    chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
507    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
508
509    # Assume SMP uses shared cpufreq policy for all CPUs
510    chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
511    chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
512
513    chown system system /sys/class/timed_output/vibrator/enable
514    chown system system /sys/class/leds/keyboard-backlight/brightness
515    chown system system /sys/class/leds/lcd-backlight/brightness
516    chown system system /sys/class/leds/button-backlight/brightness
517    chown system system /sys/class/leds/jogball-backlight/brightness
518    chown system system /sys/class/leds/red/brightness
519    chown system system /sys/class/leds/green/brightness
520    chown system system /sys/class/leds/blue/brightness
521    chown system system /sys/class/leds/red/device/grpfreq
522    chown system system /sys/class/leds/red/device/grppwm
523    chown system system /sys/class/leds/red/device/blink
524    chown system system /sys/class/timed_output/vibrator/enable
525    chown system system /sys/module/sco/parameters/disable_esco
526    chown system system /sys/kernel/ipv4/tcp_wmem_min
527    chown system system /sys/kernel/ipv4/tcp_wmem_def
528    chown system system /sys/kernel/ipv4/tcp_wmem_max
529    chown system system /sys/kernel/ipv4/tcp_rmem_min
530    chown system system /sys/kernel/ipv4/tcp_rmem_def
531    chown system system /sys/kernel/ipv4/tcp_rmem_max
532    chown root radio /proc/cmdline
533
534    # Define default initial receive window size in segments.
535    setprop net.tcp.default_init_rwnd 60
536
537    class_start core
538
539on nonencrypted
540    # A/B update verifier that marks a successful boot.
541    exec - root -- /system/bin/update_verifier nonencrypted
542    class_start main
543    class_start late_start
544
545on property:vold.decrypt=trigger_default_encryption
546    start defaultcrypto
547
548on property:vold.decrypt=trigger_encryption
549    start surfaceflinger
550    start encrypt
551
552on property:sys.init_log_level=*
553    loglevel ${sys.init_log_level}
554
555on charger
556    class_start charger
557
558on property:vold.decrypt=trigger_reset_main
559    class_reset main
560
561on property:vold.decrypt=trigger_load_persist_props
562    load_persist_props
563    start logd
564    start logd-reinit
565
566on property:vold.decrypt=trigger_post_fs_data
567    trigger post-fs-data
568
569on property:vold.decrypt=trigger_restart_min_framework
570    # A/B update verifier that marks a successful boot.
571    exec - root -- /system/bin/update_verifier trigger_restart_min_framework
572    class_start main
573
574on property:vold.decrypt=trigger_restart_framework
575    # A/B update verifier that marks a successful boot.
576    exec - root -- /system/bin/update_verifier trigger_restart_framework
577    class_start main
578    class_start late_start
579
580on property:vold.decrypt=trigger_shutdown_framework
581    class_reset late_start
582    class_reset main
583
584on property:sys.powerctl=*
585    powerctl ${sys.powerctl}
586
587# system server cannot write to /proc/sys files,
588# and chown/chmod does not work for /proc/sys/ entries.
589# So proxy writes through init.
590on property:sys.sysctl.extra_free_kbytes=*
591    write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes}
592
593# "tcp_default_init_rwnd" Is too long!
594on property:sys.sysctl.tcp_def_init_rwnd=*
595    write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd}
596
597
598## Daemon processes to be run by init.
599##
600service ueventd /sbin/ueventd
601    class core
602    critical
603    seclabel u:r:ueventd:s0
604
605service healthd /sbin/healthd
606    class core
607    critical
608    seclabel u:r:healthd:s0
609    group root system wakelock
610
611service console /system/bin/sh
612    class core
613    console
614    disabled
615    user shell
616    group shell log readproc
617    seclabel u:r:shell:s0
618
619on property:ro.debuggable=1
620    # Give writes to anyone for the trace folder on debug builds.
621    # The folder is used to store method traces.
622    chmod 0773 /data/misc/trace
623    start console
624
625service flash_recovery /system/bin/install-recovery.sh
626    class main
627    oneshot
628