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