blob: 3ae877f13764ce2d3a804df23d64ac303a822f6b [file] [log] [blame]
Benoit Goby25cc3052012-03-29 19:35:36 -07001import init.manta.usb.rc
Colin Cross29380e62012-03-06 17:41:22 -08002
Arve Hjønnevåg481ffe62012-06-13 22:01:38 -07003on init
4 start watchdogd
5
Jeff Sharkey4d8468d2012-08-21 10:38:32 -07006 # See storage config details at http://source.android.com/tech/storage/
Jeff Sharkey56ec91d2012-09-11 23:20:56 -07007 mkdir /mnt/shell/emulated 0700 shell shell
Jeff Sharkeyb9928aa2012-09-30 17:20:20 -07008 mkdir /storage/emulated 0555 root root
Benoit Gobye5d653c2012-08-16 20:40:35 -07009
Jeff Sharkey4e67a172012-09-30 12:49:03 -070010 export EXTERNAL_STORAGE /storage/emulated/legacy
Jeff Sharkey56ec91d2012-09-11 23:20:56 -070011 export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
12 export EMULATED_STORAGE_TARGET /storage/emulated
Jeff Sharkeydc3015d2012-08-20 13:24:32 -070013
Jeff Sharkey4d8468d2012-08-21 10:38:32 -070014 # Support legacy paths
Jeff Sharkey4e67a172012-09-30 12:49:03 -070015 symlink /storage/emulated/legacy /sdcard
16 symlink /storage/emulated/legacy /mnt/sdcard
17 symlink /storage/emulated/legacy /storage/sdcard0
18 symlink /mnt/shell/emulated/0 /storage/emulated/legacy
Jeff Sharkey233e5882012-08-16 13:52:00 -070019
Rom Lemarchand8c170062013-09-04 15:33:20 -070020# KSM
Rom Lemarchand55dc1102013-05-31 10:15:26 -070021 write /sys/kernel/mm/ksm/pages_to_scan 100
22 write /sys/kernel/mm/ksm/sleep_millisecs 500
Rom Lemarchand8c170062013-09-04 15:33:20 -070023# write /sys/kernel/mm/ksm/run 1
Rom Lemarchand55dc1102013-05-31 10:15:26 -070024
Colin Cross29380e62012-03-06 17:41:22 -080025on post-fs-data
Jeff Sharkey33793112012-04-09 17:34:07 -070026 mkdir /data/media 0770 media_rw media_rw
Stephen Smalleybc6803f2014-01-16 09:56:16 -050027 restorecon_recursive /data/media
Jeff Sharkey233e5882012-08-16 13:52:00 -070028
Colin Cross29380e62012-03-06 17:41:22 -080029 setprop vold.post_fs_data_done 1
30
Matthew Xiee90682b2012-07-27 19:53:47 -070031# permissions for bluetooth.
Chunho Park362e6542012-09-18 14:42:27 +090032 setprop ro.bt.bdaddr_path "/factory/bluetooth/bt_addr"
Matthew Xie7f32e6f2012-10-04 21:51:09 -070033 chown bluetooth net_bt_stack ro.bt.bdaddr_path
34 chown bluetooth net_bt_stack /dev/ttySAC0
35 chmod 0660 /dev/ttySAC0
Matthew Xiee90682b2012-07-27 19:53:47 -070036 chmod 0660 /sys/class/rfkill/rfkill0/state
Matthew Xie7f32e6f2012-10-04 21:51:09 -070037 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
38 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
Matthew Xiee90682b2012-07-27 19:53:47 -070039
Colin Cross29380e62012-03-06 17:41:22 -080040on boot
Colin Cross3a15c642012-10-19 14:32:23 -070041 # override init.rc to keep plenty of large order chunks around
42 # to improve allocation times
Colin Cross3a15c642012-10-19 14:32:23 -070043 write /proc/sys/vm/min_free_order_shift 1
44
Colin Cross29380e62012-03-06 17:41:22 -080045 mount debugfs /sys/kernel/debug /sys/kernel/debug
46 setprop ro.radio.noril yes
47
48 # Set up kernel tracing, but disable it by default
49 chmod 0222 /sys/kernel/debug/tracing/trace_marker
50 write /sys/kernel/debug/tracing/tracing_on 0
51
Todd Poynor37b2e3b2012-07-26 12:32:09 -070052 chmod 0444 /sys/kernel/debug/smb347-regs
53
Seho Kim836d6ee2012-09-19 14:46:22 -070054# Set Mali power policy as Coarse demand
55 write /sys/devices/platform/mali.0/power_policy coarse_demand
56
Colin Cross29380e62012-03-06 17:41:22 -080057on fs
Dima Zavin0dbbcf32012-08-20 23:37:22 -070058 mkdir /factory 0775 radio radio
59
Ken Sumrallfa170c72012-04-12 14:40:39 -070060 mount_all /fstab.manta
rpcraige3a69812012-12-11 13:14:14 -050061 mount ext4 /dev/block/platform/dw_mmc.0/by-name/efs /factory rw remount
Stephen Smalleybc6803f2014-01-16 09:56:16 -050062 restorecon_recursive /factory
rpcraige3a69812012-12-11 13:14:14 -050063 mount ext4 /dev/block/platform/dw_mmc.0/by-name/efs /factory ro remount
Colin Cross29380e62012-03-06 17:41:22 -080064 setprop ro.crypto.fuse_sdcard true
65
66# Permissions for backlight
Colin Cross37a83b92012-05-31 13:31:21 -070067 chmod 0660 /sys/class/backlight/pwm-backlight.0/brightness
Colin Cross29380e62012-03-06 17:41:22 -080068 chown system system /sys/class/backlight/pwm-backlight.0/brightness
69
Bono Kooc3e28db2012-06-21 13:41:36 +090070# create data/gps for GPS daemon
71 chown root system /sys/class/gps/bcm475x/GPS_PWR_EN/value
72 chmod 0664 /sys/class/gps/bcm475x/GPS_PWR_EN/value
73 chown root system /sys/class/gps/bcm475x/GPS_nRST/value
74 chmod 0664 /sys/class/gps/bcm475x/GPS_nRST/value
75 mkdir /data/gps 771 system system
76 chown system system /data/gps
77
Martijn Coenen779f93b2012-07-30 13:18:09 -070078# NFC: create data/nfc for nv storage
79 mkdir /data/nfc 770 nfc nfc
80 mkdir /data/nfc/param 770 nfc nfc
Stephen Smalleybc6803f2014-01-16 09:56:16 -050081 restorecon_recursive /data/nfc
Martijn Coenen779f93b2012-07-30 13:18:09 -070082
Eric Laurent688880c2012-09-07 16:46:00 -070083# audio: permissions for voice processing
Jean-Michel Trivie04f7c92012-09-30 16:01:41 -070084 # global switch for voice processing effects
Eric Laurent688880c2012-09-07 16:46:00 -070085 chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/voice_processing
86 chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/voice_processing
Jean-Michel Trivie04f7c92012-09-30 16:01:41 -070087 # voice processing chip sleep
Jean-Michel Trivi0427d432012-10-04 15:42:04 -070088 chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/sleep
89 chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/sleep
Jean-Michel Trivie04f7c92012-09-30 16:01:41 -070090 # voice processing usecase preset
91 chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/preset
92 chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/preset
93 # voice processing noise suppression level
94 chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/tx_ns_level
95 chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/tx_ns_level
96 # voice processing AGC enable (TX)
97 chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/tx_agc_enable
98 chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/tx_agc_enable
99 # voice processing AEC enable
100 chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/aec_enable
101 chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/aec_enable
Eric Laurent688880c2012-09-07 16:46:00 -0700102
Jeff Sharkey233e5882012-08-16 13:52:00 -0700103# virtual sdcard daemon running as media_rw (1023)
Jeff Sharkey74810c92013-09-04 14:41:39 -0700104service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
Colin Cross29380e62012-03-06 17:41:22 -0800105 class late_start
Dmitry Shmidte87ec972012-03-16 09:43:07 -0700106
Dmitry Shmidt0295d702012-07-10 13:17:12 -0700107service p2p_supplicant /system/bin/wpa_supplicant \
Dmitry Shmidtee69be62012-08-08 13:51:38 -0700108 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
Dmitry Shmidtf251bea2014-02-19 14:55:00 -0800109 -I/system/etc/wifi/wpa_supplicant_overlay.conf -N \
110 -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
Dmitry Shmidt5f3ccad2013-08-28 10:53:50 -0700111 -I/system/etc/wifi/p2p_supplicant_overlay.conf \
Dmitry Shmidt0f7f3c32013-11-07 18:22:56 -0800112 -puse_p2p_group_interface=1 \
Dmitry Shmidtc37765c2013-05-29 10:37:56 -0700113 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
Dmitry Shmidt0295d702012-07-10 13:17:12 -0700114 # we will start as root and wpa_supplicant will switch to user wifi
115 # after setting up the capabilities required for WEXT
116 # user wifi
117 # group wifi inet keystore
118 class main
119 socket wpa_wlan0 dgram 660 wifi wifi
120 disabled
121 oneshot
122
Dmitry Shmidte87ec972012-03-16 09:43:07 -0700123service wpa_supplicant /system/bin/wpa_supplicant \
Dmitry Shmidt6ff94552013-04-25 19:10:42 -0700124 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
125 -I/system/etc/wifi/wpa_supplicant_overlay.conf \
Dmitry Shmidtc37765c2013-05-29 10:37:56 -0700126 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
Dmitry Shmidte87ec972012-03-16 09:43:07 -0700127 # we will start as root and wpa_supplicant will switch to user wifi
128 # after setting up the capabilities required for WEXT
129 # user wifi
130 # group wifi inet keystore
131 class main
132 socket wpa_wlan0 dgram 660 wifi wifi
133 disabled
134 oneshot
135
Dmitry Shmidtc2c962a2012-09-20 11:12:34 -0700136service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
Dmitry Shmidte87ec972012-03-16 09:43:07 -0700137 class main
138 disabled
139 oneshot
140
Dmitry Shmidt0295d702012-07-10 13:17:12 -0700141service dhcpcd_p2p /system/bin/dhcpcd -aABKL
142 class main
143 disabled
144 oneshot
145
Dmitry Shmidtc2c962a2012-09-20 11:12:34 -0700146service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL
Dmitry Shmidt0295d702012-07-10 13:17:12 -0700147 class main
148 disabled
149 oneshot
150
Robert Greenwalt80ad7a22012-12-05 12:14:47 -0800151service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
152 class main
153 disabled
154 oneshot
155
Dmitry Shmidte87ec972012-03-16 09:43:07 -0700156service iprenew_wlan0 /system/bin/dhcpcd -n
157 class main
158 disabled
159 oneshot
Colin Cross989b65a2012-03-18 16:03:42 -0700160
Dmitry Shmidt0295d702012-07-10 13:17:12 -0700161service iprenew_p2p /system/bin/dhcpcd -n
162 class main
163 disabled
164 oneshot
165
Robert Greenwalt80ad7a22012-12-05 12:14:47 -0800166service iprenew_eth0 /system/bin/dhcpcd -n
167 class main
168 disabled
169 oneshot
170
171service iprenew_bt-pan /system/bin/dhcpcd -n
172 class main
173 disabled
174 oneshot
175
Jeong-Seok Yang4801b7f2012-04-30 14:25:27 +0900176service battery_charger /charger
177 class charger
Todd Poynor0beac412013-09-11 16:13:58 -0700178 critical
179 seclabel u:r:healthd:s0
Jeong-Seok Yang4801b7f2012-04-30 14:25:27 +0900180
Arve Hjønnevåg481ffe62012-06-13 22:01:38 -0700181# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
182service watchdogd /sbin/watchdogd 10 20
183 class core
rpcraige3a69812012-12-11 13:14:14 -0500184 seclabel u:r:watchdogd:s0
Arve Hjønnevåg481ffe62012-06-13 22:01:38 -0700185
Bono Kooc3e28db2012-06-21 13:41:36 +0900186service gpsd /system/vendor/bin/gpsd -c /system/vendor/etc/gps.xml
187 class main
188 socket gps seqpacket 0660 gps system
189 user gps
Jeff Sharkeyd20a7a62012-08-20 14:29:13 -0700190 group system inet
Bono Kooc3e28db2012-06-21 13:41:36 +0900191
DongJin Parke2fd4f32012-08-03 15:55:39 +0900192# MobiCore startup
Dima Zavinf9883d72012-08-20 23:37:57 -0700193service mobicore /system/bin/mcDriverDaemon -r /system/vendor/secapp/020a0000000000000000000000000000.drbin
194 setenv MC_REGISTRY_PATH /system/vendor/secapp
DongJin Parke2fd4f32012-08-03 15:55:39 +0900195 user drmrpc
196 group drmrpc
197 class main
198
Colin Cross989b65a2012-03-18 16:03:42 -0700199# on userdebug and eng builds, enable kgdb on the serial console
200on property:ro.debuggable=1
201 write /sys/module/kgdboc/parameters/kgdboc ttyFIQ2
202 write /sys/module/fiq_debugger/parameters/kgdb_enable 1
Jason Chen73da4592012-06-08 08:50:25 -0700203
204# bugreport is triggered by holding down volume down, volume up and power
Jeff Sharkey313e6702013-03-13 17:10:18 -0700205service bugreport /system/bin/dumpstate -d -p -B \
206 -o /data/data/com.android.shell/files/bugreports/bugreport
Jason Chen73da4592012-06-08 08:50:25 -0700207 class main
208 disabled
209 oneshot
210 keycodes 114 115 116