forked from CyanogenMod/android_device_htc_flounder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.flounder.rc
292 lines (238 loc) · 9.79 KB
/
init.flounder.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
import init.flounder.usb.rc
on init
start watchdogd
# See storage config details at http://source.android.com/tech/storage/
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /storage/emulated 0555 root root
mkdir /mnt/media_rw/usbdisk 0700 media_rw media_rw
mkdir /storage/usbdisk 0700 root root
export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
symlink /storage/usbdisk /usbdisk
symlink /storage/usbdisk /mnt/usbdisk
on post-fs
write /sys/power/gpu_power_on 1
write /sys/module/input_cfboost/parameters/gpu_wakeup 1
# Turn on swap
swapon_all /fstab.flounder
# Swap in only 1 page at a time
write /proc/sys/vm/page-cluster 0
on post-fs-data
# Now that are booted all the way and out of mount panics, ensure that we panic on later errors.
# This is a hack to work around the fact that we can't recover from all errors that would lead to a panic
# during the initial mount (http://b/17382778), yet we need to panic on emmc errors (http://b/17640053)
# For a remount only the flags and the target mount point are relevant.
mount dummy dummy /data remount nosuid nodev noatime rw seclabel,background_gc=on,user_xattr,acl,errors=panic
mkdir /data/media 0770 media_rw media_rw
mkdir /data/nvcam 0700 media camera
# NFC: create data/nfc for nv storage
mkdir /data/nfc 0770 nfc nfc
mkdir /data/nfc/param 0770 nfc nfc
# secure os storage
mkdir /data/ss 0700 system system
# for GPS files
mkdir /data/gps 0770 gps system
# modem init
mkdir /data/qcks 0770 system system
mkdir /data/efs 0771 system system
mkdir /data/qcks/mdm 0770 system system
setprop vold.post_fs_data_done 1
on boot
# bluetooth
# change back to bluetooth from system
chown bluetooth net_bt_stack /data/misc/bluetooth
# power down interface
write /sys/class/rfkill/rfkill0/state 0
mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
# Set up kernel tracing, but disable it by default
chmod 0222 /sys/kernel/debug/tracing/trace_marker
write /sys/kernel/debug/tracing/tracing_on 0
write /sys/module/tegra3_emc/parameters/emc_enable 0
#write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000
#write /sys/module/cpu_tegra/parameters/cpu_user_cap 700000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 510000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 510000
#write /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed 700000
#write /sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed 700000
#write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2
#write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80
write /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable 0
restorecon_recursive /sys/devices/system/cpu/cpufreq/interactive
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
# Enable CC4
write /sys/devices/system/cpu/cpu0/cpuidle/state1/disabled 0
write /sys/devices/system/cpu/cpu1/cpuidle/state1/disabled 0
# b/13568411: make lazy vfree flush thresholds match flush_tlb_range
write /proc/sys/vm/lazy_vfree_tlb_flush_all_threshold 524288
chmod 0444 /sys/kernel/debug/bq2419x-regs
write /proc/sys/net/core/rmem_max 1048576
write /proc/sys/net/core/wmem_max 1048576
on fs
mount_all /fstab.flounder
setprop ro.crypto.fuse_sdcard true
# virtual sdcard daemon running as media_rw (1023)
service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
class late_start
service fuse_usbdisk /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/usbdisk /storage/usbdisk
class late_start
disabled
service battery_charger /charger
class charger
seclabel u:r:healthd:s0
# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
service watchdogd /sbin/watchdogd 10 20
class core
disabled
seclabel u:r:watchdogd:s0
# on userdebug and eng builds, enable kgdb on the serial console
on property:ro.debuggable=1
write /sys/module/kgdboc/parameters/kgdboc ttyFIQ0
write /sys/module/fiq_debugger/parameters/kgdb_enable 1
# for loading correct gps hal share libraries
on property:ro.boot.baseband=N/A
setprop ro.hardware.gps bcm47521
enable gpsd
on property:ro.boot.baseband=US
write /sys/module/bcmdhd/parameters/nvram_path /system/etc/wifi/bcmdhd_lte.cal
on property:ro.boot.baseband=ROW
write /sys/module/bcmdhd/parameters/nvram_path /system/etc/wifi/bcmdhd_lte.cal
on property:ro.baseband=unknown
setprop ro.hardware.gps bcm47521
enable gpsd
# for telephony function
on property:ro.boot.baseband=N/A
setprop ro.radio.noril true
stop ril-daemon
on property:ro.hw.ks.ready=1
start ril-daemon
on property:ro.boot.baseband=ROW
stop ril-daemon
enable kickstart
mkdir /dev/socket/qmux_radio 0770 radio radio
chmod 2770 /dev/socket/qmux_radio
setprop ro.baseband.arch mdm
enable qmuxd
enable netmgrd
setprop rild.libpath /vendor/lib64/libril-qc-qmi-1.so
setprop rild.libargs "-e wwan0"
on property:ro.boot.baseband=US
stop ril-daemon
enable kickstart
mkdir /dev/socket/qmux_radio 0770 radio radio
chmod 2770 /dev/socket/qmux_radio
setprop ro.baseband.arch mdm
enable qmuxd
enable netmgrd
setprop rild.libpath /vendor/lib64/libril-qc-qmi-1.so
setprop rild.libargs "-e wwan0"
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/dumpstate -d -p -B \
-o /data/data/com.android.shell/files/bugreports/bugreport
class late_start
disabled
oneshot
keycodes 114 115 116
service p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/p2p_supplicant_overlay.conf \
-puse_p2p_group_interface=1p2p_device=1 \
-m/data/misc/wifi/p2p_supplicant.conf \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
class late_start
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service gpsd /system/bin/glgps -c /system/etc/gpsconfig.xml
class late_start
disabled
user gps
socket gps seqpacket 0660 gps system
group system inet sdcard_rw sdcard_r
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
class late_start
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service dhcpcd_bt-pan /system/bin/dhcpcd -aABDKL
class main
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL
class late_start
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_eth0 /system/bin/dhcpcd -n
class late_start
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_bt-pan /system/bin/dhcpcd -n
class main
disabled
oneshot
service kickstart /vendor/bin/qcks -i /vendor/firmware/mdm/image/ -r /data/qcks/mdm/
class late_start
disabled
user system
group system
oneshot
service qmuxd /vendor/bin/qmuxd
class late_start
disabled
user system
group system radio
service netmgrd /vendor/bin/netmgrd
class late_start
disabled
group system radio
service tlk_daemon /vendor/bin/tlk_daemon --storagedir /data/ss
class main
group system