blob: da2101a7e5d0729b512a14f2470f9d9e8f8659cd [file] [log] [blame]
Colin Crossa9e55ed2013-10-07 14:15:18 -07001import init.flounder.usb.rc
Andres Morales2ceb6902014-10-15 15:26:56 -07002import init.flounder_svelte.rc
Colin Crossa9e55ed2013-10-07 14:15:18 -07003
4on init
Colin Cross455af6d2014-04-22 14:33:04 -07005 start watchdogd
6
Colin Crossa9e55ed2013-10-07 14:15:18 -07007 # See storage config details at http://source.android.com/tech/storage/
8 mkdir /mnt/shell/emulated 0700 shell shell
9 mkdir /storage/emulated 0555 root root
10
11 export EXTERNAL_STORAGE /storage/emulated/legacy
12 export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
13 export EMULATED_STORAGE_TARGET /storage/emulated
14
15 # Support legacy paths
16 symlink /storage/emulated/legacy /sdcard
17 symlink /storage/emulated/legacy /mnt/sdcard
18 symlink /storage/emulated/legacy /storage/sdcard0
19 symlink /mnt/shell/emulated/0 /storage/emulated/legacy
20
Greg Hackmann88235832014-08-08 13:17:45 -070021on post-fs
weizhung_ding15e890a2014-08-19 17:41:15 +080022 write /sys/power/gpu_power_on 1
Greg Hackmann88235832014-08-08 13:17:45 -070023 write /sys/module/input_cfboost/parameters/gpu_wakeup 1
Daniel Rosenberg85a33942014-09-12 19:58:51 +000024 # Turn on swap
25 swapon_all /fstab.flounder
26
27 # Swap in only 1 page at a time
28 write /proc/sys/vm/page-cluster 0
Greg Hackmann88235832014-08-08 13:17:45 -070029
Colin Crossa9e55ed2013-10-07 14:15:18 -070030on post-fs-data
JP Abgralld03c76f2014-10-10 14:52:05 -070031 # Now that are booted all the way and out of mount panics, ensure that we panic on later errors.
32 # This is a hack to work around the fact that we can't recover from all errors that would lead to a panic
33 # during the initial mount (http://b/17382778), yet we need to panic on emmc errors (http://b/17640053)
34 # For a remount only the flags and the target mount point are relevant.
35 mount dummy dummy /data remount nosuid nodev noatime rw seclabel,background_gc=on,user_xattr,acl,errors=panic
36
Nick Kralevichee8e2792014-02-25 15:59:23 -080037 mkdir /data/media 0770 media_rw media_rw
snchen7bcf7852014-04-23 15:31:13 +080038 mkdir /data/nvcam 0700 media camera
Martijn Coenence789142014-02-25 10:50:01 -080039
40 # NFC: create data/nfc for nv storage
41 mkdir /data/nfc 0770 nfc nfc
42 mkdir /data/nfc/param 0770 nfc nfc
Nick Kralevichee8e2792014-02-25 15:59:23 -080043
Arve Hjønnevåg36dff432014-08-28 15:16:57 -070044 # secure os storage
45 mkdir /data/ss 0700 system system
46
JP Abgrall0921d062014-05-05 13:43:17 -070047 # for GPS files
48 mkdir /data/gps 0770 gps system
49
tim.tm_lin66eb40d2014-06-11 16:25:38 +080050 # modem init
51 mkdir /data/qcks 0770 system system
52 mkdir /data/efs 0771 system system
tim.tm_lin3dcf3082014-07-01 17:50:41 +080053 mkdir /data/qcks/mdm 0770 system system
tim.tm_lin66eb40d2014-06-11 16:25:38 +080054
Colin Crossa9e55ed2013-10-07 14:15:18 -070055 setprop vold.post_fs_data_done 1
56
57on boot
Thomas.TT_lina6055452013-11-01 17:18:18 +080058 # bluetooth
59 # change back to bluetooth from system
60 chown bluetooth net_bt_stack /data/misc/bluetooth
61
62 # power down interface
63 write /sys/class/rfkill/rfkill0/state 0
64
Alex Rayd85a6802013-11-06 14:35:51 -080065 mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
Colin Crossa9e55ed2013-10-07 14:15:18 -070066
67 # Set up kernel tracing, but disable it by default
68 chmod 0222 /sys/kernel/debug/tracing/trace_marker
69 write /sys/kernel/debug/tracing/tracing_on 0
70
Colin Cross11a18c22014-02-19 17:49:10 -080071 write /sys/module/tegra3_emc/parameters/emc_enable 0
72 #write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000
Roger Hsiehf2a49662014-02-20 19:03:07 +080073 #write /sys/module/cpu_tegra/parameters/cpu_user_cap 700000
74 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
75 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
76 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 510000
77 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 510000
Roger Hsiehf2a49662014-02-20 19:03:07 +080078 #write /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed 700000
79 #write /sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed 700000
Colin Cross11a18c22014-02-19 17:49:10 -080080 #write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2
81 #write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80
82 write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable 0
Dan Willemsen7a6c5be2013-10-10 15:23:22 -070083
Ruchi Kandoida9413a2014-08-05 17:19:24 -070084 restorecon_recursive /sys/devices/system/cpu/cpufreq/interactive
85 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
86 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
87 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
88 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
89 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
90 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
91 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
92 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
93 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
94 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
95 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
96 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
97 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
98 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
99 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
100 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
101 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
102 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
103 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
104 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
105 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
106 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
107 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
108
Colin Crosse35e4462014-05-23 14:38:33 -0700109 # Enable CC4
110 write /sys/devices/system/cpu/cpu0/cpuidle/state1/disabled 0
111 write /sys/devices/system/cpu/cpu1/cpuidle/state1/disabled 0
112
Colin Cross2b58cd92014-07-02 12:56:24 -0700113 # b/13568411: make lazy vfree flush thresholds match flush_tlb_range
114 write /proc/sys/vm/lazy_vfree_tlb_flush_all_threshold 524288
115
Todd Poynorbd0b1b52014-01-06 16:17:48 -0800116 chmod 0444 /sys/kernel/debug/bq2419x-regs
117
mark_tzengb06eb942014-05-09 14:30:08 +0800118 write /proc/sys/net/core/rmem_max 1048576
119 write /proc/sys/net/core/wmem_max 1048576
120
Colin Crossa9e55ed2013-10-07 14:15:18 -0700121on fs
122 mount_all /fstab.flounder
123 setprop ro.crypto.fuse_sdcard true
124
125# virtual sdcard daemon running as media_rw (1023)
126service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
127 class late_start
128
129service battery_charger /charger
130 class charger
Nick Kralevich56176f82014-01-27 17:00:49 -0800131 seclabel u:r:healthd:s0
Colin Crossa9e55ed2013-10-07 14:15:18 -0700132
133# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
134service watchdogd /sbin/watchdogd 10 20
135 class core
Colin Crossdfae1632013-10-10 16:03:40 -0700136 disabled
Colin Crossa9e55ed2013-10-07 14:15:18 -0700137 seclabel u:r:watchdogd:s0
138
139# on userdebug and eng builds, enable kgdb on the serial console
140on property:ro.debuggable=1
Colin Crossf6f0fe72013-11-21 14:28:56 -0800141 write /sys/module/kgdboc/parameters/kgdboc ttyFIQ0
Colin Crossa9e55ed2013-10-07 14:15:18 -0700142 write /sys/module/fiq_debugger/parameters/kgdb_enable 1
143
edwin_tungac7b5c12014-01-24 19:46:58 +0800144# for loading correct gps hal share libraries
145on property:ro.boot.baseband=N/A
146 setprop ro.hardware.gps bcm47521
JP Abgrall0921d062014-05-05 13:43:17 -0700147 enable gpsd
edwin_tungac7b5c12014-01-24 19:46:58 +0800148
Dmitry Shmidt4690f5c2014-06-12 14:31:01 -0700149on property:ro.boot.baseband=US
150 write /sys/module/bcmdhd/parameters/nvram_path /system/etc/wifi/bcmdhd_lte.cal
151
152on property:ro.boot.baseband=ROW
153 write /sys/module/bcmdhd/parameters/nvram_path /system/etc/wifi/bcmdhd_lte.cal
154
edwin_tungac7b5c12014-01-24 19:46:58 +0800155on property:ro.baseband=unknown
156 setprop ro.hardware.gps bcm47521
JP Abgrall0921d062014-05-05 13:43:17 -0700157 enable gpsd
edwin_tungac7b5c12014-01-24 19:46:58 +0800158
tim.tm_line5976c12014-05-16 14:41:26 +0800159# for telephony function
160on property:ro.boot.baseband=N/A
161 setprop ro.radio.noril true
162 stop ril-daemon
163
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800164on property:ro.hw.ks.ready=1
165 start ril-daemon
166
167on property:ro.boot.baseband=ROW
tim.tm_line5976c12014-05-16 14:41:26 +0800168 stop ril-daemon
tim.tm_linbefefef2014-10-24 17:46:23 +0800169 setprop persist.radio.apm_sim_not_pwdn 1
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800170 enable kickstart
tim.tm_line5976c12014-05-16 14:41:26 +0800171 mkdir /dev/socket/qmux_radio 0770 radio radio
172 chmod 2770 /dev/socket/qmux_radio
173 setprop ro.baseband.arch mdm
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800174 enable qmuxd
175 enable netmgrd
Daniel Rosenberg4cefd4a2014-06-09 17:50:22 -0700176 setprop rild.libpath /vendor/lib64/libril-qc-qmi-1.so
tim.tm_line5976c12014-05-16 14:41:26 +0800177 setprop rild.libargs "-e wwan0"
tim.tm_lin5da17ae2014-09-26 18:31:21 +0800178 setprop persist.radio.snapshot_enabled 1
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800179
180on property:ro.boot.baseband=US
181 stop ril-daemon
tim.tm_linbefefef2014-10-24 17:46:23 +0800182 setprop persist.radio.apm_sim_not_pwdn 1
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800183 enable kickstart
184 mkdir /dev/socket/qmux_radio 0770 radio radio
185 chmod 2770 /dev/socket/qmux_radio
186 setprop ro.baseband.arch mdm
187 enable qmuxd
188 enable netmgrd
189 setprop rild.libpath /vendor/lib64/libril-qc-qmi-1.so
190 setprop rild.libargs "-e wwan0"
tim.tm_lin5da17ae2014-09-26 18:31:21 +0800191 setprop persist.radio.snapshot_enabled 1
tim.tm_line5976c12014-05-16 14:41:26 +0800192
Colin Crossa9e55ed2013-10-07 14:15:18 -0700193# bugreport is triggered by holding down volume down, volume up and power
194service bugreport /system/bin/dumpstate -d -p -B \
195 -o /data/data/com.android.shell/files/bugreports/bugreport
JP Abgrall0921d062014-05-05 13:43:17 -0700196 class late_start
Colin Crossa9e55ed2013-10-07 14:15:18 -0700197 disabled
198 oneshot
199 keycodes 114 115 116
200
Colin Cross0b509222013-10-10 17:03:43 -0700201service p2p_supplicant /system/bin/wpa_supplicant \
202 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
Dmitry Shmidt29d7c832013-10-16 09:28:28 -0700203 -I/system/etc/wifi/p2p_supplicant_overlay.conf \
Dmitry Shmidt64028842013-10-14 17:20:23 -0700204 -puse_p2p_group_interface=1p2p_device=1 \
Dmitry Shmidtf7a3fd22014-03-07 12:30:55 -0800205 -m/data/misc/wifi/p2p_supplicant.conf \
Colin Cross0b509222013-10-10 17:03:43 -0700206 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
JP Abgrall0921d062014-05-05 13:43:17 -0700207 class late_start
Colin Cross0b509222013-10-10 17:03:43 -0700208 socket wpa_wlan0 dgram 660 wifi wifi
209 disabled
210 oneshot
211
JP Abgrallc8d00112014-05-07 11:14:27 -0700212service gpsd /system/bin/glgps -c /system/etc/gpsconfig.xml
JP Abgrall0921d062014-05-05 13:43:17 -0700213 class late_start
edwin_tungac7b5c12014-01-24 19:46:58 +0800214 disabled
edwin_tunge98db7e2013-12-05 12:08:00 +0800215 user gps
216 socket gps seqpacket 0660 gps system
217 group system inet sdcard_rw sdcard_r
218
Colin Cross0b509222013-10-10 17:03:43 -0700219service wpa_supplicant /system/bin/wpa_supplicant \
220 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
221 -I/system/etc/wifi/wpa_supplicant_overlay.conf \
Colin Cross0b509222013-10-10 17:03:43 -0700222 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
JP Abgrall0921d062014-05-05 13:43:17 -0700223 class late_start
Colin Cross0b509222013-10-10 17:03:43 -0700224 socket wpa_wlan0 dgram 660 wifi wifi
225 disabled
226 oneshot
227
228service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
229 class main
230 disabled
231 oneshot
232
233service dhcpcd_p2p /system/bin/dhcpcd -aABKL
234 class main
235 disabled
236 oneshot
237
Thomas.TT_Lin4cda8582014-03-13 22:19:36 +0800238service dhcpcd_bt-pan /system/bin/dhcpcd -aABDKL
239 class main
240 disabled
241 oneshot
242
Badhri Jagan Sridharan52976e22014-09-29 12:12:33 -0700243service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL
244 class late_start
245 disabled
246 oneshot
247
Colin Cross0b509222013-10-10 17:03:43 -0700248service iprenew_wlan0 /system/bin/dhcpcd -n
249 class main
250 disabled
251 oneshot
252
Badhri Jagan Sridharan52976e22014-09-29 12:12:33 -0700253service iprenew_eth0 /system/bin/dhcpcd -n
254 class late_start
255 disabled
256 oneshot
257
Colin Cross0b509222013-10-10 17:03:43 -0700258service iprenew_p2p /system/bin/dhcpcd -n
259 class main
260 disabled
261 oneshot
tim.tm_line5976c12014-05-16 14:41:26 +0800262
Dmitry Shmidt4966d6b2014-10-01 11:17:41 -0700263service iprenew_bt-pan /system/bin/dhcpcd -n
264 class main
265 disabled
266 oneshot
267
Daniel Rosenberg4cefd4a2014-06-09 17:50:22 -0700268service kickstart /vendor/bin/qcks -i /vendor/firmware/mdm/image/ -r /data/qcks/mdm/
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800269 class late_start
270 disabled
tim.tm_line5976c12014-05-16 14:41:26 +0800271 user system
272 group system
273 oneshot
274
Daniel Rosenberg4cefd4a2014-06-09 17:50:22 -0700275service qmuxd /vendor/bin/qmuxd
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800276 class late_start
tim.tm_line5976c12014-05-16 14:41:26 +0800277 disabled
278 user system
279 group system radio
280
Daniel Rosenberg4cefd4a2014-06-09 17:50:22 -0700281service netmgrd /vendor/bin/netmgrd
tim.tm_lin3dcf3082014-07-01 17:50:41 +0800282 class late_start
tim.tm_line5976c12014-05-16 14:41:26 +0800283 disabled
284 group system radio
Arve Hjønnevåg36dff432014-08-28 15:16:57 -0700285
286service tlk_daemon /vendor/bin/tlk_daemon --storagedir /data/ss
287 class main
288 group system