blob: 7215c4ee01df5509584b1bab87e9be1ebf111de9 [file] [log] [blame]
Dima Zavin3e7b7732011-12-16 14:23:22 -08001import /init.${ro.hardware}.rc
2
Colin Crossf83d0b92010-04-21 12:04:20 -07003on early-init
Dima Zavin4a253902011-11-04 12:45:52 -07004 # Set init and its forked children's oom_adj.
5 write /proc/1/oom_adj -16
6
Stephen Smalley1eee4192012-01-13 08:54:34 -05007 # Set the security context for the init process.
8 # This should occur before anything else (e.g. ueventd) is started.
9 setcon u:r:init:s0
10
Colin Crossf83d0b92010-04-21 12:04:20 -070011 start ueventd
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080012
Mike Lockwooda2dffa92010-06-15 20:57:59 -070013# create mountpoints
14 mkdir /mnt 0775 root system
15
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080016on init
17
18sysclktz 0
19
20loglevel 3
21
22# setup the global environment
Brian Swetland02863b92010-09-19 03:36:39 -070023 export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
24 export LD_LIBRARY_PATH /vendor/lib:/system/lib
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080025 export ANDROID_BOOTLOGO 1
26 export ANDROID_ROOT /system
27 export ANDROID_ASSETS /system/app
28 export ANDROID_DATA /data
San Mehata9db22f2010-02-24 10:17:32 -080029 export ASEC_MOUNTPOINT /mnt/asec
Kenny Rootc7858a32010-07-15 12:14:44 -070030 export LOOP_MOUNTPOINT /mnt/obb
Eino-Ville Talvala1c9a9962011-06-20 12:16:52 -070031 export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080032
33# Backward compatibility
34 symlink /system/etc /etc
Brian Swetlandbb6f68c2009-09-18 15:31:23 -070035 symlink /sys/kernel/debug /d
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080036
Brian Swetland02863b92010-09-19 03:36:39 -070037# Right now vendor lives on the same filesystem as system,
38# but someday that may change.
39 symlink /system/vendor /vendor
San Mehat6ea3cc62010-02-19 18:25:22 -080040
Mike Chan89f235c2010-03-01 11:36:10 -080041# Create cgroup mount point for cpu accounting
42 mkdir /acct
43 mount cgroup none /acct cpuacct
44 mkdir /acct/uid
45
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080046 mkdir /system
47 mkdir /data 0771 system system
48 mkdir /cache 0770 system cache
Dmitry Shmidt720f08f2009-06-09 14:38:56 -070049 mkdir /config 0500 root root
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080050
San Mehat6ea3cc62010-02-19 18:25:22 -080051 # Directory for putting things only root should see.
52 mkdir /mnt/secure 0700 root root
53
54 # Directory for staging bindmounts
55 mkdir /mnt/secure/staging 0700 root root
56
57 # Directory-target for where the secure container
58 # imagefile directory will be bind-mounted
59 mkdir /mnt/secure/asec 0700 root root
60
61 # Secure container public mount points.
62 mkdir /mnt/asec 0700 root system
63 mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
San Mehat900570e2010-01-06 10:38:49 -080064
Kenny Rootc7858a32010-07-15 12:14:44 -070065 # Filesystem image public mount points.
66 mkdir /mnt/obb 0700 root system
67 mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
68
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080069 write /proc/sys/kernel/panic_on_oops 1
70 write /proc/sys/kernel/hung_task_timeout_secs 0
71 write /proc/cpu/alignment 4
72 write /proc/sys/kernel/sched_latency_ns 10000000
73 write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
San Mehat4322f2d2009-06-29 08:47:43 -070074 write /proc/sys/kernel/sched_compat_yield 1
San Mehat7baff712009-09-16 13:32:23 -070075 write /proc/sys/kernel/sched_child_runs_first 0
Nick Kralevichd707fb32011-10-06 11:47:11 -070076 write /proc/sys/kernel/randomize_va_space 2
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077
San Mehat529520e2009-10-06 11:22:55 -070078# Create cgroup mount points for process groups
79 mkdir /dev/cpuctl
San Mehatb91bf4b2010-02-27 08:20:11 -080080 mount cgroup none /dev/cpuctl cpu
San Mehat92175e02010-01-17 12:21:42 -080081 chown system system /dev/cpuctl
San Mehat529520e2009-10-06 11:22:55 -070082 chown system system /dev/cpuctl/tasks
83 chmod 0777 /dev/cpuctl/tasks
84 write /dev/cpuctl/cpu.shares 1024
85
86 mkdir /dev/cpuctl/fg_boost
87 chown system system /dev/cpuctl/fg_boost/tasks
88 chmod 0777 /dev/cpuctl/fg_boost/tasks
89 write /dev/cpuctl/fg_boost/cpu.shares 1024
90
91 mkdir /dev/cpuctl/bg_non_interactive
92 chown system system /dev/cpuctl/bg_non_interactive/tasks
93 chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
94 # 5.0 %
95 write /dev/cpuctl/bg_non_interactive/cpu.shares 52
San Mehat49330982009-04-21 14:34:19 -070096
JP Abgrall8e3ff702011-09-11 16:12:27 -070097# Allow everybody to read the xt_qtaguid resource tracking misc dev.
98# This is needed by any process that uses socket tagging.
99 chmod 0644 /dev/xt_qtaguid
100
Colin Cross31712be2010-04-09 12:26:06 -0700101on fs
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800102# mount mtd partitions
103 # Mount /system rw first to give the filesystem a chance to save a checkpoint
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800104 mount yaffs2 mtd@system /system
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800105 mount yaffs2 mtd@system /system ro remount
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800106 mount yaffs2 mtd@userdata /data nosuid nodev
Colin Cross31712be2010-04-09 12:26:06 -0700107 mount yaffs2 mtd@cache /cache nosuid nodev
108
109on post-fs
Brian Swetland56de7a12010-09-08 15:06:45 -0700110 # once everything is setup, no need to modify /
111 mount rootfs rootfs / ro remount
112
Ken Sumrall752923c2010-12-03 16:33:31 -0800113 # We chown/chmod /cache again so because mount is run as root + defaults
114 chown system cache /cache
115 chmod 0770 /cache
Stephen Smalley1eee4192012-01-13 08:54:34 -0500116 # We restorecon /cache in case the cache partition has been reset.
117 restorecon /cache
Ken Sumrall752923c2010-12-03 16:33:31 -0800118
119 # This may have been created by the recovery system with odd permissions
120 chown system cache /cache/recovery
121 chmod 0770 /cache/recovery
Stephen Smalley1eee4192012-01-13 08:54:34 -0500122 # This may have been created by the recovery system with the wrong context.
123 restorecon /cache/recovery
Ken Sumrall752923c2010-12-03 16:33:31 -0800124
125 #change permissions on vmallocinfo so we can grab it from bugreports
126 chown root log /proc/vmallocinfo
127 chmod 0440 /proc/vmallocinfo
128
129 #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
130 chown root system /proc/kmsg
131 chmod 0440 /proc/kmsg
132 chown root system /proc/sysrq-trigger
133 chmod 0220 /proc/sysrq-trigger
134
135 # create the lost+found directories, so as to enforce our permissions
Chia-chi Yehea744142011-07-08 16:52:18 -0700136 mkdir /cache/lost+found 0770 root root
Ken Sumrall752923c2010-12-03 16:33:31 -0800137
138on post-fs-data
Colin Cross31712be2010-04-09 12:26:06 -0700139 # We chown/chmod /data again so because mount is run as root + defaults
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800140 chown system system /data
141 chmod 0771 /data
Stephen Smalley1eee4192012-01-13 08:54:34 -0500142 # We restorecon /data in case the userdata partition has been reset.
143 restorecon /data
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800144
San Mehatf26d6ce2009-09-01 09:11:04 -0700145 # Create dump dir and collect dumps.
146 # Do this before we mount cache so eventually we can use cache for
147 # storing dumps on platforms which do not have a dedicated dump partition.
Chia-chi Yehea744142011-07-08 16:52:18 -0700148 mkdir /data/dontpanic 0750 root log
San Mehatf26d6ce2009-09-01 09:11:04 -0700149
150 # Collect apanic data, free resources and re-arm trigger
151 copy /proc/apanic_console /data/dontpanic/apanic_console
Mike Lockwood25f1a5a2009-09-11 17:13:28 -0400152 chown root log /data/dontpanic/apanic_console
Mike Lockwood93324822009-09-08 22:55:59 -0400153 chmod 0640 /data/dontpanic/apanic_console
San Mehat020f35f2009-09-01 15:38:18 -0700154
San Mehatf26d6ce2009-09-01 09:11:04 -0700155 copy /proc/apanic_threads /data/dontpanic/apanic_threads
Mike Lockwood25f1a5a2009-09-11 17:13:28 -0400156 chown root log /data/dontpanic/apanic_threads
Mike Lockwood93324822009-09-08 22:55:59 -0400157 chmod 0640 /data/dontpanic/apanic_threads
San Mehat020f35f2009-09-01 15:38:18 -0700158
San Mehatf26d6ce2009-09-01 09:11:04 -0700159 write /proc/apanic_console 1
160
Ken Sumrall752923c2010-12-03 16:33:31 -0800161 # create basic filesystem structure
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800162 mkdir /data/misc 01771 system misc
Jaikumar Ganesh1d366962009-05-05 22:28:54 -0700163 mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
Jaikumar Ganesheafdd862010-01-07 20:24:55 -0800164 mkdir /data/misc/bluetooth 0770 system system
Chia-chi Yeh9b4f1ff2009-09-18 10:35:26 +0800165 mkdir /data/misc/keystore 0700 keystore keystore
Brian Carlstrom04918932011-06-30 22:50:29 -0700166 mkdir /data/misc/keychain 0771 system system
Chia-chi Yeh9bb4d412011-07-08 20:03:03 -0700167 mkdir /data/misc/vpn 0770 system vpn
Oscar Montemayord0aa32c2010-01-06 13:18:12 -0800168 mkdir /data/misc/systemkeys 0700 system system
Mike Lockwood48d116e2009-07-08 18:42:08 -0400169 # give system access to wpa_supplicant.conf for backup and restore
170 mkdir /data/misc/wifi 0770 wifi wifi
Amith Yamasanieefef322009-07-02 12:08:13 -0700171 chmod 0660 /data/misc/wifi/wpa_supplicant.conf
Chia-chi Yeh5ebced32012-03-07 14:52:10 -0800172 mkdir /data/local 0751 root root
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800173 mkdir /data/local/tmp 0771 shell shell
174 mkdir /data/data 0771 system system
175 mkdir /data/app-private 0771 system system
176 mkdir /data/app 0771 system system
177 mkdir /data/property 0700 root root
178
Chia-chi Yehea744142011-07-08 16:52:18 -0700179 # create dalvik-cache, so as to enforce our permissions
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800180 mkdir /data/dalvik-cache 0771 system system
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800181
MÃ¥rten Kongstadb45280d2011-05-30 10:24:54 +0200182 # create resource-cache and double-check the perms
183 mkdir /data/resource-cache 0771 system system
184 chown system system /data/resource-cache
185 chmod 0771 /data/resource-cache
186
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800187 # create the lost+found directories, so as to enforce our permissions
Chia-chi Yehea744142011-07-08 16:52:18 -0700188 mkdir /data/lost+found 0770 root root
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800189
James Dong09cdc0e2012-01-06 15:19:26 -0800190 # create directory for DRM plug-ins - give drm the read/write access to
191 # the following directory.
192 mkdir /data/drm 0770 drm drm
aimitakeshie572d592010-07-27 08:38:35 +0900193
Ken Sumrall752923c2010-12-03 16:33:31 -0800194 # If there is no fs-post-data action in the init.<device>.rc file, you
195 # must uncomment this line, otherwise encrypted filesystems
196 # won't work.
197 # Set indication (checked by vold) that we have finished this action
198 #setprop vold.post_fs_data_done 1
199
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700200 chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
201 chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
Mike Lockwood9350a002011-07-06 12:45:49 -0400202 chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
203 chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700204
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800205on boot
206# basic network init
207 ifup lo
208 hostname localhost
209 domainname localdomain
210
211# set RLIMIT_NICE to allow priorities from 19 to -20
212 setrlimit 13 40 40
213
Dianne Hackborn06787f42011-08-07 16:30:24 -0700214# Memory management. Basic kernel parameters, and allow the high
215# level system server to be able to adjust the kernel OOM driver
216# paramters to match how it is managing things.
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800217 write /proc/sys/vm/overcommit_memory 1
The Android Open Source Projecte037fd72009-03-13 13:04:37 -0700218 write /proc/sys/vm/min_free_order_shift 4
Dianne Hackborn06787f42011-08-07 16:30:24 -0700219 chown root system /sys/module/lowmemorykiller/parameters/adj
220 chmod 0664 /sys/module/lowmemorykiller/parameters/adj
221 chown root system /sys/module/lowmemorykiller/parameters/minfree
222 chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800223
San Mehat831d8e12009-10-13 12:24:47 -0700224 # Tweak background writeout
225 write /proc/sys/vm/dirty_expire_centisecs 200
226 write /proc/sys/vm/dirty_background_ratio 5
227
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800228 # Permissions for System Server and daemons.
229 chown radio system /sys/android_power/state
230 chown radio system /sys/android_power/request_state
231 chown radio system /sys/android_power/acquire_full_wake_lock
232 chown radio system /sys/android_power/acquire_partial_wake_lock
233 chown radio system /sys/android_power/release_wake_lock
234 chown radio system /sys/power/state
235 chown radio system /sys/power/wake_lock
236 chown radio system /sys/power/wake_unlock
237 chmod 0660 /sys/power/state
238 chmod 0660 /sys/power/wake_lock
239 chmod 0660 /sys/power/wake_unlock
240 chown system system /sys/class/timed_output/vibrator/enable
241 chown system system /sys/class/leds/keyboard-backlight/brightness
242 chown system system /sys/class/leds/lcd-backlight/brightness
243 chown system system /sys/class/leds/button-backlight/brightness
The Android Open Source Projectf614d642009-03-18 17:39:49 -0700244 chown system system /sys/class/leds/jogball-backlight/brightness
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800245 chown system system /sys/class/leds/red/brightness
246 chown system system /sys/class/leds/green/brightness
247 chown system system /sys/class/leds/blue/brightness
248 chown system system /sys/class/leds/red/device/grpfreq
249 chown system system /sys/class/leds/red/device/grppwm
250 chown system system /sys/class/leds/red/device/blink
251 chown system system /sys/class/leds/red/brightness
252 chown system system /sys/class/leds/green/brightness
253 chown system system /sys/class/leds/blue/brightness
254 chown system system /sys/class/leds/red/device/grpfreq
255 chown system system /sys/class/leds/red/device/grppwm
256 chown system system /sys/class/leds/red/device/blink
257 chown system system /sys/class/timed_output/vibrator/enable
258 chown system system /sys/module/sco/parameters/disable_esco
259 chown system system /sys/kernel/ipv4/tcp_wmem_min
260 chown system system /sys/kernel/ipv4/tcp_wmem_def
261 chown system system /sys/kernel/ipv4/tcp_wmem_max
262 chown system system /sys/kernel/ipv4/tcp_rmem_min
263 chown system system /sys/kernel/ipv4/tcp_rmem_def
264 chown system system /sys/kernel/ipv4/tcp_rmem_max
265 chown root radio /proc/cmdline
266
267# Define TCP buffer sizes for various networks
268# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
269 setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
Robert Greenwalt1ac40f42011-09-07 15:40:26 -0700270 setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
271 setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800272 setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
sinikangaa75df72011-10-16 12:32:13 -0700273 setprop net.tcp.buffersize.hspa 4094,87380,262144,4096,16384,262144
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800274 setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
275 setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
276
Mathias Agopiana40481b2011-03-03 18:48:30 -0800277# Set this property so surfaceflinger is not started by system_init
278 setprop system_init.startsurfaceflinger 0
279
Ken Sumrall752923c2010-12-03 16:33:31 -0800280 class_start core
281 class_start main
282
283on nonencrypted
284 class_start late_start
285
Dima Zavinca47cef2011-08-24 15:28:23 -0700286on charger
287 class_start charger
288
Ken Sumrall752923c2010-12-03 16:33:31 -0800289on property:vold.decrypt=trigger_reset_main
290 class_reset main
291
Ken Sumrallc5c51032011-03-08 17:01:29 -0800292on property:vold.decrypt=trigger_load_persist_props
293 load_persist_props
294
Ken Sumrall752923c2010-12-03 16:33:31 -0800295on property:vold.decrypt=trigger_post_fs_data
296 trigger post-fs-data
297
Ken Sumralle4349152011-01-17 14:26:34 -0800298on property:vold.decrypt=trigger_restart_min_framework
299 class_start main
300
Ken Sumrall752923c2010-12-03 16:33:31 -0800301on property:vold.decrypt=trigger_restart_framework
302 class_start main
303 class_start late_start
304
305on property:vold.decrypt=trigger_shutdown_framework
306 class_reset late_start
307 class_reset main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800308
Mike Lockwood7804cbf2011-07-29 12:59:32 -0400309# Used to disable USB when switching states
310on property:sys.usb.config=none
311 stop adbd
312 write /sys/class/android_usb/android0/enable 0
313 write /sys/class/android_usb/android0/bDeviceClass 0
Dima Zavinf90b0e02012-01-10 09:37:35 -0800314 setprop sys.usb.state ${sys.usb.config}
Mike Lockwood7804cbf2011-07-29 12:59:32 -0400315
316# adb only USB configuration
317# This should only be used during device bringup
318# and as a fallback if the USB manager fails to set a standard configuration
319on property:sys.usb.config=adb
320 write /sys/class/android_usb/android0/enable 0
321 write /sys/class/android_usb/android0/idVendor 18d1
322 write /sys/class/android_usb/android0/idProduct D002
Dima Zavinf90b0e02012-01-10 09:37:35 -0800323 write /sys/class/android_usb/android0/functions ${sys.usb.config}
Mike Lockwood7804cbf2011-07-29 12:59:32 -0400324 write /sys/class/android_usb/android0/enable 1
325 start adbd
Dima Zavinf90b0e02012-01-10 09:37:35 -0800326 setprop sys.usb.state ${sys.usb.config}
Mike Lockwood7804cbf2011-07-29 12:59:32 -0400327
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700328# USB accessory configuration
329on property:sys.usb.config=accessory
330 write /sys/class/android_usb/android0/enable 0
331 write /sys/class/android_usb/android0/idVendor 18d1
332 write /sys/class/android_usb/android0/idProduct 2d00
Dima Zavinf90b0e02012-01-10 09:37:35 -0800333 write /sys/class/android_usb/android0/functions ${sys.usb.config}
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700334 write /sys/class/android_usb/android0/enable 1
Dima Zavinf90b0e02012-01-10 09:37:35 -0800335 setprop sys.usb.state ${sys.usb.config}
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700336
337# USB accessory configuration, with adb
338on property:sys.usb.config=accessory,adb
339 write /sys/class/android_usb/android0/enable 0
340 write /sys/class/android_usb/android0/idVendor 18d1
341 write /sys/class/android_usb/android0/idProduct 2d01
Dima Zavinf90b0e02012-01-10 09:37:35 -0800342 write /sys/class/android_usb/android0/functions ${sys.usb.config}
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700343 write /sys/class/android_usb/android0/enable 1
344 start adbd
Dima Zavinf90b0e02012-01-10 09:37:35 -0800345 setprop sys.usb.state ${sys.usb.config}
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700346
Mike Lockwood7804cbf2011-07-29 12:59:32 -0400347# Used to set USB configuration at boot and to switch the configuration
348# when changing the default configuration
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700349on property:persist.sys.usb.config=*
Dima Zavinf90b0e02012-01-10 09:37:35 -0800350 setprop sys.usb.config ${persist.sys.usb.config}
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700351
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800352## Daemon processes to be run by init.
353##
Colin Crossf83d0b92010-04-21 12:04:20 -0700354service ueventd /sbin/ueventd
Ken Sumrall752923c2010-12-03 16:33:31 -0800355 class core
Colin Crossf83d0b92010-04-21 12:04:20 -0700356 critical
Stephen Smalley1eee4192012-01-13 08:54:34 -0500357 seclabel u:r:ueventd:s0
Colin Crossf83d0b92010-04-21 12:04:20 -0700358
Brian Swetlandb4d65392010-10-27 15:40:23 -0700359service console /system/bin/sh
Ken Sumrall752923c2010-12-03 16:33:31 -0800360 class core
Brian Swetlandb4d65392010-10-27 15:40:23 -0700361 console
362 disabled
363 user shell
364 group log
365
Mike Lockwoodd49b4ef2010-11-19 09:12:27 -0500366on property:ro.debuggable=1
Brian Swetlandb4d65392010-10-27 15:40:23 -0700367 start console
368
Mike Lockwood352dfdf2011-06-08 17:40:00 -0700369# adbd is controlled via property triggers in init.<platform>.usb.rc
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800370service adbd /sbin/adbd
Ken Sumrall752923c2010-12-03 16:33:31 -0800371 class core
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800372 disabled
Stephen Smalley1eee4192012-01-13 08:54:34 -0500373 seclabel u:r:adbd:s0
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800374
375# adbd on at boot in emulator
376on property:ro.kernel.qemu=1
377 start adbd
378
Mike Lockwood535164e2011-06-22 08:36:53 -0400379# This property trigger has added to imitiate the previous behavior of "adb root".
380# The adb gadget driver used to reset the USB bus when the adbd daemon exited,
381# and the host side adb relied on this behavior to force it to reconnect with the
382# new adbd instance after init relaunches it. So now we force the USB bus to reset
383# here when adbd sets the service.adb.root property to 1. We also restart adbd here
384# rather than waiting for init to notice its death and restarting it so the timing
385# of USB resetting and adb restarting more closely matches the previous behavior.
386on property:service.adb.root=1
387 write /sys/class/android_usb/android0/enable 0
388 restart adbd
389 write /sys/class/android_usb/android0/enable 1
390
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800391service servicemanager /system/bin/servicemanager
Ken Sumrall752923c2010-12-03 16:33:31 -0800392 class core
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800393 user system
Nick Kralevich333f24b2010-12-10 14:10:16 -0800394 group system
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800395 critical
396 onrestart restart zygote
397 onrestart restart media
Mathias Agopian04a87592011-10-31 14:27:36 -0700398 onrestart restart surfaceflinger
399 onrestart restart drm
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800400
The Android Open Source Projecte4749f32009-03-09 11:52:15 -0700401service vold /system/bin/vold
Ken Sumrall752923c2010-12-03 16:33:31 -0800402 class core
The Android Open Source Projecte4749f32009-03-09 11:52:15 -0700403 socket vold stream 0660 root mount
San Mehatf0cb74e2010-02-26 10:01:14 -0800404 ioprio be 2
The Android Open Source Projecte4749f32009-03-09 11:52:15 -0700405
San Mehat192277c2010-01-15 07:48:35 -0800406service netd /system/bin/netd
Ken Sumrall752923c2010-12-03 16:33:31 -0800407 class main
San Mehat192277c2010-01-15 07:48:35 -0800408 socket netd stream 0660 root system
Brad Fitzpatrick8c5669f2010-10-27 10:23:16 -0700409 socket dnsproxyd stream 0660 root inet
San Mehat192277c2010-01-15 07:48:35 -0800410
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800411service debuggerd /system/bin/debuggerd
Ken Sumrall752923c2010-12-03 16:33:31 -0800412 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800413
414service ril-daemon /system/bin/rild
vidya rao04cf6292011-06-24 12:15:20 -0700415 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800416 socket rild stream 660 root radio
417 socket rild-debug stream 660 radio system
418 user root
Kazuhiro Ondoe65e9462011-09-29 10:50:43 -0500419 group radio cache inet misc audio sdcard_rw log
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800420
Mathias Agopiana40481b2011-03-03 18:48:30 -0800421service surfaceflinger /system/bin/surfaceflinger
422 class main
423 user system
424 group graphics
425 onrestart restart zygote
426
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800427service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
Ken Sumrall752923c2010-12-03 16:33:31 -0800428 class main
Nick Kralevich25dd43a2012-01-27 13:06:53 -0800429 socket zygote stream 660 root system
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800430 onrestart write /sys/android_power/request_state wake
431 onrestart write /sys/power/state on
Dan Bornstein1dec5032009-10-09 14:24:51 -0700432 onrestart restart media
Brad Fitzpatrick64902572010-09-21 15:49:06 -0700433 onrestart restart netd
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800434
aimitakeshie572d592010-07-27 08:38:35 +0900435service drm /system/bin/drmserver
Ken Sumrall752923c2010-12-03 16:33:31 -0800436 class main
aimitakeshie572d592010-07-27 08:38:35 +0900437 user drm
Jeffrey Tinker65c4df52011-10-06 18:19:46 -0700438 group system inet drmrpc
aimitakeshie572d592010-07-27 08:38:35 +0900439
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800440service media /system/bin/mediaserver
Ken Sumrall752923c2010-12-03 16:33:31 -0800441 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800442 user media
Jeffrey Tinker65c4df52011-10-06 18:19:46 -0700443 group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
San Mehatf0cb74e2010-02-26 10:01:14 -0800444 ioprio rt 4
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800445
Mathias Agopian8b2cf9f2009-05-20 18:09:51 -0700446service bootanim /system/bin/bootanimation
Ken Sumrall752923c2010-12-03 16:33:31 -0800447 class main
Mathias Agopian8b2cf9f2009-05-20 18:09:51 -0700448 user graphics
449 group graphics
450 disabled
451 oneshot
452
Jaikumar Ganesh13206872009-09-18 15:45:43 -0700453service dbus /system/bin/dbus-daemon --system --nofork
Ken Sumrall752923c2010-12-03 16:33:31 -0800454 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800455 socket dbus stream 660 bluetooth bluetooth
456 user bluetooth
457 group bluetooth net_bt_admin
458
Jaikumar Ganesh13206872009-09-18 15:45:43 -0700459service bluetoothd /system/bin/bluetoothd -n
Ken Sumrall752923c2010-12-03 16:33:31 -0800460 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800461 socket bluetooth stream 660 bluetooth bluetooth
462 socket dbus_bluetooth stream 660 bluetooth bluetooth
463 # init.rc does not yet support applying capabilities, so run as root and
Jaikumar Ganesh1d366962009-05-05 22:28:54 -0700464 # let bluetoothd drop uid to bluetooth with the right linux capabilities
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800465 group bluetooth net_bt_admin misc
466 disabled
467
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800468service installd /system/bin/installd
Ken Sumrall752923c2010-12-03 16:33:31 -0800469 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800470 socket installd stream 600 system system
471
Doug Zongkerd52f54c2009-07-23 15:18:34 -0700472service flash_recovery /system/etc/install-recovery.sh
Ken Sumrall752923c2010-12-03 16:33:31 -0800473 class main
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800474 oneshot
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800475
Chia-chi Yeh51afbf52009-07-01 07:06:47 +0800476service racoon /system/bin/racoon
Ken Sumrall752923c2010-12-03 16:33:31 -0800477 class main
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800478 socket racoon stream 600 system system
Chia-chi Yeh9bb4d412011-07-08 20:03:03 -0700479 # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
Chia-chi Yeha2468712011-08-08 10:11:40 -0700480 group vpn net_admin inet
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800481 disabled
482 oneshot
483
484service mtpd /system/bin/mtpd
Ken Sumrall752923c2010-12-03 16:33:31 -0800485 class main
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800486 socket mtpd stream 600 system system
Chia-chi Yeh51afbf52009-07-01 07:06:47 +0800487 user vpn
Chia-chi Yeha2468712011-08-08 10:11:40 -0700488 group vpn net_admin inet net_raw
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800489 disabled
490 oneshot
491
Chia-chi Yeh9b4f1ff2009-09-18 10:35:26 +0800492service keystore /system/bin/keystore /data/misc/keystore
Ken Sumrall752923c2010-12-03 16:33:31 -0800493 class main
Chung-yih Wang1f75d702009-06-01 19:04:05 +0800494 user keystore
495 group keystore
496 socket keystore stream 666
497
Mike Lockwoodabe3a9c2009-09-02 18:09:26 -0400498service dumpstate /system/bin/dumpstate -s
Ken Sumrall752923c2010-12-03 16:33:31 -0800499 class main
Mike Lockwoodabe3a9c2009-09-02 18:09:26 -0400500 socket dumpstate stream 0660 shell log
501 disabled
502 oneshot