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