1# 2# Copyright 2012 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.flo.usb.rc 18import init.flo.diag.rc 19 20on early-init 21 mount debugfs debugfs /sys/kernel/debug 22 chown system system /sys/kernel/debug/kgsl/proc 23 symlink /data/tombstones /tombstones 24 25on init 26 # Support legacy paths 27 symlink /sdcard /mnt/sdcard 28 symlink /sdcard /storage/sdcard0 29 30on init 31 # Set permissions for persist partition 32 mkdir /persist 0771 system system 33 mkdir /firmware 0771 system system 34 35on fs 36 mount_all ./fstab.flo 37 restorecon_recursive /persist 38 write /sys/kernel/boot_adsp/boot 1 39 40on early-boot 41 # set RLIMIT_MEMLOCK to 64MB 42 setrlimit 8 67108864 67108864 43 44on boot 45 #Create QMUX deamon socket area 46 mkdir /dev/socket/qmux_radio 0770 radio radio 47 chmod 2770 /dev/socket/qmux_radio 48 mkdir /dev/socket/qmux_audio 0770 media audio 49 chmod 2770 /dev/socket/qmux_audio 50 mkdir /dev/socket/qmux_bluetooth 0770 bluetooth net_bt_stack 51 chmod 2770 /dev/socket/qmux_bluetooth 52 mkdir /dev/socket/qmux_gps 0770 gps gps 53 chmod 2770 /dev/socket/qmux_gps 54 55 # Allow QMUX daemon to assign port open wait time 56 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait 57 58 #port-bridge 59 chmod 0660 /dev/smd0 60 chown system system /dev/smd0 61 62 chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state 63 64 # create symlink for fb1 as HDMI 65 symlink /dev/graphics/fb1 /dev/graphics/hdmi 66 67 # Remove write permissions to video related nodes 68 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd 69 chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode 70 chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d 71 72 # Change owner and group for media server and surface flinger 73 chown system system /sys/devices/virtual/graphics/fb1/format_3d 74 chown system system /sys/devices/virtual/graphics/fb1/hpd 75 76 #For bridgemgr daemon to inform the USB driver of the correct transport 77 chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport 78 79 chmod 660 /dev/rtc0 80 chown system system /dev/rtc0 81 82 chown root system /proc/net/ip_conntrack 83 84 # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP 85 write /sys/module/wakelock/parameters/debug_mask 7 86 87 write /proc/sys/vm/swappiness 0 88 89 #To allow interfaces to get v6 address when tethering is enabled 90 write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2 91 write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2 92 write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2 93 write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2 94 write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2 95 write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2 96 write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2 97 write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2 98 write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2 99 write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2 100 write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2 101 write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2 102 write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2 103 write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2 104 write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2 105 write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2 106 107 #Enable logging of the wake up reasons in the kernel log 108 write /sys/module/msm_show_resume_irq/parameters/debug_mask 1 109 110# NFC: create data/nfc for nv storage 111 mkdir /data/nfc 770 nfc nfc 112 mkdir /data/nfc/param 770 nfc nfc 113 114# Assign TCP buffer thresholds to be ceiling value of technology maximums 115# Increased technology maximums should be reflected here. 116 write /proc/sys/net/core/rmem_max 1220608 117 write /proc/sys/net/core/wmem_max 1220608 118 119# msm specific files that need to be created on /data 120on post-fs-data 121 chown system system /dev/wcnss_wlan 122 write /sys/module/wcnss_ssr_8960/parameters/enable_riva_ssr 1 123 124 mkdir /tombstones/modem 0771 system system 125 mkdir /tombstones/lpass 0771 system system 126 mkdir /tombstones/wcnss 0771 system system 127 mkdir /tombstones/dsps 0771 system system 128 mkdir /tombstones/mdm 0771 system system 129 130# to observe dnsmasq.leases file for dhcp information of soft ap. 131 chown dhcp system /data/misc/dhcp 132 133 # Create directory used by audio subsystem 134 mkdir /data/misc/audio 0770 audio audio 135 136 # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections 137 # We chown/chmod /persist again so because mount is run as root + defaults 138 chown system system /persist 139 chmod 0664 /sys/devices/platform/msm_sdcc.1/polling 140 chmod 0664 /sys/devices/platform/msm_sdcc.2/polling 141 chmod 0664 /sys/devices/platform/msm_sdcc.3/polling 142 chmod 0664 /sys/devices/platform/msm_sdcc.4/polling 143 144 # Chown polling nodes as needed from UI running on system server 145 chown system system /sys/devices/platform/msm_sdcc.1/polling 146 chown system system /sys/devices/platform/msm_sdcc.2/polling 147 chown system system /sys/devices/platform/msm_sdcc.3/polling 148 chown system system /sys/devices/platform/msm_sdcc.4/polling 149 150 #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant 151 mkdir /data/system 0775 system system 152 #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant 153 154 #Create directory used by sensor subsystem(dsps) 155 mkdir /data/system/sensors 156 chmod 775 /data/system/sensors 157 write /data/system/sensors/settings 1 158 chmod 660 /data/system/sensors/settings 159 160 # AKM setting data 161 mkdir /data/misc/sensors 162 chmod 775 /data/misc/sensors 163 164 mkdir /persist/sensors 165 chmod 775 /persist/sensors 166 167 # Modify from 777 (for camera calibration) to 775 168 chmod 775 /persist/camera_calibration 169 170 # Modify from 777 (for lightsensor) to 775 171 chmod 775 /persist/lightsensor 172 173 # Modify from 777 (for lightsensor calibration data) to 664 174 chmod 664 /persist/lightsensor/AL3010_Config.ini 175 176 chmod 664 /persist/ssn 177 chmod 664 /persist/60isn 178 179 #Provide the access to hostapd.conf only to root and group 180 chmod 0660 /data/hostapd/hostapd.conf 181 182 # Enable the setgid bit on the directory 183 mkdir /data/audio 0770 media audio 184 chmod 2770 /data/audio 185 186 # kickstart 187 mkdir /data/qcks 0770 system system 188 chown system /dev/block/platform/msm_sdcc.1/by-name 189 190 setprop vold.post_fs_data_done 1 191 192 rm /data/local/tmp/adreno_config.txt 193 194 # White LED 195 chown system system /sys/class/leds/white/device/lock 196 chown system system /sys/class/leds/white/brightness 197 chown system system /sys/class/leds/white/device/grpfreq 198 chown system system /sys/class/leds/white/device/grppwm 199 chown system system /sys/class/leds/white/device/blink 200 201 # communicate with mpdecision and thermald 202 mkdir /dev/socket/mpdecision 2770 root system 203 204 # adjust vibrator amplitude 205 write /sys/class/timed_output/vibrator/amp 70 206 207 # Enable Power modes and set the CPU Freq Sampling rates 208 write /sys/module/rpm_resources/enable_low_power/L2_cache 1 209 write /sys/module/rpm_resources/enable_low_power/pxo 1 210 write /sys/module/rpm_resources/enable_low_power/vdd_dig 1 211 write /sys/module/rpm_resources/enable_low_power/vdd_mem 1 212 write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1 213 write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1 214 write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1 215 write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1 216 write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1 217 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand" 218 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand" 219 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "ondemand" 220 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "ondemand" 221 restorecon_recursive /sys/devices/system/cpu/cpufreq/ondemand 222 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90 223 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000 224 write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1 225 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4 226 write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 10 227 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core 60 228 write /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core 3 229 write /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq 918000 230 write /sys/devices/system/cpu/cpufreq/ondemand/sync_freq 1026000 231 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load 80 232 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000 233 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000 234 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000 235 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000 236 write /sys/devices/system/cpu/cpu1/online 1 237 write /sys/devices/system/cpu/cpu2/online 1 238 write /sys/devices/system/cpu/cpu3/online 1 239 write /dev/cpuctl/apps/cpu.notify_on_migrate 1 240 241on charger 242 # Enable Power modes and set the CPU Freq Sampling rates 243 write /sys/module/rpm_resources/enable_low_power/L2_cache 1 244 write /sys/module/rpm_resources/enable_low_power/pxo 1 245 write /sys/module/rpm_resources/enable_low_power/vdd_dig 1 246 write /sys/module/rpm_resources/enable_low_power/vdd_mem 1 247 write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1 248 write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1 249 write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1 250 write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1 251 write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1 252 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave" 253 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "powersave" 254 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "powersave" 255 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "powersave" 256 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90 257 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000 258 write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1 259 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4 260 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000 261 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000 262 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000 263 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000 264 265on property:init.svc.wpa_supplicant=stopped 266 stop dhcpcd 267 268service irsc_util /system/bin/irsc_util "/etc/sec_config" 269 class main 270 user root 271 oneshot 272 273service rmt_storage /system/bin/rmt_storage 274 class main 275 user root 276 group system 277 278service hciattach /system/bin/init.flo.bt.sh 279 class late_start 280 user bluetooth 281 group qcom_oncrpc bluetooth net_bt_admin system net_bt_stack 282 disabled 283 oneshot 284 285on property:bluetooth.hciattach=true 286 start hciattach 287 288on property:bluetooth.hciattach=false 289 setprop bluetooth.status off 290 291service 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 297service qmuxd /system/bin/qmuxd 298 class main 299 user radio 300 group radio audio bluetooth gps net_bt_stack 301 disabled 302 303service ks_checker /system/bin/kickstart_checker.sh 304 class core 305 oneshot 306 307service kickstart /system/bin/qcks -i /firmware/image/ -r /data/tombstones/mdm/ 308 class core 309 user system 310 group system 311 disabled 312 oneshot 313 314on property:gsm.radio.kickstart=on 315 start kickstart 316 317on property:gsm.radio.kickstart=off 318 stop kickstart 319 320on property:ril.asus_debugger_running=1 321 start asus-dbug-d 322 323service netmgrd /system/bin/netmgrd 324 class main 325 group radio 326 disabled 327 328 329service sensors /system/bin/sensors.qcom 330 class late_start 331 user root 332 group root 333 334service wpa_supplicant /system/bin/wpa_supplicant \ 335 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ 336 -I/system/etc/wifi/wpa_supplicant_overlay.conf \ 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 347service p2p_supplicant /system/bin/wpa_supplicant \ 348 -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ 349 -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \ 350 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ 351 -I/system/etc/wifi/wpa_supplicant_overlay.conf \ 352 -puse_p2p_group_interface=1 \ 353 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 354# we will start as root and wpa_supplicant will switch to user wifi 355# after setting up the capabilities required for WEXT 356# user wifi 357# group wifi inet keystore 358 class main 359 socket wpa_wlan0 dgram 660 wifi wifi 360 disabled 361 oneshot 362 363service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL 364 class main 365 disabled 366 oneshot 367 368service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL 369 class main 370 disabled 371 oneshot 372 373service dhcpcd_p2p /system/bin/dhcpcd -aABKL 374 class main 375 disabled 376 oneshot 377 378service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL 379 class main 380 disabled 381 oneshot 382 383service iprenew_wlan0 /system/bin/dhcpcd -n 384 class main 385 disabled 386 oneshot 387 388service iprenew_eth0 /system/bin/dhcpcd -n 389 class main 390 disabled 391 oneshot 392 393service iprenew_p2p /system/bin/dhcpcd -n 394 class main 395 disabled 396 oneshot 397 398service iprenew_bt-pan /system/bin/dhcpcd -n 399 class main 400 disabled 401 oneshot 402 403on property:ro.data.large_tcp_window_size=true 404 # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB) 405 write /proc/sys/net/ipv4/tcp_adv_win_scale 1 406 407service charger /sbin/healthd -c 408 class charger 409 critical 410 seclabel u:r:healthd:s0 411 412service thermald /system/bin/thermald 413 class main 414 group radio system 415 416service mpdecision /system/bin/mpdecision --no_sleep --avg_comp 417 class main 418 user root 419 group root system 420 421service qcamerasvr /system/bin/mm-qcamera-daemon 422 class late_start 423 user camera 424 group camera system inet input 425 426service wcnss_init /system/bin/init.flo.wifi.sh 427 class late_start 428 user system 429 group system wifi 430 oneshot 431 432service bdAddrLoader /system/bin/bdAddrLoader -f /persist/bluetooth/.bdaddr -h -x 433 class main 434 user bluetooth 435 group system bluetooth net_bt_stack 436 oneshot 437 438# bugreport is triggered by holding down volume down, volume up and power 439service bugreport /system/bin/dumpstate -d -p -B \ 440 -o /data/data/com.android.shell/files/bugreports/bugreport 441 class main 442 disabled 443 oneshot 444 keycodes 114 115 116 445 446service qseecomd /system/bin/qseecomd 447 class late_start 448 user system 449 group system 450 451service diag_mdlog /system/bin/diag_mdlog -s 100 452 class late_start 453 disabled 454 455 456 457# on property:gsm.sim.state=READY 458# start diag_mdlog 459 460on property:ro.boot.baseband=mdm 461 start qmuxd 462 start netmgrd 463 464on property:ro.boot.baseband=apq 465 setprop ro.radio.noril yes 466 stop ril-daemon 467