1 import init.grouper.usb.rc 2 3 on early-init 4 mount debugfs debugfs /sys/kernel/debug 5 6 on init 7 # 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 21 on early-boot 22 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive 23 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive 24 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive 25 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive 26 27 on fs 28 mkdir /factory 0775 radio radio 29 30 setprop ro.crypto.umount_sd false 31 mount_all /fstab.grouper 32 33 on post-fs-data 34 mkdir /data/media 0770 media_rw media_rw 35 36 # change back to bluetooth from system 37 chown bluetooth net_bt_stack /data/misc/bluetooth 38 39 # sensors-config 40 mkdir /data/sensors 751 41 # /data/sensors was owned by system/system earlier. 42 # Force it to root/root if it already exists. 43 chown root root /data/sensors 44 mkdir /data/lightsensor 751 45 # /data/lightsensor was owned by system/system earlier. 46 # Force it to root/root if it already exists. 47 chown root root /data/lightsensor 48 mkdir /data/calibration 49 mkdir /data/amit 50 51 mkdir /data/radio 0775 radio radio 52 mkdir /data/radio/log 0775 radio radio 53 54 # Set indication (checked by vold) that we have finished this action 55 setprop vold.post_fs_data_done 1 56 57 on boot 58 59 # bluetooth 60 # UART device 61 chmod 0660 /dev/ttyHS2 62 chown bluetooth net_bt_stack /dev/ttyHS2 63 64 # power up/down interface 65 chmod 0660 /sys/class/rfkill/rfkill0/state 66 chmod 0660 /sys/class/rfkill/rfkill0/type 67 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state 68 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type 69 70 # bluetooth MAC address programming 71 chown bluetooth net_bt_stack ro.bt.bdaddr_path 72 chown bluetooth net_bt_stack /system/etc/bluetooth 73 chown bluetooth net_bt_stack /data/misc/bluetooth 74 setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr" 75 76 # bluetooth LPM 77 chmod 0220 /proc/bluetooth/sleep/lpm 78 chmod 0220 /proc/bluetooth/sleep/btwrite 79 chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm 80 chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite 81 82 # NFC 83 setprop ro.nfc.port "I2C" 84 chmod 0660 /dev/pn544 85 chown nfc nfc /dev/pn544 86 87 # Proximity for RIL BODYSAR 88 chmod 0660 /sys/devices/platform/tegra-i2c.2/i2c-2/2-0028/sensor_onoff 89 chown root radio /sys/devices/platform/tegra-i2c.2/i2c-2/2-0028/sensor_onoff 90 91 # backlight 92 chown system system /sys/class/backlight/pwm-backlight/brightness 93 94 # didim 95 chown system system /sys/class/graphics/fb0/device/smartdimmer/enable 96 chown system system /sys/class/graphics/fb0/device/smartdimmer/aggressiveness 97 98 # power 99 chown system system /sys/kernel/tegra_cap/core_cap_level 100 chown system system /sys/kernel/tegra_cap/core_cap_state 101 chown system system /sys/module/cpu_tegra/parameters/cpu_user_cap 102 103 # Sensor 104 # iio 105 chown system system /dev/iio:device0 106 chown system system /sys/bus/iio/devices/trigger0/name 107 chown system system /sys/bus/iio/devices/iio:device0/accl_enable 108 chown system system /sys/bus/iio/devices/iio:device0/accl_matrix 109 chown system system /sys/bus/iio/devices/iio:device0/buffer/length 110 chown system system /sys/bus/iio/devices/iio:device0/buffer/enable 111 chown system system /sys/bus/iio/devices/iio:device0/compass_enable 112 chown system system /sys/bus/iio/devices/iio:device0/compass_matrix 113 chown system system /sys/bus/iio/devices/iio:device0/dmp_on 114 chown system system /sys/bus/iio/devices/iio:device0/dmp_int_on 115 chown system system /sys/bus/iio/devices/iio:device0/gyro_enable 116 chown system system /sys/bus/iio/devices/iio:device0/gyro_matrix 117 chown system system /sys/bus/iio/devices/iio:device0/in_accel_scale 118 chown system system /sys/bus/iio/devices/iio:device0/in_anglvel_scale 119 chown system system /sys/bus/iio/devices/iio:device0/in_magn_scale 120 chown system system /sys/bus/iio/devices/iio:device0/key 121 chown system system /sys/bus/iio/devices/iio:device0/power_state 122 chown system system /sys/bus/iio/devices/iio:device0/sampling_frequency 123 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en 124 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en 125 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en 126 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en 127 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en 128 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en 129 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en 130 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en 131 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en 132 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en 133 chown system system /sys/bus/iio/devices/iio:device0/temperature 134 chown system system /sys/bus/iio/devices/iio:device0/trigger/current_trigger 135 136 # new in MA 5.1.5 137 chown system system /sys/bus/iio/devices/iio:device0/secondary_name 138 chown system system /sys/bus/iio/devices/iio:device0/dmp_firmware 139 chown system system /sys/bus/iio/devices/iio:device0/firmware_loaded 140 chown system system /sys/bus/iio/devices/iio:device0/dmp_event_int_on 141 chown system system /sys/bus/iio/devices/iio:device0/dmp_output_rate 142 chown system system /sys/bus/iio/devices/iio:device0/in_accel_x_offset 143 chown system system /sys/bus/iio/devices/iio:device0/in_accel_y_offset 144 chown system system /sys/bus/iio/devices/iio:device0/in_accel_z_offset 145 chown system system /sys/bus/iio/devices/iio:device0/gyro_fsr 146 ## LPQ 147 chown system system /sys/bus/iio/devices/iio:device0/quaternion_on 148 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_z_en 149 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_y_en 150 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_x_en 151 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_r_en 152 ## Screen orientation 153 chown system system /sys/bus/iio/devices/iio:device0/event_display_orientation 154 chown system system /sys/bus/iio/devices/iio:device0/display_orientation_on 155 ## SMD 156 chown system system /sys/bus/iio/devices/iio:device0/event_smd 157 chown system system /sys/bus/iio/devices/iio:device0/smd_enable 158 chown system system /sys/bus/iio/devices/iio:device0/smd_threshold 159 chown system system /sys/bus/iio/devices/iio:device0/smd_delay_threshold 160 chown system system /sys/bus/iio/devices/iio:device0/smd_delay_threshold2 161 162 ## AMI compass sensor 163 chown system system /dev/iio:device1 164 chown system system /sys/bus/iio/devices/trigger1/name 165 chown system system /sys/bus/iio/devices/iio:device1/buffer/length 166 chown system system /sys/bus/iio/devices/iio:device1/buffer/enable 167 chown system system /sys/bus/iio/devices/iio:device1/compass_enable 168 chown system system /sys/bus/iio/devices/iio:device1/compass_matrix 169 chown system system /sys/bus/iio/devices/iio:device1/in_magn_scale 170 chown system system /sys/bus/iio/devices/iio:device1/power_state 171 chown system system /sys/bus/iio/devices/iio:device1/sampling_frequency 172 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en 173 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en 174 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en 175 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en 176 chown system system /sys/bus/iio/devices/iio:device1/trigger/current_trigger 177 178 chmod 600 /dev/iio:device0 179 chmod 600 /sys/bus/iio/devices/trigger0/name 180 chmod 600 /sys/bus/iio/devices/iio:device0/accl_enable 181 chmod 600 /sys/bus/iio/devices/iio:device0/accl_matrix 182 chmod 600 /sys/bus/iio/devices/iio:device0/buffer/length 183 chmod 600 /sys/bus/iio/devices/iio:device0/buffer/enable 184 chmod 600 /sys/bus/iio/devices/iio:device0/compass_enable 185 chmod 600 /sys/bus/iio/devices/iio:device0/compass_matrix 186 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_on 187 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_int_on 188 chmod 600 /sys/bus/iio/devices/iio:device0/gyro_enable 189 chmod 600 /sys/bus/iio/devices/iio:device0/gyro_matrix 190 chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_scale 191 chmod 600 /sys/bus/iio/devices/iio:device0/in_anglvel_scale 192 chmod 600 /sys/bus/iio/devices/iio:device0/in_magn_scale 193 chmod 600 /sys/bus/iio/devices/iio:device0/key 194 chmod 600 /sys/bus/iio/devices/iio:device0/power_state 195 chmod 600 /sys/bus/iio/devices/iio:device0/sampling_frequency 196 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en 197 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en 198 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en 199 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en 200 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en 201 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en 202 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en 203 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en 204 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en 205 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en 206 chmod 600 /sys/bus/iio/devices/iio:device0/temperature 207 chmod 600 /sys/bus/iio/devices/iio:device0/trigger/current_trigger 208 209 # new in MA 5.1.5 210 chmod 600 /sys/bus/iio/devices/iio:device0/secondary_name 211 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_firmware 212 chmod 600 /sys/bus/iio/devices/iio:device0/firmware_loaded 213 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_event_int_on 214 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_output_rate 215 chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_x_offset 216 chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_y_offset 217 chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_z_offset 218 chmod 600 /sys/bus/iio/devices/iio:device0/gyro_fsr 219 ## LPQ 220 chmod 600 /sys/bus/iio/devices/iio:device0/quaternion_on 221 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_z_en 222 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_y_en 223 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_x_en 224 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_r_en 225 ## Screen orientation 226 chmod 600 /sys/bus/iio/devices/iio:device0/event_display_orientation 227 chmod 600 /sys/bus/iio/devices/iio:device0/display_orientation_on 228 ## SMD 229 chmod 600 /sys/bus/iio/devices/iio:device0/event_smd 230 chmod 600 /sys/bus/iio/devices/iio:device0/smd_enable 231 chmod 600 /sys/bus/iio/devices/iio:device0/smd_threshold 232 chmod 600 /sys/bus/iio/devices/iio:device0/smd_delay_threshold 233 chmod 600 /sys/bus/iio/devices/iio:device0/smd_delay_threshold2 234 235 ## AMI compass sensor 236 chmod 600 /dev/iio:device1 237 chmod 600 /sys/bus/iio/devices/trigger1/name 238 chmod 600 /sys/bus/iio/devices/iio:device1/buffer/length 239 chmod 600 /sys/bus/iio/devices/iio:device1/buffer/enable 240 chmod 600 /sys/bus/iio/devices/iio:device1/compass_enable 241 chmod 600 /sys/bus/iio/devices/iio:device1/compass_matrix 242 chmod 600 /sys/bus/iio/devices/iio:device1/in_magn_scale 243 chmod 600 /sys/bus/iio/devices/iio:device1/power_state 244 chmod 600 /sys/bus/iio/devices/iio:device1/sampling_frequency 245 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en 246 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en 247 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en 248 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en 249 chmod 600 /sys/bus/iio/devices/iio:device1/trigger/current_trigger 250 251 # Power management settings 252 write /sys/module/cpu_tegra3/parameters/no_lp 0 253 #write /sys/module/tegra3_emc/parameters/emc_enable 0 254 #write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000 255 write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2 256 write /sys/devices/system/cpu/cpufreq/interactive/input_boost 1 257 write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80 258 write /sys/module/cpu_tegra3/parameters/auto_hotplug 1 259 #write /sys/module/cpuidle_t3/parameters/lp2_0_in_idle 0 260 write /sys/module/cpuidle/parameters/lp2_in_idle 0 261 262 # Interactive governor settings 263 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost_factor 264 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost_factor 265 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 266 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 267 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 268 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 269 chown system system /sys/devices/system/cpu/cpufreq/interactive/max_boost 270 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/max_boost 271 chown system system /sys/devices/system/cpu/cpufreq/interactive/sustain_load 272 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/sustain_load 273 274 # Default Read Ahead value for sdcards 275 write /sys/block/mmcblk0/queue/read_ahead_kb 2048 276 write /sys/block/mmcblk1/queue/read_ahead_kb 2048 277 278 # GPS init 279 write /sys/class/gpio/export 162 280 write /sys/class/gpio/gpio162/value 0 281 write /sys/class/gpio/gpio162/direction out 282 chown gps system /sys/class/gpio/gpio162/value 283 chmod 0664 /sys/class/gpio/gpio162/value 284 mkdir /data/gps 285 chown gps system /data/gps 286 chmod 770 /data/gps 287 chown gps system /dev/ttyHS1 288 chmod 0660 /dev/ttyHS1 289 290 # ril 291 chown radio system /sys/devices/virtual/ril/files/crash_dump_onoff 292 chown radio system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 293 chmod 0660 /sys/devices/virtual/ril/files/crash_dump_onoff 294 chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 295 chown radio system /sys/devices/platform/baseband_xmm_power/xmm_nml_reset 296 chown radio system /sys/devices/platform/baseband_xmm_power/xmm_force_crash 297 chown radio system /sys/class/ril/files/stop_hotplug_detect 298 299 300 # Load WiFi driver 301 302 # BB mapping symbolic name to the logging ttyACM port 303 symlink /dev/ttyACM2 /dev/log_modem 304 305 # Touch 306 chown system system /dev/elan-iap 307 chown system system /proc/ektf_dbg 308 start touch_fw_update 309 310 # the following settings are used to disable ipv6 on cellular networks that cannot 311 # support it. 312 313 on property:ril.ipv6.rmnet0.enable=1 314 write /proc/sys/net/ipv6/conf/rmnet0/disable_ipv6 0 315 316 on property:ril.ipv6.rmnet0.enable=0 317 write /proc/sys/net/ipv6/conf/rmnet0/disable_ipv6 1 318 319 on property:ril.ipv6.rmnet1.enable=1 320 write /proc/sys/net/ipv6/conf/rmnet1/disable_ipv6 0 321 322 on property:ril.ipv6.rmnet1.enable=0 323 write /proc/sys/net/ipv6/conf/rmnet1/disable_ipv6 1 324 325 service 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 338 service p2p_supplicant /system/bin/wpa_supplicant \ 339 -iwlan0 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf \ 340 -I/system/etc/wifi/wpa_supplicant_overlay.conf -N \ 341 -ip2p0 -Dnl80211 -c /data/misc/wifi/p2p_supplicant.conf \ 342 -I/system/etc/wifi/p2p_supplicant_overlay.conf \ 343 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin \ 344 -g@android:wpa_wlan0 345 # we will start as root and wpa_supplicant will switch to user wifi 346 # after setting up the capabilities required for WEXT 347 # user wifi 348 # group wifi inet keystore 349 class main 350 socket wpa_wlan0 dgram 660 wifi wifi 351 disabled 352 oneshot 353 354 service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL 355 class main 356 disabled 357 oneshot 358 359 service dhcpcd_p2p /system/bin/dhcpcd -aABKL 360 class main 361 disabled 362 oneshot 363 364 service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL -f/system/etc/dhcpcd/dhcpcd.conf 365 class main 366 disabled 367 oneshot 368 369 service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL 370 class main 371 disabled 372 oneshot 373 374 service iprenew_wlan0 /system/bin/dhcpcd -n 375 class main 376 disabled 377 oneshot 378 379 service iprenew_p2p /system/bin/dhcpcd -n 380 class main 381 disabled 382 oneshot 383 384 service iprenew_eth0 /system/bin/dhcpcd -n 385 class main 386 disabled 387 oneshot 388 389 service iprenew_bt-pan /system/bin/dhcpcd -n 390 class main 391 disabled 392 oneshot 393 394 #Sensor: load calibration files. 395 service sensors-config /system/bin/sensors-config 396 class main 397 user root 398 oneshot 399 #Sensor load calibration files end 400 401 # virtual sdcard daemon running as media_rw (1023) 402 service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated 403 class late_start 404 405 # bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys 406 service bugreport /system/bin/dumpstate -d -p -B \ 407 -o /data/data/com.android.shell/files/bugreports/bugreport 408 class main 409 disabled 410 oneshot 411 keycodes 115 114 412 413 # Start GPS daemon 414 service gps-daemon /system/bin/glgps -c /system/etc/gps/gpsconfig.xml 415 user gps 416 group system 417 class late_start 418 419 # Recovery daemon: configure MSC partition 420 service recoveryd /system/bin/recoveryd /dev/block/platform/sdhci-tegra.3/by-name/MSC 421 disabled 422 class main 423 user root 424 group root 425 oneshot 426 427 on property:sys.shutdown.requested=1recovery 428 start recoveryd 429 430 # start tf_daemon service 431 service tf_daemon /system/bin/tf_daemon -storageDir /data/tf -d 432 class main 433 user root 434 group shell 435 436 # may restart due to /data/tf not existing yet 437 on property:init.svc.tf_daemon=restarting 438 mkdir /data/tf 439 440 # create filesystems if necessary 441 service setup_fs /system/bin/setup_fs \ 442 /dev/block/platform/sdhci-tegra.3/by-name/UDA \ 443 /dev/block/platform/sdhci-tegra.3/by-name/CAC 444 class core 445 user root 446 group root 447 oneshot 448 449 service touch_fw_update /system/bin/sh -c "echo /system/etc/firmware/touch_fw.ekt > /sys/bus/i2c/drivers/elan-ktf3k/1-0010/update_fw" 450 class main 451 disabled 452 user root 453 group root 454 oneshot 455 456