Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 1 | on early-init |
| 2 | start ueventd |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 3 | |
Mike Lockwood | a2dffa9 | 2010-06-15 20:57:59 -0700 | [diff] [blame] | 4 | # create mountpoints |
| 5 | mkdir /mnt 0775 root system |
| 6 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 7 | on init |
| 8 | |
| 9 | sysclktz 0 |
| 10 | |
| 11 | loglevel 3 |
| 12 | |
| 13 | # setup the global environment |
Brian Swetland | 02863b9 | 2010-09-19 03:36:39 -0700 | [diff] [blame] | 14 | export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin |
| 15 | export LD_LIBRARY_PATH /vendor/lib:/system/lib |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 16 | export ANDROID_BOOTLOGO 1 |
| 17 | export ANDROID_ROOT /system |
| 18 | export ANDROID_ASSETS /system/app |
| 19 | export ANDROID_DATA /data |
San Mehat | a9db22f | 2010-02-24 10:17:32 -0800 | [diff] [blame] | 20 | export ASEC_MOUNTPOINT /mnt/asec |
Kenny Root | c7858a3 | 2010-07-15 12:14:44 -0700 | [diff] [blame] | 21 | export LOOP_MOUNTPOINT /mnt/obb |
Eino-Ville Talvala | 1c9a996 | 2011-06-20 12:16:52 -0700 | [diff] [blame] | 22 | 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 Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 23 | |
| 24 | # Backward compatibility |
| 25 | symlink /system/etc /etc |
Brian Swetland | bb6f68c | 2009-09-18 15:31:23 -0700 | [diff] [blame] | 26 | symlink /sys/kernel/debug /d |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 27 | |
Brian Swetland | 02863b9 | 2010-09-19 03:36:39 -0700 | [diff] [blame] | 28 | # Right now vendor lives on the same filesystem as system, |
| 29 | # but someday that may change. |
| 30 | symlink /system/vendor /vendor |
San Mehat | 6ea3cc6 | 2010-02-19 18:25:22 -0800 | [diff] [blame] | 31 | |
Mike Chan | 89f235c | 2010-03-01 11:36:10 -0800 | [diff] [blame] | 32 | # Create cgroup mount point for cpu accounting |
| 33 | mkdir /acct |
| 34 | mount cgroup none /acct cpuacct |
| 35 | mkdir /acct/uid |
| 36 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 37 | mkdir /system |
| 38 | mkdir /data 0771 system system |
| 39 | mkdir /cache 0770 system cache |
Dmitry Shmidt | 720f08f | 2009-06-09 14:38:56 -0700 | [diff] [blame] | 40 | mkdir /config 0500 root root |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 41 | |
San Mehat | 6ea3cc6 | 2010-02-19 18:25:22 -0800 | [diff] [blame] | 42 | # Directory for putting things only root should see. |
| 43 | mkdir /mnt/secure 0700 root root |
| 44 | |
| 45 | # Directory for staging bindmounts |
| 46 | mkdir /mnt/secure/staging 0700 root root |
| 47 | |
| 48 | # Directory-target for where the secure container |
| 49 | # imagefile directory will be bind-mounted |
| 50 | mkdir /mnt/secure/asec 0700 root root |
| 51 | |
| 52 | # Secure container public mount points. |
| 53 | mkdir /mnt/asec 0700 root system |
| 54 | mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000 |
San Mehat | 900570e | 2010-01-06 10:38:49 -0800 | [diff] [blame] | 55 | |
Kenny Root | c7858a3 | 2010-07-15 12:14:44 -0700 | [diff] [blame] | 56 | # Filesystem image public mount points. |
| 57 | mkdir /mnt/obb 0700 root system |
| 58 | mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000 |
| 59 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 60 | write /proc/sys/kernel/panic_on_oops 1 |
| 61 | write /proc/sys/kernel/hung_task_timeout_secs 0 |
| 62 | write /proc/cpu/alignment 4 |
| 63 | write /proc/sys/kernel/sched_latency_ns 10000000 |
| 64 | write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 |
San Mehat | 4322f2d | 2009-06-29 08:47:43 -0700 | [diff] [blame] | 65 | write /proc/sys/kernel/sched_compat_yield 1 |
San Mehat | 7baff71 | 2009-09-16 13:32:23 -0700 | [diff] [blame] | 66 | write /proc/sys/kernel/sched_child_runs_first 0 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 67 | |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 68 | # Create cgroup mount points for process groups |
| 69 | mkdir /dev/cpuctl |
San Mehat | b91bf4b | 2010-02-27 08:20:11 -0800 | [diff] [blame] | 70 | mount cgroup none /dev/cpuctl cpu |
San Mehat | 92175e0 | 2010-01-17 12:21:42 -0800 | [diff] [blame] | 71 | chown system system /dev/cpuctl |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 72 | chown system system /dev/cpuctl/tasks |
| 73 | chmod 0777 /dev/cpuctl/tasks |
| 74 | write /dev/cpuctl/cpu.shares 1024 |
| 75 | |
| 76 | mkdir /dev/cpuctl/fg_boost |
| 77 | chown system system /dev/cpuctl/fg_boost/tasks |
| 78 | chmod 0777 /dev/cpuctl/fg_boost/tasks |
| 79 | write /dev/cpuctl/fg_boost/cpu.shares 1024 |
| 80 | |
| 81 | mkdir /dev/cpuctl/bg_non_interactive |
| 82 | chown system system /dev/cpuctl/bg_non_interactive/tasks |
| 83 | chmod 0777 /dev/cpuctl/bg_non_interactive/tasks |
| 84 | # 5.0 % |
| 85 | write /dev/cpuctl/bg_non_interactive/cpu.shares 52 |
San Mehat | 4933098 | 2009-04-21 14:34:19 -0700 | [diff] [blame] | 86 | |
JP Abgrall | 8e3ff70 | 2011-09-11 16:12:27 -0700 | [diff] [blame] | 87 | # Allow everybody to read the xt_qtaguid resource tracking misc dev. |
| 88 | # This is needed by any process that uses socket tagging. |
| 89 | chmod 0644 /dev/xt_qtaguid |
| 90 | |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 91 | on fs |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 92 | # mount mtd partitions |
| 93 | # Mount /system rw first to give the filesystem a chance to save a checkpoint |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 94 | mount yaffs2 mtd@system /system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 95 | mount yaffs2 mtd@system /system ro remount |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 96 | mount yaffs2 mtd@userdata /data nosuid nodev |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 97 | mount yaffs2 mtd@cache /cache nosuid nodev |
| 98 | |
| 99 | on post-fs |
Brian Swetland | 56de7a1 | 2010-09-08 15:06:45 -0700 | [diff] [blame] | 100 | # once everything is setup, no need to modify / |
| 101 | mount rootfs rootfs / ro remount |
| 102 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 103 | # We chown/chmod /cache again so because mount is run as root + defaults |
| 104 | chown system cache /cache |
| 105 | chmod 0770 /cache |
| 106 | |
| 107 | # This may have been created by the recovery system with odd permissions |
| 108 | chown system cache /cache/recovery |
| 109 | chmod 0770 /cache/recovery |
| 110 | |
| 111 | #change permissions on vmallocinfo so we can grab it from bugreports |
| 112 | chown root log /proc/vmallocinfo |
| 113 | chmod 0440 /proc/vmallocinfo |
| 114 | |
| 115 | #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks |
| 116 | chown root system /proc/kmsg |
| 117 | chmod 0440 /proc/kmsg |
| 118 | chown root system /proc/sysrq-trigger |
| 119 | chmod 0220 /proc/sysrq-trigger |
| 120 | |
| 121 | # create the lost+found directories, so as to enforce our permissions |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 122 | mkdir /cache/lost+found 0770 root root |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 123 | |
| 124 | on post-fs-data |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 125 | # We chown/chmod /data again so because mount is run as root + defaults |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 126 | chown system system /data |
| 127 | chmod 0771 /data |
| 128 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 129 | # Create dump dir and collect dumps. |
| 130 | # Do this before we mount cache so eventually we can use cache for |
| 131 | # storing dumps on platforms which do not have a dedicated dump partition. |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 132 | mkdir /data/dontpanic 0750 root log |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 133 | |
| 134 | # Collect apanic data, free resources and re-arm trigger |
| 135 | copy /proc/apanic_console /data/dontpanic/apanic_console |
Mike Lockwood | 25f1a5a | 2009-09-11 17:13:28 -0400 | [diff] [blame] | 136 | chown root log /data/dontpanic/apanic_console |
Mike Lockwood | 9332482 | 2009-09-08 22:55:59 -0400 | [diff] [blame] | 137 | chmod 0640 /data/dontpanic/apanic_console |
San Mehat | 020f35f | 2009-09-01 15:38:18 -0700 | [diff] [blame] | 138 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 139 | copy /proc/apanic_threads /data/dontpanic/apanic_threads |
Mike Lockwood | 25f1a5a | 2009-09-11 17:13:28 -0400 | [diff] [blame] | 140 | chown root log /data/dontpanic/apanic_threads |
Mike Lockwood | 9332482 | 2009-09-08 22:55:59 -0400 | [diff] [blame] | 141 | chmod 0640 /data/dontpanic/apanic_threads |
San Mehat | 020f35f | 2009-09-01 15:38:18 -0700 | [diff] [blame] | 142 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 143 | write /proc/apanic_console 1 |
| 144 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 145 | # create basic filesystem structure |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 146 | mkdir /data/misc 01771 system misc |
Jaikumar Ganesh | 1d36696 | 2009-05-05 22:28:54 -0700 | [diff] [blame] | 147 | mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth |
Jaikumar Ganesh | eafdd86 | 2010-01-07 20:24:55 -0800 | [diff] [blame] | 148 | mkdir /data/misc/bluetooth 0770 system system |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 149 | mkdir /data/misc/keystore 0700 keystore keystore |
Brian Carlstrom | 0491893 | 2011-06-30 22:50:29 -0700 | [diff] [blame] | 150 | mkdir /data/misc/keychain 0771 system system |
Chia-chi Yeh | 9bb4d41 | 2011-07-08 20:03:03 -0700 | [diff] [blame] | 151 | mkdir /data/misc/vpn 0770 system vpn |
Oscar Montemayor | d0aa32c | 2010-01-06 13:18:12 -0800 | [diff] [blame] | 152 | mkdir /data/misc/systemkeys 0700 system system |
Mike Lockwood | 48d116e | 2009-07-08 18:42:08 -0400 | [diff] [blame] | 153 | # give system access to wpa_supplicant.conf for backup and restore |
| 154 | mkdir /data/misc/wifi 0770 wifi wifi |
Amith Yamasani | eefef32 | 2009-07-02 12:08:13 -0700 | [diff] [blame] | 155 | chmod 0660 /data/misc/wifi/wpa_supplicant.conf |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 156 | mkdir /data/local 0771 shell shell |
| 157 | mkdir /data/local/tmp 0771 shell shell |
| 158 | mkdir /data/data 0771 system system |
| 159 | mkdir /data/app-private 0771 system system |
| 160 | mkdir /data/app 0771 system system |
| 161 | mkdir /data/property 0700 root root |
| 162 | |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 163 | # create dalvik-cache, so as to enforce our permissions |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 164 | mkdir /data/dalvik-cache 0771 system system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 165 | |
MÃ¥rten Kongstad | b45280d | 2011-05-30 10:24:54 +0200 | [diff] [blame] | 166 | # create resource-cache and double-check the perms |
| 167 | mkdir /data/resource-cache 0771 system system |
| 168 | chown system system /data/resource-cache |
| 169 | chmod 0771 /data/resource-cache |
| 170 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 171 | # create the lost+found directories, so as to enforce our permissions |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 172 | mkdir /data/lost+found 0770 root root |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 173 | |
Gloria Wang | 4640fc0 | 2010-10-26 14:10:22 -0700 | [diff] [blame] | 174 | # create directory for DRM plug-ins |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 175 | mkdir /data/drm 0774 drm drm |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 176 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 177 | # If there is no fs-post-data action in the init.<device>.rc file, you |
| 178 | # must uncomment this line, otherwise encrypted filesystems |
| 179 | # won't work. |
| 180 | # Set indication (checked by vold) that we have finished this action |
| 181 | #setprop vold.post_fs_data_done 1 |
| 182 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 183 | chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file |
| 184 | chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file |
Mike Lockwood | 9350a00 | 2011-07-06 12:45:49 -0400 | [diff] [blame] | 185 | chown system system /sys/class/android_usb/android0/f_rndis/ethaddr |
| 186 | chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 187 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 188 | on boot |
| 189 | # basic network init |
| 190 | ifup lo |
| 191 | hostname localhost |
| 192 | domainname localdomain |
| 193 | |
| 194 | # set RLIMIT_NICE to allow priorities from 19 to -20 |
| 195 | setrlimit 13 40 40 |
| 196 | |
Dianne Hackborn | 06787f4 | 2011-08-07 16:30:24 -0700 | [diff] [blame] | 197 | # Memory management. Basic kernel parameters, and allow the high |
| 198 | # level system server to be able to adjust the kernel OOM driver |
| 199 | # paramters to match how it is managing things. |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 200 | write /proc/sys/vm/overcommit_memory 1 |
The Android Open Source Project | e037fd7 | 2009-03-13 13:04:37 -0700 | [diff] [blame] | 201 | write /proc/sys/vm/min_free_order_shift 4 |
Dianne Hackborn | 06787f4 | 2011-08-07 16:30:24 -0700 | [diff] [blame] | 202 | chown root system /sys/module/lowmemorykiller/parameters/adj |
| 203 | chmod 0664 /sys/module/lowmemorykiller/parameters/adj |
| 204 | chown root system /sys/module/lowmemorykiller/parameters/minfree |
| 205 | chmod 0664 /sys/module/lowmemorykiller/parameters/minfree |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 206 | |
Dianne Hackborn | 06787f4 | 2011-08-07 16:30:24 -0700 | [diff] [blame] | 207 | # Set init and its forked children's oom_adj. |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 208 | write /proc/1/oom_adj -16 |
| 209 | |
San Mehat | 831d8e1 | 2009-10-13 12:24:47 -0700 | [diff] [blame] | 210 | # Tweak background writeout |
| 211 | write /proc/sys/vm/dirty_expire_centisecs 200 |
| 212 | write /proc/sys/vm/dirty_background_ratio 5 |
| 213 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 214 | # Permissions for System Server and daemons. |
| 215 | chown radio system /sys/android_power/state |
| 216 | chown radio system /sys/android_power/request_state |
| 217 | chown radio system /sys/android_power/acquire_full_wake_lock |
| 218 | chown radio system /sys/android_power/acquire_partial_wake_lock |
| 219 | chown radio system /sys/android_power/release_wake_lock |
| 220 | chown radio system /sys/power/state |
| 221 | chown radio system /sys/power/wake_lock |
| 222 | chown radio system /sys/power/wake_unlock |
| 223 | chmod 0660 /sys/power/state |
| 224 | chmod 0660 /sys/power/wake_lock |
| 225 | chmod 0660 /sys/power/wake_unlock |
| 226 | chown system system /sys/class/timed_output/vibrator/enable |
| 227 | chown system system /sys/class/leds/keyboard-backlight/brightness |
| 228 | chown system system /sys/class/leds/lcd-backlight/brightness |
| 229 | chown system system /sys/class/leds/button-backlight/brightness |
The Android Open Source Project | f614d64 | 2009-03-18 17:39:49 -0700 | [diff] [blame] | 230 | chown system system /sys/class/leds/jogball-backlight/brightness |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 231 | chown system system /sys/class/leds/red/brightness |
| 232 | chown system system /sys/class/leds/green/brightness |
| 233 | chown system system /sys/class/leds/blue/brightness |
| 234 | chown system system /sys/class/leds/red/device/grpfreq |
| 235 | chown system system /sys/class/leds/red/device/grppwm |
| 236 | chown system system /sys/class/leds/red/device/blink |
| 237 | chown system system /sys/class/leds/red/brightness |
| 238 | chown system system /sys/class/leds/green/brightness |
| 239 | chown system system /sys/class/leds/blue/brightness |
| 240 | chown system system /sys/class/leds/red/device/grpfreq |
| 241 | chown system system /sys/class/leds/red/device/grppwm |
| 242 | chown system system /sys/class/leds/red/device/blink |
| 243 | chown system system /sys/class/timed_output/vibrator/enable |
| 244 | chown system system /sys/module/sco/parameters/disable_esco |
| 245 | chown system system /sys/kernel/ipv4/tcp_wmem_min |
| 246 | chown system system /sys/kernel/ipv4/tcp_wmem_def |
| 247 | chown system system /sys/kernel/ipv4/tcp_wmem_max |
| 248 | chown system system /sys/kernel/ipv4/tcp_rmem_min |
| 249 | chown system system /sys/kernel/ipv4/tcp_rmem_def |
| 250 | chown system system /sys/kernel/ipv4/tcp_rmem_max |
| 251 | chown root radio /proc/cmdline |
| 252 | |
| 253 | # Define TCP buffer sizes for various networks |
| 254 | # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, |
| 255 | setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208 |
Robert Greenwalt | 1ac40f4 | 2011-09-07 15:40:26 -0700 | [diff] [blame] | 256 | setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576 |
| 257 | setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 258 | setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208 |
| 259 | setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040 |
| 260 | setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680 |
| 261 | |
Mathias Agopian | a40481b | 2011-03-03 18:48:30 -0800 | [diff] [blame] | 262 | # Set this property so surfaceflinger is not started by system_init |
| 263 | setprop system_init.startsurfaceflinger 0 |
| 264 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 265 | class_start core |
| 266 | class_start main |
| 267 | |
| 268 | on nonencrypted |
| 269 | class_start late_start |
| 270 | |
Dima Zavin | ca47cef | 2011-08-24 15:28:23 -0700 | [diff] [blame] | 271 | on charger |
| 272 | class_start charger |
| 273 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 274 | on property:vold.decrypt=trigger_reset_main |
| 275 | class_reset main |
| 276 | |
Ken Sumrall | c5c5103 | 2011-03-08 17:01:29 -0800 | [diff] [blame] | 277 | on property:vold.decrypt=trigger_load_persist_props |
| 278 | load_persist_props |
| 279 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 280 | on property:vold.decrypt=trigger_post_fs_data |
| 281 | trigger post-fs-data |
| 282 | |
Ken Sumrall | e434915 | 2011-01-17 14:26:34 -0800 | [diff] [blame] | 283 | on property:vold.decrypt=trigger_restart_min_framework |
| 284 | class_start main |
| 285 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 286 | on property:vold.decrypt=trigger_restart_framework |
| 287 | class_start main |
| 288 | class_start late_start |
| 289 | |
| 290 | on property:vold.decrypt=trigger_shutdown_framework |
| 291 | class_reset late_start |
| 292 | class_reset main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 293 | |
Mike Lockwood | 7804cbf | 2011-07-29 12:59:32 -0400 | [diff] [blame] | 294 | # Used to disable USB when switching states |
| 295 | on property:sys.usb.config=none |
| 296 | stop adbd |
| 297 | write /sys/class/android_usb/android0/enable 0 |
| 298 | write /sys/class/android_usb/android0/bDeviceClass 0 |
| 299 | setprop sys.usb.state $sys.usb.config |
| 300 | |
| 301 | # adb only USB configuration |
| 302 | # This should only be used during device bringup |
| 303 | # and as a fallback if the USB manager fails to set a standard configuration |
| 304 | on property:sys.usb.config=adb |
| 305 | write /sys/class/android_usb/android0/enable 0 |
| 306 | write /sys/class/android_usb/android0/idVendor 18d1 |
| 307 | write /sys/class/android_usb/android0/idProduct D002 |
| 308 | write /sys/class/android_usb/android0/functions $sys.usb.config |
| 309 | write /sys/class/android_usb/android0/enable 1 |
| 310 | start adbd |
| 311 | setprop sys.usb.state $sys.usb.config |
| 312 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 313 | # USB accessory configuration |
| 314 | on property:sys.usb.config=accessory |
| 315 | write /sys/class/android_usb/android0/enable 0 |
| 316 | write /sys/class/android_usb/android0/idVendor 18d1 |
| 317 | write /sys/class/android_usb/android0/idProduct 2d00 |
| 318 | write /sys/class/android_usb/android0/functions $sys.usb.config |
| 319 | write /sys/class/android_usb/android0/enable 1 |
| 320 | setprop sys.usb.state $sys.usb.config |
| 321 | |
| 322 | # USB accessory configuration, with adb |
| 323 | on property:sys.usb.config=accessory,adb |
| 324 | write /sys/class/android_usb/android0/enable 0 |
| 325 | write /sys/class/android_usb/android0/idVendor 18d1 |
| 326 | write /sys/class/android_usb/android0/idProduct 2d01 |
| 327 | write /sys/class/android_usb/android0/functions $sys.usb.config |
| 328 | write /sys/class/android_usb/android0/enable 1 |
| 329 | start adbd |
| 330 | setprop sys.usb.state $sys.usb.config |
| 331 | |
Mike Lockwood | 7804cbf | 2011-07-29 12:59:32 -0400 | [diff] [blame] | 332 | # Used to set USB configuration at boot and to switch the configuration |
| 333 | # when changing the default configuration |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 334 | on property:persist.sys.usb.config=* |
| 335 | setprop sys.usb.config $persist.sys.usb.config |
| 336 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 337 | ## Daemon processes to be run by init. |
| 338 | ## |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 339 | service ueventd /sbin/ueventd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 340 | class core |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 341 | critical |
| 342 | |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 343 | service console /system/bin/sh |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 344 | class core |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 345 | console |
| 346 | disabled |
| 347 | user shell |
| 348 | group log |
| 349 | |
Mike Lockwood | d49b4ef | 2010-11-19 09:12:27 -0500 | [diff] [blame] | 350 | on property:ro.debuggable=1 |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 351 | start console |
| 352 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 353 | # adbd is controlled via property triggers in init.<platform>.usb.rc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 354 | service adbd /sbin/adbd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 355 | class core |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 356 | disabled |
| 357 | |
| 358 | # adbd on at boot in emulator |
| 359 | on property:ro.kernel.qemu=1 |
| 360 | start adbd |
| 361 | |
Mike Lockwood | 535164e | 2011-06-22 08:36:53 -0400 | [diff] [blame] | 362 | # This property trigger has added to imitiate the previous behavior of "adb root". |
| 363 | # The adb gadget driver used to reset the USB bus when the adbd daemon exited, |
| 364 | # and the host side adb relied on this behavior to force it to reconnect with the |
| 365 | # new adbd instance after init relaunches it. So now we force the USB bus to reset |
| 366 | # here when adbd sets the service.adb.root property to 1. We also restart adbd here |
| 367 | # rather than waiting for init to notice its death and restarting it so the timing |
| 368 | # of USB resetting and adb restarting more closely matches the previous behavior. |
| 369 | on property:service.adb.root=1 |
| 370 | write /sys/class/android_usb/android0/enable 0 |
| 371 | restart adbd |
| 372 | write /sys/class/android_usb/android0/enable 1 |
| 373 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 374 | service servicemanager /system/bin/servicemanager |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 375 | class core |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 376 | user system |
Nick Kralevich | 333f24b | 2010-12-10 14:10:16 -0800 | [diff] [blame] | 377 | group system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 378 | critical |
| 379 | onrestart restart zygote |
| 380 | onrestart restart media |
| 381 | |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 382 | service vold /system/bin/vold |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 383 | class core |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 384 | socket vold stream 0660 root mount |
San Mehat | f0cb74e | 2010-02-26 10:01:14 -0800 | [diff] [blame] | 385 | ioprio be 2 |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 386 | |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 387 | service netd /system/bin/netd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 388 | class main |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 389 | socket netd stream 0660 root system |
Brad Fitzpatrick | 8c5669f | 2010-10-27 10:23:16 -0700 | [diff] [blame] | 390 | socket dnsproxyd stream 0660 root inet |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 391 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 392 | service debuggerd /system/bin/debuggerd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 393 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 394 | |
| 395 | service ril-daemon /system/bin/rild |
vidya rao | 04cf629 | 2011-06-24 12:15:20 -0700 | [diff] [blame] | 396 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 397 | socket rild stream 660 root radio |
| 398 | socket rild-debug stream 660 radio system |
| 399 | user root |
Kazuhiro Ondo | e65e946 | 2011-09-29 10:50:43 -0500 | [diff] [blame] | 400 | group radio cache inet misc audio sdcard_rw log |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 401 | |
Mathias Agopian | a40481b | 2011-03-03 18:48:30 -0800 | [diff] [blame] | 402 | service surfaceflinger /system/bin/surfaceflinger |
| 403 | class main |
| 404 | user system |
| 405 | group graphics |
| 406 | onrestart restart zygote |
| 407 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 408 | service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 409 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 410 | socket zygote stream 666 |
| 411 | onrestart write /sys/android_power/request_state wake |
| 412 | onrestart write /sys/power/state on |
Dan Bornstein | 1dec503 | 2009-10-09 14:24:51 -0700 | [diff] [blame] | 413 | onrestart restart media |
Brad Fitzpatrick | 6490257 | 2010-09-21 15:49:06 -0700 | [diff] [blame] | 414 | onrestart restart netd |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 415 | |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 416 | service drm /system/bin/drmserver |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 417 | class main |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 418 | user drm |
Jeffrey Tinker | 65c4df5 | 2011-10-06 18:19:46 -0700 | [diff] [blame] | 419 | group system inet drmrpc |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 420 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 421 | service media /system/bin/mediaserver |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 422 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 423 | user media |
Jeffrey Tinker | 65c4df5 | 2011-10-06 18:19:46 -0700 | [diff] [blame] | 424 | group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc |
San Mehat | f0cb74e | 2010-02-26 10:01:14 -0800 | [diff] [blame] | 425 | ioprio rt 4 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 426 | |
Mathias Agopian | 8b2cf9f | 2009-05-20 18:09:51 -0700 | [diff] [blame] | 427 | service bootanim /system/bin/bootanimation |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 428 | class main |
Mathias Agopian | 8b2cf9f | 2009-05-20 18:09:51 -0700 | [diff] [blame] | 429 | user graphics |
| 430 | group graphics |
| 431 | disabled |
| 432 | oneshot |
| 433 | |
Jaikumar Ganesh | 1320687 | 2009-09-18 15:45:43 -0700 | [diff] [blame] | 434 | service dbus /system/bin/dbus-daemon --system --nofork |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 435 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 436 | socket dbus stream 660 bluetooth bluetooth |
| 437 | user bluetooth |
| 438 | group bluetooth net_bt_admin |
| 439 | |
Jaikumar Ganesh | 1320687 | 2009-09-18 15:45:43 -0700 | [diff] [blame] | 440 | service bluetoothd /system/bin/bluetoothd -n |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 441 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 442 | socket bluetooth stream 660 bluetooth bluetooth |
| 443 | socket dbus_bluetooth stream 660 bluetooth bluetooth |
| 444 | # init.rc does not yet support applying capabilities, so run as root and |
Jaikumar Ganesh | 1d36696 | 2009-05-05 22:28:54 -0700 | [diff] [blame] | 445 | # let bluetoothd drop uid to bluetooth with the right linux capabilities |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 446 | group bluetooth net_bt_admin misc |
| 447 | disabled |
| 448 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 449 | service installd /system/bin/installd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 450 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 451 | socket installd stream 600 system system |
| 452 | |
Doug Zongker | d52f54c | 2009-07-23 15:18:34 -0700 | [diff] [blame] | 453 | service flash_recovery /system/etc/install-recovery.sh |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 454 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 455 | oneshot |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 456 | |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 457 | service racoon /system/bin/racoon |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 458 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 459 | socket racoon stream 600 system system |
Chia-chi Yeh | 9bb4d41 | 2011-07-08 20:03:03 -0700 | [diff] [blame] | 460 | # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port. |
Chia-chi Yeh | a246871 | 2011-08-08 10:11:40 -0700 | [diff] [blame] | 461 | group vpn net_admin inet |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 462 | disabled |
| 463 | oneshot |
| 464 | |
| 465 | service mtpd /system/bin/mtpd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 466 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 467 | socket mtpd stream 600 system system |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 468 | user vpn |
Chia-chi Yeh | a246871 | 2011-08-08 10:11:40 -0700 | [diff] [blame] | 469 | group vpn net_admin inet net_raw |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 470 | disabled |
| 471 | oneshot |
| 472 | |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 473 | service keystore /system/bin/keystore /data/misc/keystore |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 474 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 475 | user keystore |
| 476 | group keystore |
| 477 | socket keystore stream 666 |
| 478 | |
Mike Lockwood | abe3a9c | 2009-09-02 18:09:26 -0400 | [diff] [blame] | 479 | service dumpstate /system/bin/dumpstate -s |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 480 | class main |
Mike Lockwood | abe3a9c | 2009-09-02 18:09:26 -0400 | [diff] [blame] | 481 | socket dumpstate stream 0660 shell log |
| 482 | disabled |
| 483 | oneshot |