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 | |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 87 | on fs |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 88 | # mount mtd partitions |
| 89 | # 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] | 90 | mount yaffs2 mtd@system /system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 91 | mount yaffs2 mtd@system /system ro remount |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 92 | mount yaffs2 mtd@userdata /data nosuid nodev |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 93 | mount yaffs2 mtd@cache /cache nosuid nodev |
| 94 | |
| 95 | on post-fs |
Brian Swetland | 56de7a1 | 2010-09-08 15:06:45 -0700 | [diff] [blame] | 96 | # once everything is setup, no need to modify / |
| 97 | mount rootfs rootfs / ro remount |
| 98 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 99 | # We chown/chmod /cache again so because mount is run as root + defaults |
| 100 | chown system cache /cache |
| 101 | chmod 0770 /cache |
| 102 | |
| 103 | # This may have been created by the recovery system with odd permissions |
| 104 | chown system cache /cache/recovery |
| 105 | chmod 0770 /cache/recovery |
| 106 | |
| 107 | #change permissions on vmallocinfo so we can grab it from bugreports |
| 108 | chown root log /proc/vmallocinfo |
| 109 | chmod 0440 /proc/vmallocinfo |
| 110 | |
| 111 | #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks |
| 112 | chown root system /proc/kmsg |
| 113 | chmod 0440 /proc/kmsg |
| 114 | chown root system /proc/sysrq-trigger |
| 115 | chmod 0220 /proc/sysrq-trigger |
| 116 | |
| 117 | # create the lost+found directories, so as to enforce our permissions |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 118 | mkdir /cache/lost+found 0770 root root |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 119 | |
| 120 | on post-fs-data |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 121 | # 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] | 122 | chown system system /data |
| 123 | chmod 0771 /data |
| 124 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 125 | # Create dump dir and collect dumps. |
| 126 | # Do this before we mount cache so eventually we can use cache for |
| 127 | # 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] | 128 | mkdir /data/dontpanic 0750 root log |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 129 | |
| 130 | # Collect apanic data, free resources and re-arm trigger |
| 131 | copy /proc/apanic_console /data/dontpanic/apanic_console |
Mike Lockwood | 25f1a5a | 2009-09-11 17:13:28 -0400 | [diff] [blame] | 132 | chown root log /data/dontpanic/apanic_console |
Mike Lockwood | 9332482 | 2009-09-08 22:55:59 -0400 | [diff] [blame] | 133 | chmod 0640 /data/dontpanic/apanic_console |
San Mehat | 020f35f | 2009-09-01 15:38:18 -0700 | [diff] [blame] | 134 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 135 | copy /proc/apanic_threads /data/dontpanic/apanic_threads |
Mike Lockwood | 25f1a5a | 2009-09-11 17:13:28 -0400 | [diff] [blame] | 136 | chown root log /data/dontpanic/apanic_threads |
Mike Lockwood | 9332482 | 2009-09-08 22:55:59 -0400 | [diff] [blame] | 137 | chmod 0640 /data/dontpanic/apanic_threads |
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 | write /proc/apanic_console 1 |
| 140 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 141 | # create basic filesystem structure |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 142 | mkdir /data/misc 01771 system misc |
Jaikumar Ganesh | 1d36696 | 2009-05-05 22:28:54 -0700 | [diff] [blame] | 143 | mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth |
Jaikumar Ganesh | eafdd86 | 2010-01-07 20:24:55 -0800 | [diff] [blame] | 144 | mkdir /data/misc/bluetooth 0770 system system |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 145 | mkdir /data/misc/keystore 0700 keystore keystore |
Brian Carlstrom | 0491893 | 2011-06-30 22:50:29 -0700 | [diff] [blame] | 146 | mkdir /data/misc/keychain 0771 system system |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 147 | mkdir /data/misc/vpn 0770 system system |
Oscar Montemayor | d0aa32c | 2010-01-06 13:18:12 -0800 | [diff] [blame] | 148 | mkdir /data/misc/systemkeys 0700 system system |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 149 | mkdir /data/misc/vpn/profiles 0770 system system |
Mike Lockwood | 48d116e | 2009-07-08 18:42:08 -0400 | [diff] [blame] | 150 | # give system access to wpa_supplicant.conf for backup and restore |
| 151 | mkdir /data/misc/wifi 0770 wifi wifi |
Amith Yamasani | eefef32 | 2009-07-02 12:08:13 -0700 | [diff] [blame] | 152 | chmod 0660 /data/misc/wifi/wpa_supplicant.conf |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 153 | mkdir /data/local 0771 shell shell |
| 154 | mkdir /data/local/tmp 0771 shell shell |
| 155 | mkdir /data/data 0771 system system |
| 156 | mkdir /data/app-private 0771 system system |
| 157 | mkdir /data/app 0771 system system |
| 158 | mkdir /data/property 0700 root root |
| 159 | |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 160 | # create dalvik-cache, so as to enforce our permissions |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 161 | mkdir /data/dalvik-cache 0771 system system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 162 | |
| 163 | # create the lost+found directories, so as to enforce our permissions |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 164 | mkdir /data/lost+found 0770 root root |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 165 | |
Gloria Wang | 4640fc0 | 2010-10-26 14:10:22 -0700 | [diff] [blame] | 166 | # create directory for DRM plug-ins |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 167 | mkdir /data/drm 0774 drm drm |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 168 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 169 | # If there is no fs-post-data action in the init.<device>.rc file, you |
| 170 | # must uncomment this line, otherwise encrypted filesystems |
| 171 | # won't work. |
| 172 | # Set indication (checked by vold) that we have finished this action |
| 173 | #setprop vold.post_fs_data_done 1 |
| 174 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 175 | chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file |
| 176 | chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file |
Mike Lockwood | 9350a00 | 2011-07-06 12:45:49 -0400 | [diff] [blame] | 177 | chown system system /sys/class/android_usb/android0/f_rndis/ethaddr |
| 178 | chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 179 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 180 | on boot |
| 181 | # basic network init |
| 182 | ifup lo |
| 183 | hostname localhost |
| 184 | domainname localdomain |
| 185 | |
| 186 | # set RLIMIT_NICE to allow priorities from 19 to -20 |
| 187 | setrlimit 13 40 40 |
| 188 | |
| 189 | # Define the oom_adj values for the classes of processes that can be |
| 190 | # killed by the kernel. These are used in ActivityManagerService. |
| 191 | setprop ro.FOREGROUND_APP_ADJ 0 |
| 192 | setprop ro.VISIBLE_APP_ADJ 1 |
Dianne Hackborn | 8b0ec20 | 2010-06-10 17:52:37 -0700 | [diff] [blame] | 193 | setprop ro.PERCEPTIBLE_APP_ADJ 2 |
| 194 | setprop ro.HEAVY_WEIGHT_APP_ADJ 3 |
| 195 | setprop ro.SECONDARY_SERVER_ADJ 4 |
| 196 | setprop ro.BACKUP_APP_ADJ 5 |
| 197 | setprop ro.HOME_APP_ADJ 6 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 198 | setprop ro.HIDDEN_APP_MIN_ADJ 7 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 199 | setprop ro.EMPTY_APP_ADJ 15 |
| 200 | |
| 201 | # Define the memory thresholds at which the above process classes will |
| 202 | # be killed. These numbers are in pages (4k). |
Dianne Hackborn | 9efdcd9 | 2011-01-28 15:33:13 -0800 | [diff] [blame] | 203 | # These are currently tuned for tablets with approx 1GB RAM. |
| 204 | setprop ro.FOREGROUND_APP_MEM 8192 |
| 205 | setprop ro.VISIBLE_APP_MEM 10240 |
| 206 | setprop ro.PERCEPTIBLE_APP_MEM 12288 |
| 207 | setprop ro.HEAVY_WEIGHT_APP_MEM 12288 |
| 208 | setprop ro.SECONDARY_SERVER_MEM 14336 |
| 209 | setprop ro.BACKUP_APP_MEM 14336 |
| 210 | setprop ro.HOME_APP_MEM 14336 |
| 211 | setprop ro.HIDDEN_APP_MEM 16384 |
| 212 | setprop ro.EMPTY_APP_MEM 20480 |
| 213 | |
| 214 | # Old values for phones. Should probably be adjusted up for the next |
| 215 | # phone version. |
| 216 | #setprop ro.FOREGROUND_APP_MEM 2048 |
| 217 | #setprop ro.VISIBLE_APP_MEM 3072 |
| 218 | #setprop ro.PERCEPTIBLE_APP_MEM 4096 |
| 219 | #setprop ro.HEAVY_WEIGHT_APP_MEM 4096 |
| 220 | #setprop ro.SECONDARY_SERVER_MEM 6144 |
| 221 | #setprop ro.BACKUP_APP_MEM 6144 |
| 222 | #setprop ro.HOME_APP_MEM 6144 |
| 223 | #setprop ro.HIDDEN_APP_MEM 7168 |
| 224 | #setprop ro.EMPTY_APP_MEM 8192 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 225 | |
| 226 | # Write value must be consistent with the above properties. |
Dianne Hackborn | 8b0ec20 | 2010-06-10 17:52:37 -0700 | [diff] [blame] | 227 | # Note that the driver only supports 6 slots, so we have combined some of |
| 228 | # the classes into the same memory level; the associated processes of higher |
| 229 | # classes will still be killed first. |
| 230 | write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 231 | |
| 232 | write /proc/sys/vm/overcommit_memory 1 |
The Android Open Source Project | e037fd7 | 2009-03-13 13:04:37 -0700 | [diff] [blame] | 233 | write /proc/sys/vm/min_free_order_shift 4 |
Rebecca Schultz Zavin | 58fb822 | 2011-01-28 22:51:37 -0800 | [diff] [blame] | 234 | write /sys/module/lowmemorykiller/parameters/minfree 8192,10240,12288,14336,16384,20480 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 235 | |
| 236 | # Set init its forked children's oom_adj. |
| 237 | write /proc/1/oom_adj -16 |
| 238 | |
San Mehat | 831d8e1 | 2009-10-13 12:24:47 -0700 | [diff] [blame] | 239 | # Tweak background writeout |
| 240 | write /proc/sys/vm/dirty_expire_centisecs 200 |
| 241 | write /proc/sys/vm/dirty_background_ratio 5 |
| 242 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 243 | # Permissions for System Server and daemons. |
| 244 | chown radio system /sys/android_power/state |
| 245 | chown radio system /sys/android_power/request_state |
| 246 | chown radio system /sys/android_power/acquire_full_wake_lock |
| 247 | chown radio system /sys/android_power/acquire_partial_wake_lock |
| 248 | chown radio system /sys/android_power/release_wake_lock |
| 249 | chown radio system /sys/power/state |
| 250 | chown radio system /sys/power/wake_lock |
| 251 | chown radio system /sys/power/wake_unlock |
| 252 | chmod 0660 /sys/power/state |
| 253 | chmod 0660 /sys/power/wake_lock |
| 254 | chmod 0660 /sys/power/wake_unlock |
| 255 | chown system system /sys/class/timed_output/vibrator/enable |
| 256 | chown system system /sys/class/leds/keyboard-backlight/brightness |
| 257 | chown system system /sys/class/leds/lcd-backlight/brightness |
| 258 | chown system system /sys/class/leds/button-backlight/brightness |
The Android Open Source Project | f614d64 | 2009-03-18 17:39:49 -0700 | [diff] [blame] | 259 | chown system system /sys/class/leds/jogball-backlight/brightness |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 260 | chown system system /sys/class/leds/red/brightness |
| 261 | chown system system /sys/class/leds/green/brightness |
| 262 | chown system system /sys/class/leds/blue/brightness |
| 263 | chown system system /sys/class/leds/red/device/grpfreq |
| 264 | chown system system /sys/class/leds/red/device/grppwm |
| 265 | chown system system /sys/class/leds/red/device/blink |
| 266 | chown system system /sys/class/leds/red/brightness |
| 267 | chown system system /sys/class/leds/green/brightness |
| 268 | chown system system /sys/class/leds/blue/brightness |
| 269 | chown system system /sys/class/leds/red/device/grpfreq |
| 270 | chown system system /sys/class/leds/red/device/grppwm |
| 271 | chown system system /sys/class/leds/red/device/blink |
| 272 | chown system system /sys/class/timed_output/vibrator/enable |
| 273 | chown system system /sys/module/sco/parameters/disable_esco |
| 274 | chown system system /sys/kernel/ipv4/tcp_wmem_min |
| 275 | chown system system /sys/kernel/ipv4/tcp_wmem_def |
| 276 | chown system system /sys/kernel/ipv4/tcp_wmem_max |
| 277 | chown system system /sys/kernel/ipv4/tcp_rmem_min |
| 278 | chown system system /sys/kernel/ipv4/tcp_rmem_def |
| 279 | chown system system /sys/kernel/ipv4/tcp_rmem_max |
| 280 | chown root radio /proc/cmdline |
| 281 | |
| 282 | # Define TCP buffer sizes for various networks |
| 283 | # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, |
| 284 | setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208 |
| 285 | setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208 |
| 286 | setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208 |
| 287 | setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040 |
| 288 | setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680 |
| 289 | |
Mathias Agopian | a40481b | 2011-03-03 18:48:30 -0800 | [diff] [blame] | 290 | # Set this property so surfaceflinger is not started by system_init |
| 291 | setprop system_init.startsurfaceflinger 0 |
| 292 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 293 | class_start core |
| 294 | class_start main |
| 295 | |
| 296 | on nonencrypted |
| 297 | class_start late_start |
| 298 | |
| 299 | on property:vold.decrypt=trigger_reset_main |
| 300 | class_reset main |
| 301 | |
Ken Sumrall | c5c5103 | 2011-03-08 17:01:29 -0800 | [diff] [blame] | 302 | on property:vold.decrypt=trigger_load_persist_props |
| 303 | load_persist_props |
| 304 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 305 | on property:vold.decrypt=trigger_post_fs_data |
| 306 | trigger post-fs-data |
| 307 | |
Ken Sumrall | e434915 | 2011-01-17 14:26:34 -0800 | [diff] [blame] | 308 | on property:vold.decrypt=trigger_restart_min_framework |
| 309 | class_start main |
| 310 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 311 | on property:vold.decrypt=trigger_restart_framework |
| 312 | class_start main |
| 313 | class_start late_start |
| 314 | |
| 315 | on property:vold.decrypt=trigger_shutdown_framework |
| 316 | class_reset late_start |
| 317 | class_reset main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 318 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 319 | # USB accessory configuration |
| 320 | on property:sys.usb.config=accessory |
| 321 | write /sys/class/android_usb/android0/enable 0 |
| 322 | write /sys/class/android_usb/android0/idVendor 18d1 |
| 323 | write /sys/class/android_usb/android0/idProduct 2d00 |
| 324 | write /sys/class/android_usb/android0/functions $sys.usb.config |
| 325 | write /sys/class/android_usb/android0/enable 1 |
| 326 | setprop sys.usb.state $sys.usb.config |
| 327 | |
| 328 | # USB accessory configuration, with adb |
| 329 | on property:sys.usb.config=accessory,adb |
| 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 2d01 |
| 333 | write /sys/class/android_usb/android0/functions $sys.usb.config |
| 334 | write /sys/class/android_usb/android0/enable 1 |
| 335 | start adbd |
| 336 | setprop sys.usb.state $sys.usb.config |
| 337 | |
| 338 | on property:persist.sys.usb.config=* |
| 339 | setprop sys.usb.config $persist.sys.usb.config |
| 340 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 341 | ## Daemon processes to be run by init. |
| 342 | ## |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 343 | service ueventd /sbin/ueventd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 344 | class core |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 345 | critical |
| 346 | |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 347 | service console /system/bin/sh |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 348 | class core |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 349 | console |
| 350 | disabled |
| 351 | user shell |
| 352 | group log |
| 353 | |
Mike Lockwood | d49b4ef | 2010-11-19 09:12:27 -0500 | [diff] [blame] | 354 | on property:ro.debuggable=1 |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 355 | start console |
| 356 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 357 | # 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] | 358 | service adbd /sbin/adbd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 359 | class core |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 360 | disabled |
| 361 | |
| 362 | # adbd on at boot in emulator |
| 363 | on property:ro.kernel.qemu=1 |
| 364 | start adbd |
| 365 | |
Mike Lockwood | 535164e | 2011-06-22 08:36:53 -0400 | [diff] [blame] | 366 | # This property trigger has added to imitiate the previous behavior of "adb root". |
| 367 | # The adb gadget driver used to reset the USB bus when the adbd daemon exited, |
| 368 | # and the host side adb relied on this behavior to force it to reconnect with the |
| 369 | # new adbd instance after init relaunches it. So now we force the USB bus to reset |
| 370 | # here when adbd sets the service.adb.root property to 1. We also restart adbd here |
| 371 | # rather than waiting for init to notice its death and restarting it so the timing |
| 372 | # of USB resetting and adb restarting more closely matches the previous behavior. |
| 373 | on property:service.adb.root=1 |
| 374 | write /sys/class/android_usb/android0/enable 0 |
| 375 | restart adbd |
| 376 | write /sys/class/android_usb/android0/enable 1 |
| 377 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 378 | service servicemanager /system/bin/servicemanager |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 379 | class core |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 380 | user system |
Nick Kralevich | 333f24b | 2010-12-10 14:10:16 -0800 | [diff] [blame] | 381 | group system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 382 | critical |
| 383 | onrestart restart zygote |
| 384 | onrestart restart media |
| 385 | |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 386 | service vold /system/bin/vold |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 387 | class core |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 388 | socket vold stream 0660 root mount |
San Mehat | f0cb74e | 2010-02-26 10:01:14 -0800 | [diff] [blame] | 389 | ioprio be 2 |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 390 | |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 391 | service netd /system/bin/netd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 392 | class main |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 393 | socket netd stream 0660 root system |
Brad Fitzpatrick | 8c5669f | 2010-10-27 10:23:16 -0700 | [diff] [blame] | 394 | socket dnsproxyd stream 0660 root inet |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 395 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 396 | service debuggerd /system/bin/debuggerd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 397 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 398 | |
| 399 | service ril-daemon /system/bin/rild |
vidya rao | 04cf629 | 2011-06-24 12:15:20 -0700 | [diff] [blame] | 400 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 401 | socket rild stream 660 root radio |
| 402 | socket rild-debug stream 660 radio system |
| 403 | user root |
Brian Swetland | 5988ea7 | 2010-10-22 22:17:17 -0700 | [diff] [blame] | 404 | group radio cache inet misc audio sdcard_rw |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 405 | |
Mathias Agopian | a40481b | 2011-03-03 18:48:30 -0800 | [diff] [blame] | 406 | service surfaceflinger /system/bin/surfaceflinger |
| 407 | class main |
| 408 | user system |
| 409 | group graphics |
| 410 | onrestart restart zygote |
| 411 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 412 | 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] | 413 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 414 | socket zygote stream 666 |
| 415 | onrestart write /sys/android_power/request_state wake |
| 416 | onrestart write /sys/power/state on |
Dan Bornstein | 1dec503 | 2009-10-09 14:24:51 -0700 | [diff] [blame] | 417 | onrestart restart media |
Brad Fitzpatrick | 6490257 | 2010-09-21 15:49:06 -0700 | [diff] [blame] | 418 | onrestart restart netd |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 419 | |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 420 | service drm /system/bin/drmserver |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 421 | class main |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 422 | user drm |
Jeffrey Tinker | f642c3d | 2011-03-17 10:55:05 -0700 | [diff] [blame] | 423 | group system inet |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 424 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 425 | service media /system/bin/mediaserver |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 426 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 427 | user media |
Eric Laurent | f48fd5d | 2011-07-06 18:45:16 -0700 | [diff] [blame] | 428 | # STOPSHIP: remove system from mediaserver groups |
| 429 | group audio camera inet net_bt net_bt_admin system |
San Mehat | f0cb74e | 2010-02-26 10:01:14 -0800 | [diff] [blame] | 430 | ioprio rt 4 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 431 | |
Mathias Agopian | 8b2cf9f | 2009-05-20 18:09:51 -0700 | [diff] [blame] | 432 | service bootanim /system/bin/bootanimation |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 433 | class main |
Mathias Agopian | 8b2cf9f | 2009-05-20 18:09:51 -0700 | [diff] [blame] | 434 | user graphics |
| 435 | group graphics |
| 436 | disabled |
| 437 | oneshot |
| 438 | |
Jaikumar Ganesh | 1320687 | 2009-09-18 15:45:43 -0700 | [diff] [blame] | 439 | service dbus /system/bin/dbus-daemon --system --nofork |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 440 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 441 | socket dbus stream 660 bluetooth bluetooth |
| 442 | user bluetooth |
| 443 | group bluetooth net_bt_admin |
| 444 | |
Jaikumar Ganesh | 1320687 | 2009-09-18 15:45:43 -0700 | [diff] [blame] | 445 | service bluetoothd /system/bin/bluetoothd -n |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 446 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 447 | socket bluetooth stream 660 bluetooth bluetooth |
| 448 | socket dbus_bluetooth stream 660 bluetooth bluetooth |
| 449 | # 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] | 450 | # 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] | 451 | group bluetooth net_bt_admin misc |
| 452 | disabled |
| 453 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 454 | service installd /system/bin/installd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 455 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 456 | socket installd stream 600 system system |
| 457 | |
Doug Zongker | d52f54c | 2009-07-23 15:18:34 -0700 | [diff] [blame] | 458 | service flash_recovery /system/etc/install-recovery.sh |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 459 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 460 | oneshot |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 461 | |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 462 | service racoon /system/bin/racoon |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 463 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 464 | socket racoon stream 600 system system |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 465 | # racoon will setuid to vpn after getting necessary resources. |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 466 | group net_admin |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 467 | disabled |
| 468 | oneshot |
| 469 | |
| 470 | service mtpd /system/bin/mtpd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 471 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 472 | socket mtpd stream 600 system system |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 473 | user vpn |
| 474 | group vpn net_admin net_raw |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 475 | disabled |
| 476 | oneshot |
| 477 | |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 478 | service keystore /system/bin/keystore /data/misc/keystore |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 479 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 480 | user keystore |
| 481 | group keystore |
| 482 | socket keystore stream 666 |
| 483 | |
Mike Lockwood | abe3a9c | 2009-09-02 18:09:26 -0400 | [diff] [blame] | 484 | service dumpstate /system/bin/dumpstate -s |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 485 | class main |
Mike Lockwood | abe3a9c | 2009-09-02 18:09:26 -0400 | [diff] [blame] | 486 | socket dumpstate stream 0660 shell log |
| 487 | disabled |
| 488 | oneshot |