Nick Kralevich | f3ef127 | 2012-03-14 15:22:54 -0700 | [diff] [blame] | 1 | # Copyright (C) 2012 The Android Open Source Project |
| 2 | # |
| 3 | # IMPORTANT: Do not create world writable files or directories. |
| 4 | # This is a common source of Android security bugs. |
| 5 | # |
| 6 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 7 | import /init.environ.rc |
Mike Lockwood | 4f5d517 | 2012-04-04 11:26:59 -0700 | [diff] [blame] | 8 | import /init.usb.rc |
Mike Lockwood | 35ea5e4 | 2012-08-28 10:25:13 -0700 | [diff] [blame] | 9 | import /init.${ro.hardware}.rc |
Todd Poynor | f1c50bf | 2012-09-20 20:10:53 -0700 | [diff] [blame] | 10 | import /init.trace.rc |
Dima Zavin | 7634bf8 | 2011-12-16 14:23:22 -0800 | [diff] [blame] | 11 | |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 12 | on early-init |
Dima Zavin | 4a25390 | 2011-11-04 12:45:52 -0700 | [diff] [blame] | 13 | # Set init and its forked children's oom_adj. |
| 14 | write /proc/1/oom_adj -16 |
| 15 | |
Stephen Smalley | 5e1461d | 2013-12-23 16:26:46 -0500 | [diff] [blame] | 16 | # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls. |
| 17 | write /sys/fs/selinux/checkreqprot 0 |
| 18 | |
Stephen Smalley | 1eee419 | 2012-01-13 08:54:34 -0500 | [diff] [blame] | 19 | # Set the security context for the init process. |
| 20 | # This should occur before anything else (e.g. ueventd) is started. |
| 21 | setcon u:r:init:s0 |
| 22 | |
Stephen Smalley | deb41e5 | 2013-10-01 09:21:47 -0400 | [diff] [blame] | 23 | # Set the security context of /adb_keys if present. |
| 24 | restorecon /adb_keys |
| 25 | |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 26 | start ueventd |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 27 | |
Mike Lockwood | a2dffa9 | 2010-06-15 20:57:59 -0700 | [diff] [blame] | 28 | # create mountpoints |
| 29 | mkdir /mnt 0775 root system |
| 30 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 31 | on init |
| 32 | |
| 33 | sysclktz 0 |
| 34 | |
| 35 | loglevel 3 |
| 36 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 37 | # Backward compatibility |
| 38 | symlink /system/etc /etc |
Brian Swetland | bb6f68c | 2009-09-18 15:31:23 -0700 | [diff] [blame] | 39 | symlink /sys/kernel/debug /d |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 40 | |
Brian Swetland | 02863b9 | 2010-09-19 03:36:39 -0700 | [diff] [blame] | 41 | # Right now vendor lives on the same filesystem as system, |
| 42 | # but someday that may change. |
| 43 | symlink /system/vendor /vendor |
San Mehat | 6ea3cc6 | 2010-02-19 18:25:22 -0800 | [diff] [blame] | 44 | |
Mike Chan | 89f235c | 2010-03-01 11:36:10 -0800 | [diff] [blame] | 45 | # Create cgroup mount point for cpu accounting |
| 46 | mkdir /acct |
| 47 | mount cgroup none /acct cpuacct |
| 48 | mkdir /acct/uid |
| 49 | |
Rom Lemarchand | 435a52e | 2013-07-10 13:00:42 -0700 | [diff] [blame] | 50 | # Create cgroup mount point for memory |
Rom Lemarchand | 67b00d8 | 2013-09-10 17:39:30 -0700 | [diff] [blame] | 51 | mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000 |
| 52 | mkdir /sys/fs/cgroup/memory 0750 root system |
Rom Lemarchand | 435a52e | 2013-07-10 13:00:42 -0700 | [diff] [blame] | 53 | mount cgroup none /sys/fs/cgroup/memory memory |
| 54 | write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1 |
| 55 | chown root system /sys/fs/cgroup/memory/tasks |
| 56 | chmod 0660 /sys/fs/cgroup/memory/tasks |
Rom Lemarchand | 67b00d8 | 2013-09-10 17:39:30 -0700 | [diff] [blame] | 57 | mkdir /sys/fs/cgroup/memory/sw 0750 root system |
Rom Lemarchand | 435a52e | 2013-07-10 13:00:42 -0700 | [diff] [blame] | 58 | write /sys/fs/cgroup/memory/sw/memory.swappiness 100 |
| 59 | write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1 |
| 60 | chown root system /sys/fs/cgroup/memory/sw/tasks |
| 61 | chmod 0660 /sys/fs/cgroup/memory/sw/tasks |
| 62 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 63 | mkdir /system |
| 64 | mkdir /data 0771 system system |
| 65 | mkdir /cache 0770 system cache |
Dmitry Shmidt | 720f08f | 2009-06-09 14:38:56 -0700 | [diff] [blame] | 66 | mkdir /config 0500 root root |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 67 | |
Jeff Sharkey | bfcd810 | 2012-08-22 13:57:25 -0700 | [diff] [blame] | 68 | # See storage config details at http://source.android.com/tech/storage/ |
Jeff Sharkey | 5dd0f86 | 2012-08-17 16:01:16 -0700 | [diff] [blame] | 69 | mkdir /mnt/shell 0700 shell shell |
Jeff Sharkey | e93a051 | 2013-10-08 10:14:24 -0700 | [diff] [blame] | 70 | mkdir /mnt/media_rw 0700 media_rw media_rw |
Jeff Sharkey | 44d6342 | 2013-09-12 09:44:48 -0700 | [diff] [blame] | 71 | mkdir /storage 0751 root sdcard_r |
Jeff Sharkey | 5dd0f86 | 2012-08-17 16:01:16 -0700 | [diff] [blame] | 72 | |
San Mehat | 6ea3cc6 | 2010-02-19 18:25:22 -0800 | [diff] [blame] | 73 | # Directory for putting things only root should see. |
| 74 | mkdir /mnt/secure 0700 root root |
| 75 | |
| 76 | # Directory for staging bindmounts |
| 77 | mkdir /mnt/secure/staging 0700 root root |
| 78 | |
| 79 | # Directory-target for where the secure container |
| 80 | # imagefile directory will be bind-mounted |
| 81 | mkdir /mnt/secure/asec 0700 root root |
| 82 | |
| 83 | # Secure container public mount points. |
| 84 | mkdir /mnt/asec 0700 root system |
| 85 | mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000 |
San Mehat | 900570e | 2010-01-06 10:38:49 -0800 | [diff] [blame] | 86 | |
Kenny Root | c7858a3 | 2010-07-15 12:14:44 -0700 | [diff] [blame] | 87 | # Filesystem image public mount points. |
| 88 | mkdir /mnt/obb 0700 root system |
| 89 | mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000 |
| 90 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 91 | write /proc/sys/kernel/panic_on_oops 1 |
| 92 | write /proc/sys/kernel/hung_task_timeout_secs 0 |
| 93 | write /proc/cpu/alignment 4 |
| 94 | write /proc/sys/kernel/sched_latency_ns 10000000 |
| 95 | write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 |
San Mehat | 4322f2d | 2009-06-29 08:47:43 -0700 | [diff] [blame] | 96 | write /proc/sys/kernel/sched_compat_yield 1 |
San Mehat | 7baff71 | 2009-09-16 13:32:23 -0700 | [diff] [blame] | 97 | write /proc/sys/kernel/sched_child_runs_first 0 |
Nick Kralevich | d707fb3 | 2011-10-06 11:47:11 -0700 | [diff] [blame] | 98 | write /proc/sys/kernel/randomize_va_space 2 |
Nick Kralevich | 2e7c833 | 2011-11-02 08:51:37 -0700 | [diff] [blame] | 99 | write /proc/sys/kernel/kptr_restrict 2 |
Nick Kralevich | f9557fb | 2011-11-08 14:38:53 -0800 | [diff] [blame] | 100 | write /proc/sys/kernel/dmesg_restrict 1 |
Nick Kralevich | 27cca21 | 2011-12-05 14:48:08 -0800 | [diff] [blame] | 101 | write /proc/sys/vm/mmap_min_addr 32768 |
Nick Kralevich | be341cc | 2013-02-21 18:36:43 -0800 | [diff] [blame] | 102 | write /proc/sys/net/ipv4/ping_group_range "0 2147483647" |
Glenn Kasten | b91bd9f | 2012-04-19 16:18:37 -0700 | [diff] [blame] | 103 | write /proc/sys/kernel/sched_rt_runtime_us 950000 |
| 104 | write /proc/sys/kernel/sched_rt_period_us 1000000 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 105 | |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 106 | # Create cgroup mount points for process groups |
| 107 | mkdir /dev/cpuctl |
San Mehat | b91bf4b | 2010-02-27 08:20:11 -0800 | [diff] [blame] | 108 | mount cgroup none /dev/cpuctl cpu |
San Mehat | 92175e0 | 2010-01-17 12:21:42 -0800 | [diff] [blame] | 109 | chown system system /dev/cpuctl |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 110 | chown system system /dev/cpuctl/tasks |
Glenn Kasten | b91bd9f | 2012-04-19 16:18:37 -0700 | [diff] [blame] | 111 | chmod 0660 /dev/cpuctl/tasks |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 112 | write /dev/cpuctl/cpu.shares 1024 |
Glenn Kasten | b91bd9f | 2012-04-19 16:18:37 -0700 | [diff] [blame] | 113 | write /dev/cpuctl/cpu.rt_runtime_us 950000 |
| 114 | write /dev/cpuctl/cpu.rt_period_us 1000000 |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 115 | |
Dima Zavin | df44b88 | 2012-06-04 10:45:15 -0700 | [diff] [blame] | 116 | mkdir /dev/cpuctl/apps |
| 117 | chown system system /dev/cpuctl/apps/tasks |
| 118 | chmod 0666 /dev/cpuctl/apps/tasks |
| 119 | write /dev/cpuctl/apps/cpu.shares 1024 |
Dima Zavin | 5f2d00b | 2012-06-04 13:15:01 -0700 | [diff] [blame] | 120 | write /dev/cpuctl/apps/cpu.rt_runtime_us 800000 |
Dima Zavin | df44b88 | 2012-06-04 10:45:15 -0700 | [diff] [blame] | 121 | write /dev/cpuctl/apps/cpu.rt_period_us 1000000 |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 122 | |
Dima Zavin | df44b88 | 2012-06-04 10:45:15 -0700 | [diff] [blame] | 123 | mkdir /dev/cpuctl/apps/bg_non_interactive |
| 124 | chown system system /dev/cpuctl/apps/bg_non_interactive/tasks |
| 125 | chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks |
San Mehat | 529520e | 2009-10-06 11:22:55 -0700 | [diff] [blame] | 126 | # 5.0 % |
Dima Zavin | df44b88 | 2012-06-04 10:45:15 -0700 | [diff] [blame] | 127 | write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52 |
Dima Zavin | 5f2d00b | 2012-06-04 13:15:01 -0700 | [diff] [blame] | 128 | write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000 |
Dima Zavin | df44b88 | 2012-06-04 10:45:15 -0700 | [diff] [blame] | 129 | write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000 |
Glenn Kasten | b91bd9f | 2012-04-19 16:18:37 -0700 | [diff] [blame] | 130 | |
JP Abgrall | 3e54aab | 2013-01-04 14:34:58 -0800 | [diff] [blame] | 131 | # qtaguid will limit access to specific data based on group memberships. |
| 132 | # net_bw_acct grants impersonation of socket owners. |
| 133 | # net_bw_stats grants access to other apps' detailed tagged-socket stats. |
| 134 | chown root net_bw_acct /proc/net/xt_qtaguid/ctrl |
| 135 | chown root net_bw_stats /proc/net/xt_qtaguid/stats |
| 136 | |
JP Abgrall | 8e3ff70 | 2011-09-11 16:12:27 -0700 | [diff] [blame] | 137 | # Allow everybody to read the xt_qtaguid resource tracking misc dev. |
| 138 | # This is needed by any process that uses socket tagging. |
| 139 | chmod 0644 /dev/xt_qtaguid |
| 140 | |
Ken Sumrall | 4eaf905 | 2013-09-18 17:49:21 -0700 | [diff] [blame] | 141 | # Create location for fs_mgr to store abbreviated output from filesystem |
| 142 | # checker programs. |
| 143 | mkdir /dev/fscklogs 0770 root system |
| 144 | |
Todd Poynor | 479efb5 | 2013-11-21 20:23:54 -0800 | [diff] [blame] | 145 | # pstore/ramoops previous console log |
| 146 | mount pstore pstore /sys/fs/pstore |
| 147 | chown system log /sys/fs/pstore/console-ramoops |
| 148 | chmod 0440 /sys/fs/pstore/console-ramoops |
| 149 | |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 150 | on post-fs |
Brian Swetland | 56de7a1 | 2010-09-08 15:06:45 -0700 | [diff] [blame] | 151 | # once everything is setup, no need to modify / |
| 152 | mount rootfs rootfs / ro remount |
Jeff Sharkey | 885342a | 2012-08-14 21:00:22 -0700 | [diff] [blame] | 153 | # mount shared so changes propagate into child namespaces |
| 154 | mount rootfs rootfs / shared rec |
Brian Swetland | 56de7a1 | 2010-09-08 15:06:45 -0700 | [diff] [blame] | 155 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 156 | # We chown/chmod /cache again so because mount is run as root + defaults |
| 157 | chown system cache /cache |
| 158 | chmod 0770 /cache |
Stephen Smalley | 1eee419 | 2012-01-13 08:54:34 -0500 | [diff] [blame] | 159 | # We restorecon /cache in case the cache partition has been reset. |
| 160 | restorecon /cache |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 161 | |
| 162 | # This may have been created by the recovery system with odd permissions |
| 163 | chown system cache /cache/recovery |
| 164 | chmod 0770 /cache/recovery |
Stephen Smalley | 1eee419 | 2012-01-13 08:54:34 -0500 | [diff] [blame] | 165 | # This may have been created by the recovery system with the wrong context. |
| 166 | restorecon /cache/recovery |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 167 | |
| 168 | #change permissions on vmallocinfo so we can grab it from bugreports |
| 169 | chown root log /proc/vmallocinfo |
| 170 | chmod 0440 /proc/vmallocinfo |
| 171 | |
Dima Zavin | 9481266 | 2012-09-25 14:22:02 -0700 | [diff] [blame] | 172 | chown root log /proc/slabinfo |
| 173 | chmod 0440 /proc/slabinfo |
| 174 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 175 | #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks |
| 176 | chown root system /proc/kmsg |
| 177 | chmod 0440 /proc/kmsg |
| 178 | chown root system /proc/sysrq-trigger |
| 179 | chmod 0220 /proc/sysrq-trigger |
Colin Cross | b35e36e | 2012-08-02 18:14:33 -0700 | [diff] [blame] | 180 | chown system log /proc/last_kmsg |
| 181 | chmod 0440 /proc/last_kmsg |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 182 | |
| 183 | # create the lost+found directories, so as to enforce our permissions |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 184 | mkdir /cache/lost+found 0770 root root |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 185 | |
| 186 | on post-fs-data |
Colin Cross | 31712be | 2010-04-09 12:26:06 -0700 | [diff] [blame] | 187 | # 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] | 188 | chown system system /data |
| 189 | chmod 0771 /data |
Stephen Smalley | 1eee419 | 2012-01-13 08:54:34 -0500 | [diff] [blame] | 190 | # We restorecon /data in case the userdata partition has been reset. |
| 191 | restorecon /data |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 192 | |
Nick Kralevich | b410eb1 | 2013-09-17 16:18:23 -0700 | [diff] [blame] | 193 | # Avoid predictable entropy pool. Carry over entropy from previous boot. |
| 194 | copy /data/system/entropy.dat /dev/urandom |
| 195 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 196 | # Create dump dir and collect dumps. |
| 197 | # Do this before we mount cache so eventually we can use cache for |
| 198 | # 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] | 199 | mkdir /data/dontpanic 0750 root log |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 200 | |
| 201 | # Collect apanic data, free resources and re-arm trigger |
| 202 | copy /proc/apanic_console /data/dontpanic/apanic_console |
Mike Lockwood | 25f1a5a | 2009-09-11 17:13:28 -0400 | [diff] [blame] | 203 | chown root log /data/dontpanic/apanic_console |
Mike Lockwood | 9332482 | 2009-09-08 22:55:59 -0400 | [diff] [blame] | 204 | chmod 0640 /data/dontpanic/apanic_console |
San Mehat | 020f35f | 2009-09-01 15:38:18 -0700 | [diff] [blame] | 205 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 206 | copy /proc/apanic_threads /data/dontpanic/apanic_threads |
Mike Lockwood | 25f1a5a | 2009-09-11 17:13:28 -0400 | [diff] [blame] | 207 | chown root log /data/dontpanic/apanic_threads |
Mike Lockwood | 9332482 | 2009-09-08 22:55:59 -0400 | [diff] [blame] | 208 | chmod 0640 /data/dontpanic/apanic_threads |
San Mehat | 020f35f | 2009-09-01 15:38:18 -0700 | [diff] [blame] | 209 | |
San Mehat | f26d6ce | 2009-09-01 09:11:04 -0700 | [diff] [blame] | 210 | write /proc/apanic_console 1 |
| 211 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 212 | # create basic filesystem structure |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 213 | mkdir /data/misc 01771 system misc |
Benoit Goby | 0245e15 | 2012-05-09 17:27:53 -0700 | [diff] [blame] | 214 | mkdir /data/misc/adb 02750 system shell |
Matthew Xie | 971153a | 2012-10-04 12:35:27 -0700 | [diff] [blame] | 215 | mkdir /data/misc/bluedroid 0770 bluetooth net_bt_stack |
Jaikumar Ganesh | eafdd86 | 2010-01-07 20:24:55 -0800 | [diff] [blame] | 216 | mkdir /data/misc/bluetooth 0770 system system |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 217 | mkdir /data/misc/keystore 0700 keystore keystore |
Brian Carlstrom | 0491893 | 2011-06-30 22:50:29 -0700 | [diff] [blame] | 218 | mkdir /data/misc/keychain 0771 system system |
Robert Greenwalt | 2aa33a3 | 2013-07-16 09:46:17 -0700 | [diff] [blame] | 219 | mkdir /data/misc/radio 0770 system radio |
Robert Greenwalt | d6d4780 | 2012-09-26 16:04:27 -0700 | [diff] [blame] | 220 | mkdir /data/misc/sms 0770 system radio |
Elliott Hughes | f820e85 | 2012-10-19 18:10:05 -0700 | [diff] [blame] | 221 | mkdir /data/misc/zoneinfo 0775 system system |
Nick Kralevich | 354e9ed | 2013-12-13 16:00:04 -0800 | [diff] [blame] | 222 | restorecon_recursive /data/misc/zoneinfo |
Chia-chi Yeh | 9bb4d41 | 2011-07-08 20:03:03 -0700 | [diff] [blame] | 223 | mkdir /data/misc/vpn 0770 system vpn |
Oscar Montemayor | d0aa32c | 2010-01-06 13:18:12 -0800 | [diff] [blame] | 224 | mkdir /data/misc/systemkeys 0700 system system |
Mike Lockwood | 48d116e | 2009-07-08 18:42:08 -0400 | [diff] [blame] | 225 | # give system access to wpa_supplicant.conf for backup and restore |
| 226 | mkdir /data/misc/wifi 0770 wifi wifi |
Amith Yamasani | eefef32 | 2009-07-02 12:08:13 -0700 | [diff] [blame] | 227 | chmod 0660 /data/misc/wifi/wpa_supplicant.conf |
Chia-chi Yeh | 5ebced3 | 2012-03-07 14:52:10 -0800 | [diff] [blame] | 228 | mkdir /data/local 0751 root root |
Glenn Kasten | b0f908a | 2013-02-22 14:54:45 -0800 | [diff] [blame] | 229 | mkdir /data/misc/media 0700 media media |
Stephen Smalley | 9e9f05e | 2014-01-15 13:19:31 -0500 | [diff] [blame] | 230 | restorecon_recursive /data/misc/media |
Nick Kralevich | f3ef127 | 2012-03-14 15:22:54 -0700 | [diff] [blame] | 231 | |
Stephen Smalley | deb41e5 | 2013-10-01 09:21:47 -0400 | [diff] [blame] | 232 | # Set security context of any pre-existing /data/misc/adb/adb_keys file. |
| 233 | restorecon /data/misc/adb |
| 234 | restorecon /data/misc/adb/adb_keys |
| 235 | |
Nick Kralevich | f3ef127 | 2012-03-14 15:22:54 -0700 | [diff] [blame] | 236 | # For security reasons, /data/local/tmp should always be empty. |
| 237 | # Do not place files or directories in /data/local/tmp |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 238 | mkdir /data/local/tmp 0771 shell shell |
| 239 | mkdir /data/data 0771 system system |
| 240 | mkdir /data/app-private 0771 system system |
Kenny Root | f8bbaba | 2012-04-12 15:01:52 -0700 | [diff] [blame] | 241 | mkdir /data/app-asec 0700 root root |
Kenny Root | 5054417 | 2012-09-08 22:39:25 -0700 | [diff] [blame] | 242 | mkdir /data/app-lib 0771 system system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 243 | mkdir /data/app 0771 system system |
| 244 | mkdir /data/property 0700 root root |
Mike Lockwood | 9dd2eef | 2011-12-11 20:25:16 -0800 | [diff] [blame] | 245 | mkdir /data/ssh 0750 root shell |
| 246 | mkdir /data/ssh/empty 0700 root root |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 247 | |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 248 | # create dalvik-cache, so as to enforce our permissions |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 249 | mkdir /data/dalvik-cache 0771 system system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 250 | |
MÃ¥rten Kongstad | b45280d | 2011-05-30 10:24:54 +0200 | [diff] [blame] | 251 | # create resource-cache and double-check the perms |
| 252 | mkdir /data/resource-cache 0771 system system |
| 253 | chown system system /data/resource-cache |
| 254 | chmod 0771 /data/resource-cache |
| 255 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 256 | # create the lost+found directories, so as to enforce our permissions |
Chia-chi Yeh | ea74414 | 2011-07-08 16:52:18 -0700 | [diff] [blame] | 257 | mkdir /data/lost+found 0770 root root |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 258 | |
James Dong | 09cdc0e | 2012-01-06 15:19:26 -0800 | [diff] [blame] | 259 | # create directory for DRM plug-ins - give drm the read/write access to |
| 260 | # the following directory. |
| 261 | mkdir /data/drm 0770 drm drm |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 262 | |
Jeff Tinker | 08d6430 | 2013-04-23 19:54:17 -0700 | [diff] [blame] | 263 | # create directory for MediaDrm plug-ins - give drm the read/write access to |
| 264 | # the following directory. |
| 265 | mkdir /data/mediadrm 0770 mediadrm mediadrm |
rpcraig | 2dcbb81 | 2014-01-07 22:24:22 -0500 | [diff] [blame] | 266 | restorecon_recursive /data/mediadrm |
Jeff Tinker | 08d6430 | 2013-04-23 19:54:17 -0700 | [diff] [blame] | 267 | |
Jeff Sharkey | fb4f7ac | 2013-03-14 14:27:38 -0700 | [diff] [blame] | 268 | # symlink to bugreport storage location |
| 269 | symlink /data/data/com.android.shell/files/bugreports /data/bugreports |
| 270 | |
William Roberts | bfd71b4 | 2013-01-23 14:05:04 -0800 | [diff] [blame] | 271 | # Separate location for storing security policy files on data |
William Roberts | d43bab7 | 2013-04-15 13:56:22 -0700 | [diff] [blame] | 272 | mkdir /data/security 0711 system system |
William Roberts | bfd71b4 | 2013-01-23 14:05:04 -0800 | [diff] [blame] | 273 | |
Stephen Smalley | 6552f68 | 2013-08-26 10:45:05 -0400 | [diff] [blame] | 274 | # Reload policy from /data/security if present. |
| 275 | setprop selinux.reload_policy 1 |
| 276 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 277 | # If there is no fs-post-data action in the init.<device>.rc file, you |
| 278 | # must uncomment this line, otherwise encrypted filesystems |
| 279 | # won't work. |
| 280 | # Set indication (checked by vold) that we have finished this action |
| 281 | #setprop vold.post_fs_data_done 1 |
| 282 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 283 | on boot |
| 284 | # basic network init |
| 285 | ifup lo |
| 286 | hostname localhost |
| 287 | domainname localdomain |
| 288 | |
| 289 | # set RLIMIT_NICE to allow priorities from 19 to -20 |
| 290 | setrlimit 13 40 40 |
| 291 | |
Dianne Hackborn | 06787f4 | 2011-08-07 16:30:24 -0700 | [diff] [blame] | 292 | # Memory management. Basic kernel parameters, and allow the high |
| 293 | # level system server to be able to adjust the kernel OOM driver |
Glenn Kasten | b91bd9f | 2012-04-19 16:18:37 -0700 | [diff] [blame] | 294 | # parameters to match how it is managing things. |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 295 | write /proc/sys/vm/overcommit_memory 1 |
The Android Open Source Project | e037fd7 | 2009-03-13 13:04:37 -0700 | [diff] [blame] | 296 | write /proc/sys/vm/min_free_order_shift 4 |
Dianne Hackborn | 06787f4 | 2011-08-07 16:30:24 -0700 | [diff] [blame] | 297 | chown root system /sys/module/lowmemorykiller/parameters/adj |
| 298 | chmod 0664 /sys/module/lowmemorykiller/parameters/adj |
| 299 | chown root system /sys/module/lowmemorykiller/parameters/minfree |
| 300 | chmod 0664 /sys/module/lowmemorykiller/parameters/minfree |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 301 | |
San Mehat | 831d8e1 | 2009-10-13 12:24:47 -0700 | [diff] [blame] | 302 | # Tweak background writeout |
| 303 | write /proc/sys/vm/dirty_expire_centisecs 200 |
| 304 | write /proc/sys/vm/dirty_background_ratio 5 |
| 305 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 306 | # Permissions for System Server and daemons. |
| 307 | chown radio system /sys/android_power/state |
| 308 | chown radio system /sys/android_power/request_state |
| 309 | chown radio system /sys/android_power/acquire_full_wake_lock |
| 310 | chown radio system /sys/android_power/acquire_partial_wake_lock |
| 311 | chown radio system /sys/android_power/release_wake_lock |
Arve Hjønnevåg | 70a163f | 2012-05-02 17:57:50 -0700 | [diff] [blame] | 312 | chown system system /sys/power/autosleep |
Arve Hjønnevåg | 1670f83 | 2012-03-20 20:33:09 -0700 | [diff] [blame] | 313 | chown system system /sys/power/state |
| 314 | chown system system /sys/power/wakeup_count |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 315 | chown radio system /sys/power/wake_lock |
| 316 | chown radio system /sys/power/wake_unlock |
| 317 | chmod 0660 /sys/power/state |
| 318 | chmod 0660 /sys/power/wake_lock |
| 319 | chmod 0660 /sys/power/wake_unlock |
Todd Poynor | 0653b97 | 2012-04-11 14:48:51 -0700 | [diff] [blame] | 320 | |
| 321 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
| 322 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
Todd Poynor | 2b5b3bb | 2012-12-20 18:52:03 -0800 | [diff] [blame] | 323 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 324 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
Todd Poynor | 0653b97 | 2012-04-11 14:48:51 -0700 | [diff] [blame] | 325 | chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
| 326 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
| 327 | chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
| 328 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
Todd Poynor | 2b5b3bb | 2012-12-20 18:52:03 -0800 | [diff] [blame] | 329 | chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 330 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads |
Todd Poynor | 0653b97 | 2012-04-11 14:48:51 -0700 | [diff] [blame] | 331 | chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
| 332 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
Todd Poynor | f35c203 | 2012-04-19 13:17:24 -0700 | [diff] [blame] | 333 | chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
| 334 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
Todd Poynor | 8d3ea1d | 2012-04-24 15:37:13 -0700 | [diff] [blame] | 335 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boost |
| 336 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost |
Todd Poynor | 4ff10e6 | 2012-05-03 15:20:48 -0700 | [diff] [blame] | 337 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
Todd Poynor | 33045a6 | 2012-04-27 20:21:18 -0700 | [diff] [blame] | 338 | chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost |
| 339 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost |
Todd Poynor | 4f247d7 | 2012-12-19 17:43:06 -0800 | [diff] [blame] | 340 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
| 341 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
Todd Poynor | 6b5de1c | 2013-03-25 13:17:13 -0700 | [diff] [blame] | 342 | chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
| 343 | chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
Todd Poynor | 0653b97 | 2012-04-11 14:48:51 -0700 | [diff] [blame] | 344 | |
| 345 | # Assume SMP uses shared cpufreq policy for all CPUs |
| 346 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
| 347 | chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
| 348 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 349 | chown system system /sys/class/timed_output/vibrator/enable |
| 350 | chown system system /sys/class/leds/keyboard-backlight/brightness |
| 351 | chown system system /sys/class/leds/lcd-backlight/brightness |
| 352 | chown system system /sys/class/leds/button-backlight/brightness |
The Android Open Source Project | f614d64 | 2009-03-18 17:39:49 -0700 | [diff] [blame] | 353 | chown system system /sys/class/leds/jogball-backlight/brightness |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 354 | chown system system /sys/class/leds/red/brightness |
| 355 | chown system system /sys/class/leds/green/brightness |
| 356 | chown system system /sys/class/leds/blue/brightness |
| 357 | chown system system /sys/class/leds/red/device/grpfreq |
| 358 | chown system system /sys/class/leds/red/device/grppwm |
| 359 | chown system system /sys/class/leds/red/device/blink |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 360 | chown system system /sys/class/timed_output/vibrator/enable |
| 361 | chown system system /sys/module/sco/parameters/disable_esco |
| 362 | chown system system /sys/kernel/ipv4/tcp_wmem_min |
| 363 | chown system system /sys/kernel/ipv4/tcp_wmem_def |
| 364 | chown system system /sys/kernel/ipv4/tcp_wmem_max |
| 365 | chown system system /sys/kernel/ipv4/tcp_rmem_min |
| 366 | chown system system /sys/kernel/ipv4/tcp_rmem_def |
| 367 | chown system system /sys/kernel/ipv4/tcp_rmem_max |
| 368 | chown root radio /proc/cmdline |
| 369 | |
| 370 | # Define TCP buffer sizes for various networks |
| 371 | # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, |
Jianzheng Zhou | 52ea510 | 2013-11-15 13:44:00 +0800 | [diff] [blame] | 372 | setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208 |
| 373 | setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576 |
| 374 | setprop net.tcp.buffersize.ethernet 524288,1048576,3145728,524288,1048576,2097152 |
| 375 | setprop net.tcp.buffersize.lte 524288,1048576,2097152,262144,524288,1048576 |
| 376 | setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208 |
| 377 | setprop net.tcp.buffersize.hspa 4094,87380,262144,4096,16384,262144 |
| 378 | setprop net.tcp.buffersize.hsupa 4094,87380,262144,4096,16384,262144 |
| 379 | setprop net.tcp.buffersize.hsdpa 4094,87380,262144,4096,16384,262144 |
| 380 | setprop net.tcp.buffersize.hspap 4094,87380,1220608,4096,16384,1220608 |
| 381 | setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040 |
| 382 | setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680 |
| 383 | setprop net.tcp.buffersize.evdo 4094,87380,262144,4096,16384,262144 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 384 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 385 | class_start core |
| 386 | class_start main |
| 387 | |
| 388 | on nonencrypted |
| 389 | class_start late_start |
| 390 | |
Dima Zavin | ca47cef | 2011-08-24 15:28:23 -0700 | [diff] [blame] | 391 | on charger |
| 392 | class_start charger |
| 393 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 394 | on property:vold.decrypt=trigger_reset_main |
| 395 | class_reset main |
| 396 | |
Ken Sumrall | c5c5103 | 2011-03-08 17:01:29 -0800 | [diff] [blame] | 397 | on property:vold.decrypt=trigger_load_persist_props |
| 398 | load_persist_props |
| 399 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 400 | on property:vold.decrypt=trigger_post_fs_data |
| 401 | trigger post-fs-data |
| 402 | |
Ken Sumrall | e434915 | 2011-01-17 14:26:34 -0800 | [diff] [blame] | 403 | on property:vold.decrypt=trigger_restart_min_framework |
| 404 | class_start main |
| 405 | |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 406 | on property:vold.decrypt=trigger_restart_framework |
| 407 | class_start main |
| 408 | class_start late_start |
| 409 | |
| 410 | on property:vold.decrypt=trigger_shutdown_framework |
| 411 | class_reset late_start |
| 412 | class_reset main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 413 | |
Nick Kralevich | ca8e66a | 2013-04-18 12:20:02 -0700 | [diff] [blame] | 414 | on property:sys.powerctl=* |
| 415 | powerctl ${sys.powerctl} |
| 416 | |
Colin Cross | 57fdb5c | 2013-07-25 10:34:30 -0700 | [diff] [blame] | 417 | # system server cannot write to /proc/sys files, so proxy it through init |
| 418 | on property:sys.sysctl.extra_free_kbytes=* |
| 419 | write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes} |
| 420 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 421 | ## Daemon processes to be run by init. |
| 422 | ## |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 423 | service ueventd /sbin/ueventd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 424 | class core |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 425 | critical |
Stephen Smalley | 1eee419 | 2012-01-13 08:54:34 -0500 | [diff] [blame] | 426 | seclabel u:r:ueventd:s0 |
Colin Cross | f83d0b9 | 2010-04-21 12:04:20 -0700 | [diff] [blame] | 427 | |
Todd Poynor | 13f4c9f | 2013-06-19 15:09:35 -0700 | [diff] [blame] | 428 | service healthd /sbin/healthd |
| 429 | class core |
| 430 | critical |
| 431 | seclabel u:r:healthd:s0 |
| 432 | |
| 433 | service healthd-charger /sbin/healthd -n |
| 434 | class charger |
| 435 | critical |
| 436 | seclabel u:r:healthd:s0 |
| 437 | |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 438 | service console /system/bin/sh |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 439 | class core |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 440 | console |
| 441 | disabled |
| 442 | user shell |
| 443 | group log |
Stephen Smalley | 610653f | 2013-12-23 14:11:02 -0500 | [diff] [blame] | 444 | seclabel u:r:shell:s0 |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 445 | |
Mike Lockwood | d49b4ef | 2010-11-19 09:12:27 -0500 | [diff] [blame] | 446 | on property:ro.debuggable=1 |
Brian Swetland | b4d6539 | 2010-10-27 15:40:23 -0700 | [diff] [blame] | 447 | start console |
| 448 | |
Mike Lockwood | 352dfdf | 2011-06-08 17:40:00 -0700 | [diff] [blame] | 449 | # adbd is controlled via property triggers in init.<platform>.usb.rc |
Nick Kralevich | d49aa25 | 2014-01-18 09:25:04 -0800 | [diff] [blame] | 450 | service adbd /sbin/adbd --root_seclabel=u:r:su:s0 |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 451 | class core |
Benoit Goby | 0574d6b | 2012-04-24 15:07:12 -0700 | [diff] [blame] | 452 | socket adbd stream 660 system system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 453 | disabled |
Stephen Smalley | 1eee419 | 2012-01-13 08:54:34 -0500 | [diff] [blame] | 454 | seclabel u:r:adbd:s0 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 455 | |
| 456 | # adbd on at boot in emulator |
| 457 | on property:ro.kernel.qemu=1 |
| 458 | start adbd |
| 459 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 460 | service servicemanager /system/bin/servicemanager |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 461 | class core |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 462 | user system |
Nick Kralevich | 333f24b | 2010-12-10 14:10:16 -0800 | [diff] [blame] | 463 | group system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 464 | critical |
Todd Poynor | 13f4c9f | 2013-06-19 15:09:35 -0700 | [diff] [blame] | 465 | onrestart restart healthd |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 466 | onrestart restart zygote |
| 467 | onrestart restart media |
Mathias Agopian | 04a8759 | 2011-10-31 14:27:36 -0700 | [diff] [blame] | 468 | onrestart restart surfaceflinger |
| 469 | onrestart restart drm |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 470 | |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 471 | service vold /system/bin/vold |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 472 | class core |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 473 | socket vold stream 0660 root mount |
San Mehat | f0cb74e | 2010-02-26 10:01:14 -0800 | [diff] [blame] | 474 | ioprio be 2 |
The Android Open Source Project | e4749f3 | 2009-03-09 11:52:15 -0700 | [diff] [blame] | 475 | |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 476 | service netd /system/bin/netd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 477 | class main |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 478 | socket netd stream 0660 root system |
Brad Fitzpatrick | 8c5669f | 2010-10-27 10:23:16 -0700 | [diff] [blame] | 479 | socket dnsproxyd stream 0660 root inet |
Robert Greenwalt | 1d91fcf | 2012-03-27 16:59:27 -0700 | [diff] [blame] | 480 | socket mdns stream 0660 root system |
San Mehat | 192277c | 2010-01-15 07:48:35 -0800 | [diff] [blame] | 481 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 482 | service debuggerd /system/bin/debuggerd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 483 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 484 | |
| 485 | service ril-daemon /system/bin/rild |
vidya rao | 04cf629 | 2011-06-24 12:15:20 -0700 | [diff] [blame] | 486 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 487 | socket rild stream 660 root radio |
| 488 | socket rild-debug stream 660 radio system |
| 489 | user root |
Jeff Sharkey | 61f1359 | 2012-08-20 14:31:47 -0700 | [diff] [blame] | 490 | group radio cache inet misc audio log |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 491 | |
Mathias Agopian | a40481b | 2011-03-03 18:48:30 -0800 | [diff] [blame] | 492 | service surfaceflinger /system/bin/surfaceflinger |
| 493 | class main |
| 494 | user system |
Dima Zavin | ece565c | 2012-10-04 17:02:26 -0700 | [diff] [blame] | 495 | group graphics drmrpc |
Mathias Agopian | a40481b | 2011-03-03 18:48:30 -0800 | [diff] [blame] | 496 | onrestart restart zygote |
| 497 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 498 | 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] | 499 | class main |
Nick Kralevich | e7fd911 | 2012-01-27 13:06:53 -0800 | [diff] [blame] | 500 | socket zygote stream 660 root system |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 501 | onrestart write /sys/android_power/request_state wake |
| 502 | onrestart write /sys/power/state on |
Dan Bornstein | 1dec503 | 2009-10-09 14:24:51 -0700 | [diff] [blame] | 503 | onrestart restart media |
Brad Fitzpatrick | 6490257 | 2010-09-21 15:49:06 -0700 | [diff] [blame] | 504 | onrestart restart netd |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 505 | |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 506 | service drm /system/bin/drmserver |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 507 | class main |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 508 | user drm |
Jeff Sharkey | 61f1359 | 2012-08-20 14:31:47 -0700 | [diff] [blame] | 509 | group drm system inet drmrpc |
aimitakeshi | e572d59 | 2010-07-27 08:38:35 +0900 | [diff] [blame] | 510 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 511 | service media /system/bin/mediaserver |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 512 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 513 | user media |
Jeff Tinker | 08d6430 | 2013-04-23 19:54:17 -0700 | [diff] [blame] | 514 | group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm |
San Mehat | f0cb74e | 2010-02-26 10:01:14 -0800 | [diff] [blame] | 515 | ioprio rt 4 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 516 | |
Mathias Agopian | 8b2cf9f | 2009-05-20 18:09:51 -0700 | [diff] [blame] | 517 | service bootanim /system/bin/bootanimation |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 518 | class main |
Mathias Agopian | 8b2cf9f | 2009-05-20 18:09:51 -0700 | [diff] [blame] | 519 | user graphics |
| 520 | group graphics |
| 521 | disabled |
| 522 | oneshot |
| 523 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 524 | service installd /system/bin/installd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 525 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 526 | socket installd stream 600 system system |
| 527 | |
Doug Zongker | d52f54c | 2009-07-23 15:18:34 -0700 | [diff] [blame] | 528 | service flash_recovery /system/etc/install-recovery.sh |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 529 | class main |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 530 | oneshot |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 531 | |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 532 | service racoon /system/bin/racoon |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 533 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 534 | socket racoon stream 600 system system |
Chia-chi Yeh | 9bb4d41 | 2011-07-08 20:03:03 -0700 | [diff] [blame] | 535 | # 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] | 536 | group vpn net_admin inet |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 537 | disabled |
| 538 | oneshot |
| 539 | |
| 540 | service mtpd /system/bin/mtpd |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 541 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 542 | socket mtpd stream 600 system system |
Chia-chi Yeh | 51afbf5 | 2009-07-01 07:06:47 +0800 | [diff] [blame] | 543 | user vpn |
Chia-chi Yeh | a246871 | 2011-08-08 10:11:40 -0700 | [diff] [blame] | 544 | group vpn net_admin inet net_raw |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 545 | disabled |
| 546 | oneshot |
| 547 | |
Chia-chi Yeh | 9b4f1ff | 2009-09-18 10:35:26 +0800 | [diff] [blame] | 548 | service keystore /system/bin/keystore /data/misc/keystore |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 549 | class main |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 550 | user keystore |
Kenny Root | ad5b9c7 | 2012-02-23 16:31:10 -0800 | [diff] [blame] | 551 | group keystore drmrpc |
Chung-yih Wang | 1f75d70 | 2009-06-01 19:04:05 +0800 | [diff] [blame] | 552 | |
Mike Lockwood | abe3a9c | 2009-09-02 18:09:26 -0400 | [diff] [blame] | 553 | service dumpstate /system/bin/dumpstate -s |
Ken Sumrall | 752923c | 2010-12-03 16:33:31 -0800 | [diff] [blame] | 554 | class main |
Mike Lockwood | abe3a9c | 2009-09-02 18:09:26 -0400 | [diff] [blame] | 555 | socket dumpstate stream 0660 shell log |
| 556 | disabled |
| 557 | oneshot |
Mike Lockwood | 9dd2eef | 2011-12-11 20:25:16 -0800 | [diff] [blame] | 558 | |
| 559 | service sshd /system/bin/start-ssh |
| 560 | class main |
Mike Lockwood | 19155b5 | 2012-03-21 11:58:05 -0700 | [diff] [blame] | 561 | disabled |
Robert Greenwalt | 1d91fcf | 2012-03-27 16:59:27 -0700 | [diff] [blame] | 562 | |
| 563 | service mdnsd /system/bin/mdnsd |
| 564 | class main |
| 565 | user mdnsr |
| 566 | group inet net_raw |
| 567 | socket mdnsd stream 0660 mdnsr inet |
| 568 | disabled |
| 569 | oneshot |