• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright 2013 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17import init.hammerhead.usb.rc
18import init.hammerhead_svelte.rc
19import init.hammerhead.diag.rc
20import init.hammerhead_fp.rc
21
22on early-init
23    mount debugfs debugfs /sys/kernel/debug
24    chown system system /sys/kernel/debug/kgsl/proc
25
26on init
27    # Set permissions for persist partition
28    mkdir /persist 0771 system system
29    mkdir /firmware 0771 system system
30
31    # Support legacy paths
32    symlink /sdcard /mnt/sdcard
33    symlink /sdcard /storage/sdcard0
34
35on fs
36    mount_all ./fstab.hammerhead
37    restorecon_recursive /persist
38
39on early-boot
40    # set RLIMIT_MEMLOCK to 64MB
41    setrlimit 8 67108864 67108864
42
43on boot
44    # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP
45    write /sys/module/wakelock/parameters/debug_mask 7
46
47    # bluetooth
48    chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
49    chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
50    chmod 0660 /sys/class/rfkill/rfkill0/state
51
52    # bluetooth LPM
53    chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
54    chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
55
56    #bluetooth UART dev
57    chown bluetooth net_bt_stack /sys/devices/platform/msm_serial_hs.0/clock
58    chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
59
60    #Create QMUX deamon socket area
61    mkdir /dev/socket/qmux_radio 0770 radio radio
62    chmod 2770 /dev/socket/qmux_radio
63    mkdir /dev/socket/qmux_audio 0770 media audio
64    chmod 2770 /dev/socket/qmux_audio
65    mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
66    chmod 2770 /dev/socket/qmux_bluetooth
67    mkdir /dev/socket/qmux_gps 0770 gps gps
68    chmod 2770 /dev/socket/qmux_gps
69
70    # Camera Recording
71    mkdir /dev/video
72    symlink /dev/video32 /dev/video/venus_dec
73    symlink /dev/video33 /dev/video/venus_enc
74
75    # Allow QMUX daemon to assign port open wait time
76    chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
77
78    #For bridgemgr daemon to inform the USB driver of the correct transport
79    chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
80
81    # Assign TCP buffer thresholds to be ceiling value of technology maximums
82    # Increased technology maximums should be reflected here.
83    write /proc/sys/net/core/rmem_max  2097152
84    write /proc/sys/net/core/wmem_max  2097152
85
86    # create symlink for fb1 as HDMI
87    symlink /dev/graphics/fb1 /dev/graphics/hdmi
88
89    # setup permissions for fb1 related nodes
90    chown system graphics /sys/class/graphics/fb1/hpd
91    chown system graphics /sys/class/graphics/fb1/vendor_name
92    chown system graphics /sys/class/graphics/fb1/product_description
93    chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
94    chmod 0664 /sys/devices/virtual/graphics/fb1/vendor_name
95    chmod 0664 /sys/devices/virtual/graphics/fb1/product_description
96
97    # To allow interfaces to get v6 address when tethering is enabled
98    write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
99    write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
100    write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
101    write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
102    write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
103    write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
104    write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
105    write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
106
107    # Subsytem Restart
108    #adsp
109    write /sys/bus/msm_subsys/devices/subsys0/restart_level "related"
110    #modem
111    write /sys/bus/msm_subsys/devices/subsys1/restart_level "related"
112    #venus
113    write /sys/bus/msm_subsys/devices/subsys2/restart_level "related"
114
115    # leds
116    chown system system /sys/class/leds/red/on_off_ms
117    chown system system /sys/class/leds/green/on_off_ms
118    chown system system /sys/class/leds/blue/on_off_ms
119    chown system system /sys/class/leds/red/rgb_start
120    chmod 664 /sys/class/leds/lcd-backlight/brightness
121
122on post-fs-data
123    write /sys/kernel/boot_adsp/boot 1
124
125    # Subsytem Ramdump collection
126    mkdir /data/tombstones/ramdump 0777 system system
127    write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
128
129    # NFC: create data/nfc for nv storage
130    mkdir /data/nfc 0770 nfc nfc
131    mkdir /data/nfc/param 0770 nfc nfc
132
133    # wifi
134    chown wifi system /persist/wifi
135
136    #  bluetooth
137    mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
138
139    # Create directory used by audio subsystem
140    mkdir /data/misc/audio 0770 audio audio
141
142    # Create directory used by sensor subsystem
143    mkdir /data/system 0755 system system
144    mkdir /data/system/sensors
145    chmod 755 /data/system/sensors
146
147    # AKM setting data
148    mkdir /data/misc/sensors
149    chmod 775 /data/misc/sensors
150
151    # Sensor
152    mkdir /persist/sensors
153    chmod 775 /persist/sensors
154    write /persist/sensors/sensors_settings 1
155    chmod 660 /persist/sensors/sensors_settings
156
157    # communicate with mpdecision and thermald
158    mkdir /dev/socket/mpdecision 2770 root system
159
160    # save rtc time offsets
161    mkdir /data/system/time 0700 system system
162
163    # Ecc_Handler qcril.db
164    mkdir /data/misc/radio 0770 radio radio
165    symlink /system/etc/qcril.db /data/misc/radio/qcril.db
166
167    setprop vold.post_fs_data_done 1
168
169    # Set the CPU Freq Sampling rates
170    write /sys/module/msm_thermal/core_control/enabled 0
171    write /sys/devices/system/cpu/cpu1/online 1
172    write /sys/devices/system/cpu/cpu2/online 1
173    write /sys/devices/system/cpu/cpu3/online 1
174    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
175    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand"
176    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "ondemand"
177    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "ondemand"
178    write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
179    write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
180    write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
181    write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
182    write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 10
183    write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core 70
184    write /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core 3
185    write /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq 960000
186    write /sys/devices/system/cpu/cpufreq/ondemand/sync_freq 960000
187    write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load 80
188    restorecon_recursive /sys/devices/system/cpu/cpufreq/ondemand
189    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
190    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 300000
191    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 300000
192    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 300000
193    write /sys/module/msm_thermal/core_control/enabled 1
194    chown root.system /sys/devices/system/cpu/mfreq
195    chmod 220 /sys/devices/system/cpu/mfreq
196    chown root.system /sys/devices/system/cpu/cpu1/online
197    chown root.system /sys/devices/system/cpu/cpu2/online
198    chown root.system /sys/devices/system/cpu/cpu3/online
199    chmod 664 /sys/devices/system/cpu/cpu1/online
200    chmod 664 /sys/devices/system/cpu/cpu2/online
201    chmod 664 /sys/devices/system/cpu/cpu3/online
202    write /dev/cpuctl/apps/cpu.notify_on_migrate 1
203
204on charger
205    # Booting modem
206    wait /dev/block/platform/msm_sdcc.1/by-name/modem
207    mount vfat /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0
208    wait /dev/block/platform/msm_sdcc.1/by-name/system
209    mount ext4 /dev/block/platform/msm_sdcc.1/by-name/system /system ro barrier=1
210    start rmt_storage
211    start irsc_util
212
213    # Enable Power modes and set the CPU Freq Sampling rates
214    write /sys/module/lpm_resources/enable_low_power/l2 2
215    write /sys/module/lpm_resources/enable_low_power/pxo 1
216    write /sys/module/lpm_resources/enable_low_power/vdd_dig 1
217    write /sys/module/lpm_resources/enable_low_power/vdd_mem 1
218    write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
219    write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
220    write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
221    write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
222    write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
223    write /sys/module/msm_thermal/core_control/enabled 0
224    write /sys/devices/system/cpu/cpu1/online 1
225    write /sys/devices/system/cpu/cpu2/online 1
226    write /sys/devices/system/cpu/cpu3/online 1
227    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
228    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "powersave"
229    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "powersave"
230    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "powersave"
231    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
232    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 300000
233    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 300000
234    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 300000
235    write /sys/module/msm_thermal/core_control/enabled 1
236    write /sys/devices/system/cpu/cpu1/online 0
237    write /sys/devices/system/cpu/cpu2/online 0
238    write /sys/devices/system/cpu/cpu3/online 0
239    start mpdecision
240
241on property:init.svc.wpa_supplicant=stopped
242    stop dhcpcd
243
244on property:sys.boot_completed=1
245    # Enable Power modes
246    write /sys/module/lpm_resources/enable_low_power/l2 2
247    write /sys/module/lpm_resources/enable_low_power/pxo 1
248    write /sys/module/lpm_resources/enable_low_power/vdd_dig 1
249    write /sys/module/lpm_resources/enable_low_power/vdd_mem 1
250    write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
251    write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
252    write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
253    write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
254    write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
255    write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
256    write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
257    write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled 1
258    write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled 1
259    write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
260    write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
261    write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
262    write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
263    write /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled 1
264    write /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled 1
265    write /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled 1
266    write /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled 1
267    start mpdecision
268
269    # enable slimport detection
270    write /sys/module/slimport/parameters/enable_irq 1
271
272    # enable logging of wake up reasons to kernel logs
273    write /sys/module/msm_show_resume_irq/parameters/debug_mask 1
274
275on property:ro.debuggable=1
276    start ssr_ramdump
277
278service rmt_storage /system/bin/rmt_storage
279    class core
280    user root
281    group system
282
283service bridgemgrd /system/bin/bridgemgrd
284    class main
285    user radio
286    group radio
287
288# QMUX must be in multiple groups to support external process connections
289service qmuxd /system/bin/qmuxd
290    class main
291    user radio
292    group radio audio bluetooth gps
293
294service netmgrd /system/bin/netmgrd
295    class main
296    group radio
297
298# QCOM sensor
299service sensors /system/bin/sensors.qcom
300    class main
301    user root
302    group root
303
304service irsc_util /system/bin/irsc_util "/etc/sec_config"
305    class main
306    user root
307    oneshot
308
309service p2p_supplicant /system/bin/wpa_supplicant \
310    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
311    -I/system/etc/wifi/wpa_supplicant_overlay.conf -N \
312    -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
313    -I/system/etc/wifi/p2p_supplicant_overlay.conf \
314    -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin \
315    -g@android:wpa_wlan0
316    #   we will start as root and wpa_supplicant will switch to user wifi
317    #   after setting up the capabilities required for WEXT
318    #   user wifi
319    #   group wifi inet keystore
320    class main
321    socket wpa_wlan0 dgram 660 wifi wifi
322    disabled
323    oneshot
324
325service wpa_supplicant /system/bin/wpa_supplicant \
326    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
327    -I/system/etc/wifi/wpa_supplicant_overlay.conf \
328    -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
329    #   we will start as root and wpa_supplicant will switch to user wifi
330    #   after setting up the capabilities required for WEXT
331    #   user wifi
332    #   group wifi inet keystore
333    class main
334    socket wpa_wlan0 dgram 660 wifi wifi
335    disabled
336    oneshot
337
338service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
339    class late_start
340    disabled
341    oneshot
342
343service dhcpcd_p2p /system/bin/dhcpcd -aABKL
344    class late_start
345    disabled
346    oneshot
347
348service iprenew_wlan0 /system/bin/dhcpcd -n
349    class late_start
350    disabled
351    oneshot
352
353service iprenew_p2p /system/bin/dhcpcd -n
354    class late_start
355    disabled
356    oneshot
357
358service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL
359    class late_start
360    disabled
361    oneshot
362
363service iprenew_eth0 /system/bin/dhcpcd -n
364    class late_start
365    disabled
366    oneshot
367
368service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
369    disabled
370    oneshot
371
372service dhcpcd_bnep1 /system/bin/dhcpcd -BKLG
373    disabled
374    oneshot
375
376service dhcpcd_bnep2 /system/bin/dhcpcd -BKLG
377    disabled
378    oneshot
379
380service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG
381    disabled
382    oneshot
383
384service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG
385    disabled
386    oneshot
387
388service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG
389    disabled
390    oneshot
391
392service iprenew_bt-pan /system/bin/dhcpcd -n
393    disabled
394    oneshot
395
396service qseecomd /system/bin/qseecomd
397    class core
398    user root
399    group root
400
401service charger /sbin/healthd -c
402    class charger
403    critical
404    seclabel u:r:healthd:s0
405
406service qcamerasvr /system/bin/mm-qcamera-daemon
407    class late_start
408    user camera
409    group camera system inet input
410
411service bdAddrLoader /system/bin/bdAddrLoader -f /persist/bluetooth/.bdaddr -h -x
412    class main
413    user bluetooth
414    group system bluetooth
415    oneshot
416
417# bugreport is triggered by holding down volume down, volume up and power
418service bugreport /system/bin/dumpstate -d -p -B \
419        -o /data/data/com.android.shell/files/bugreports/bugreport
420    class main
421    disabled
422    oneshot
423    keycodes 114 115 116
424
425service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
426   class main
427   user root
428   group root system
429   disabled
430
431service ssr_ramdump /system/bin/subsystem_ramdump -m -t emmc
432    class main
433    user root
434    group root
435    disabled
436
437service thermal-engine /system/bin/thermal-engine-hh
438   class main
439   user root
440   group radio system
441
442service vss_init /vendor/bin/vss_init
443    class late_start
444    user root
445    group root
446    disabled
447
448service time_daemon /system/bin/time_daemon
449    class late_start
450    user root
451    group root
452