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 setprop ro.crypto.umount_sd false 29 mount_all /fstab.grouper 30 31 on post-fs-data 32 mkdir /data/misc/wifi 0770 wifi wifi 33 mkdir /data/misc/wifi/sockets 0770 wifi wifi 34 mkdir /data/misc/dhcp 0770 dhcp dhcp 35 chown dhcp dhcp /data/misc/dhcp 36 37 mkdir /data/media 0770 media_rw media_rw 38 39 # change back to bluetooth from system 40 chown bluetooth net_bt_stack /data/misc/bluetooth 41 42 # Set indication (checked by vold) that we have finished this action 43 setprop vold.post_fs_data_done 1 44 45 on boot 46 47 # bluetooth 48 # UART device 49 chmod 0660 /dev/ttyHS2 50 chown bluetooth net_bt_stack /dev/ttyHS2 51 52 # power up/down interface 53 chmod 0660 /sys/class/rfkill/rfkill0/state 54 chmod 0660 /sys/class/rfkill/rfkill0/type 55 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state 56 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type 57 58 # bluetooth MAC address programming 59 chown bluetooth net_bt_stack ro.bt.bdaddr_path 60 chown bluetooth net_bt_stack /system/etc/bluetooth 61 chown bluetooth net_bt_stack /data/misc/bluetooth 62 setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr" 63 64 # bluetooth LPM 65 chmod 0220 /proc/bluetooth/sleep/lpm 66 chmod 0220 /proc/bluetooth/sleep/btwrite 67 chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm 68 chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite 69 70 # NFC 71 setprop ro.nfc.port "I2C" 72 chmod 0660 /dev/pn544 73 chown nfc nfc /dev/pn544 74 75 # backlight 76 chown system system /sys/class/backlight/pwm-backlight/brightness 77 78 # didim 79 chown system system /sys/class/graphics/fb0/device/smartdimmer/enable 80 chown system system /sys/class/graphics/fb0/device/smartdimmer/aggressiveness 81 82 # power 83 chown system system /sys/kernel/tegra_cap/core_cap_level 84 chown system system /sys/kernel/tegra_cap/core_cap_state 85 chown system system /sys/module/cpu_tegra/parameters/cpu_user_cap 86 87 # Sensor 88 # iio 89 chown system system /dev/iio:device0 90 chown system system /sys/bus/iio/devices/trigger0/name 91 chown system system /sys/bus/iio/devices/iio:device0/accl_enable 92 chown system system /sys/bus/iio/devices/iio:device0/accl_matrix 93 chown system system /sys/bus/iio/devices/iio:device0/buffer/length 94 chown system system /sys/bus/iio/devices/iio:device0/buffer/enable 95 chown system system /sys/bus/iio/devices/iio:device0/compass_enable 96 chown system system /sys/bus/iio/devices/iio:device0/compass_matrix 97 chown system system /sys/bus/iio/devices/iio:device0/dmp_on 98 chown system system /sys/bus/iio/devices/iio:device0/dmp_int_on 99 chown system system /sys/bus/iio/devices/iio:device0/gyro_enable 100 chown system system /sys/bus/iio/devices/iio:device0/gyro_matrix 101 chown system system /sys/bus/iio/devices/iio:device0/in_accel_scale 102 chown system system /sys/bus/iio/devices/iio:device0/in_anglvel_scale 103 chown system system /sys/bus/iio/devices/iio:device0/in_magn_scale 104 chown system system /sys/bus/iio/devices/iio:device0/key 105 chown system system /sys/bus/iio/devices/iio:device0/power_state 106 chown system system /sys/bus/iio/devices/iio:device0/sampling_frequency 107 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en 108 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en 109 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en 110 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en 111 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en 112 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en 113 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en 114 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en 115 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en 116 chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en 117 chown system system /sys/bus/iio/devices/iio:device0/temperature 118 chown system system /sys/bus/iio/devices/iio:device0/trigger/current_trigger 119 chown system system /dev/iio:device1 120 chown system system /sys/bus/iio/devices/trigger1/name 121 chown system system /sys/bus/iio/devices/iio:device1/buffer/length 122 chown system system /sys/bus/iio/devices/iio:device1/buffer/enable 123 chown system system /sys/bus/iio/devices/iio:device1/compass_enable 124 chown system system /sys/bus/iio/devices/iio:device1/compass_matrix 125 chown system system /sys/bus/iio/devices/iio:device1/in_magn_scale 126 chown system system /sys/bus/iio/devices/iio:device1/power_state 127 chown system system /sys/bus/iio/devices/iio:device1/sampling_frequency 128 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en 129 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en 130 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en 131 chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en 132 chown system system /sys/bus/iio/devices/iio:device1/trigger/current_trigger 133 134 chmod 600 /dev/iio:device0 135 chmod 600 /sys/bus/iio/devices/trigger0/name 136 chmod 600 /sys/bus/iio/devices/iio:device0/accl_enable 137 chmod 600 /sys/bus/iio/devices/iio:device0/accl_matrix 138 chmod 600 /sys/bus/iio/devices/iio:device0/buffer/length 139 chmod 600 /sys/bus/iio/devices/iio:device0/buffer/enable 140 chmod 600 /sys/bus/iio/devices/iio:device0/compass_enable 141 chmod 600 /sys/bus/iio/devices/iio:device0/compass_matrix 142 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_on 143 chmod 600 /sys/bus/iio/devices/iio:device0/dmp_int_on 144 chmod 600 /sys/bus/iio/devices/iio:device0/gyro_enable 145 chmod 600 /sys/bus/iio/devices/iio:device0/gyro_matrix 146 chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_scale 147 chmod 600 /sys/bus/iio/devices/iio:device0/in_anglvel_scale 148 chmod 600 /sys/bus/iio/devices/iio:device0/in_magn_scale 149 chmod 600 /sys/bus/iio/devices/iio:device0/key 150 chmod 600 /sys/bus/iio/devices/iio:device0/power_state 151 chmod 600 /sys/bus/iio/devices/iio:device0/sampling_frequency 152 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en 153 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en 154 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en 155 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en 156 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en 157 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en 158 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en 159 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en 160 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en 161 chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en 162 chmod 600 /sys/bus/iio/devices/iio:device0/temperature 163 chmod 600 /sys/bus/iio/devices/iio:device0/trigger/current_trigger 164 chmod 600 /dev/iio:device1 165 chmod 600 /sys/bus/iio/devices/trigger1/name 166 chmod 600 /sys/bus/iio/devices/iio:device1/buffer/length 167 chmod 600 /sys/bus/iio/devices/iio:device1/buffer/enable 168 chmod 600 /sys/bus/iio/devices/iio:device1/compass_enable 169 chmod 600 /sys/bus/iio/devices/iio:device1/compass_matrix 170 chmod 600 /sys/bus/iio/devices/iio:device1/in_magn_scale 171 chmod 600 /sys/bus/iio/devices/iio:device1/power_state 172 chmod 600 /sys/bus/iio/devices/iio:device1/sampling_frequency 173 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en 174 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en 175 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en 176 chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en 177 chmod 600 /sys/bus/iio/devices/iio:device1/trigger/current_trigger 178 179 # Power management settings 180 write /sys/module/cpu_tegra3/parameters/no_lp 0 181 #write /sys/module/tegra3_emc/parameters/emc_enable 0 182 #write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000 183 write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2 184 write /sys/devices/system/cpu/cpufreq/interactive/input_boost 1 185 write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80 186 write /sys/module/cpu_tegra3/parameters/auto_hotplug 1 187 #write /sys/module/cpuidle_t3/parameters/lp2_0_in_idle 0 188 write /sys/module/cpuidle/parameters/lp2_in_idle 0 189 190 # Interactive governor settings 191 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost_factor 192 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost_factor 193 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 194 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 195 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 196 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 197 chown system system /sys/devices/system/cpu/cpufreq/interactive/max_boost 198 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/max_boost 199 chown system system /sys/devices/system/cpu/cpufreq/interactive/sustain_load 200 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/sustain_load 201 202 # Default Read Ahead value for sdcards 203 write /sys/block/mmcblk0/queue/read_ahead_kb 2048 204 write /sys/block/mmcblk1/queue/read_ahead_kb 2048 205 206 # GPS init 207 write /sys/class/gpio/export 162 208 write /sys/class/gpio/gpio162/value 0 209 write /sys/class/gpio/gpio162/direction out 210 chown gps system /sys/class/gpio/gpio162/value 211 chmod 0664 /sys/class/gpio/gpio162/value 212 mkdir /data/gps 213 chown gps system /data/gps 214 chmod 770 /data/gps 215 chown gps system /dev/ttyHS1 216 chmod 0660 /dev/ttyHS1 217 218 219 # Load WiFi driver 220 221 # BB mapping symbolic name to the logging ttyACM port 222 symlink /dev/ttyACM2 /dev/log_modem 223 224 # Touch 225 chown system system /dev/elan-iap 226 chown system system /proc/ektf_dbg 227 start touch_fw_update 228 229 # Write BT BD_ADDR 230 service btmacreader /system/bin/btmacreader 231 class main 232 oneshot 233 234 service wpa_supplicant /system/bin/wpa_supplicant \ 235 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin 236 # we will start as root and wpa_supplicant will switch to user wifi 237 # after setting up the capabilities required for WEXT 238 # user wifi 239 # group wifi inet keystore 240 class main 241 socket wpa_wlan0 dgram 660 wifi wifi 242 disabled 243 oneshot 244 245 service p2p_supplicant /system/bin/wpa_supplicant \ 246 -iwlan0 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -N \ 247 -ip2p0 -Dnl80211 -c /data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1 248 # we will start as root and wpa_supplicant will switch to user wifi 249 # after setting up the capabilities required for WEXT 250 # user wifi 251 # group wifi inet keystore 252 class main 253 socket wpa_wlan0 dgram 660 wifi wifi 254 disabled 255 oneshot 256 257 service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL 258 class main 259 disabled 260 oneshot 261 262 service dhcpcd_p2p /system/bin/dhcpcd -aABKL 263 class main 264 disabled 265 oneshot 266 267 service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL -f/system/etc/dhcpcd/dhcpcd.conf 268 class main 269 disabled 270 oneshot 271 272 service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL 273 class main 274 disabled 275 oneshot 276 277 service iprenew_wlan0 /system/bin/dhcpcd -n 278 class main 279 disabled 280 oneshot 281 282 service iprenew_p2p /system/bin/dhcpcd -n 283 class main 284 disabled 285 oneshot 286 287 service iprenew_eth0 /system/bin/dhcpcd -n 288 class main 289 disabled 290 oneshot 291 292 #Sensor: load calibration files. 293 service sensors-config /system/bin/sensors-config 294 class main 295 user root 296 oneshot 297 #Sensor load calibration files end 298 299 # virtual sdcard daemon running as media_rw (1023) 300 service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023 301 class late_start 302 303 # bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys 304 service bugreport /system/bin/bugmailer.sh -b /system/media/audio/ui/Dock.ogg -e /system/media/audio/ui/Undock.ogg 305 class main 306 disabled 307 oneshot 308 keycodes 115 114 309 310 # Start GPS daemon 311 on boot 312 service gps-daemon /system/bin/glgps -c /system/etc/gps/gpsconfig.xml 313 user gps 314 group system 315 class late_start 316 317 # Recovery daemon: configure MSC partition 318 service recoveryd /system/bin/recoveryd /dev/block/platform/sdhci-tegra.3/by-name/MSC 319 disabled 320 class main 321 user root 322 group root 323 oneshot 324 325 on property:sys.shutdown.requested=1recovery 326 start recoveryd 327 328 # start tf_daemon service 329 service tf_daemon /system/bin/tf_daemon -storageDir /data/tf -d 330 class main 331 user root 332 group shell 333 334 # may restart due to /data/tf not existing yet 335 on property:init.svc.tf_daemon=restarting 336 mkdir /data/tf 337 338 #Raydium touch setting 339 service rm_ts_service /system/bin/rm_ts_server 340 class main 341 342 # create filesystems if necessary 343 service setup_fs /system/bin/setup_fs \ 344 /dev/block/platform/sdhci-tegra.3/by-name/UDA \ 345 /dev/block/platform/sdhci-tegra.3/by-name/CAC 346 class core 347 user root 348 group root 349 oneshot 350 351 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" 352 class main 353 disabled 354 user root 355 group root 356 oneshot 357 358