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