普通文本  |  444行  |  18.98 KB

import init.grouper.usb.rc

on early-init
    mount debugfs debugfs /sys/kernel/debug

on init
    # See storage config details at http://source.android.com/tech/storage/
    mkdir /mnt/shell/emulated 0700 shell shell
    mkdir /storage/emulated 0555 root root

    export EXTERNAL_STORAGE /storage/emulated/legacy
    export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
    export EMULATED_STORAGE_TARGET /storage/emulated

    # Support legacy paths
    symlink /storage/emulated/legacy /sdcard
    symlink /storage/emulated/legacy /mnt/sdcard
    symlink /storage/emulated/legacy /storage/sdcard0
    symlink /mnt/shell/emulated/0 /storage/emulated/legacy

on early-boot
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
    restorecon /sys/devices/system/cpu
    restorecon /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    restorecon /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
    restorecon /sys/devices/system/cpu/cpufreq/interactive/boost
    restorecon /sys/devices/system/cpu/cpufreq/interactive/boost_factor
    restorecon /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
    restorecon /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
    restorecon /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
    restorecon /sys/devices/system/cpu/cpufreq/interactive/input_boost
    restorecon /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
    restorecon /sys/devices/system/cpu/cpufreq/interactive/max_boost
    restorecon /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
    restorecon /sys/devices/system/cpu/cpufreq/interactive/sustain_load
    restorecon /sys/devices/system/cpu/cpufreq/interactive/timer_rate
    restorecon /sys/devices/tegradc.0/smartdimmer/aggressiveness
    restorecon /sys/devices/tegradc.0/smartdimmer/enable

on fs
    setprop ro.crypto.umount_sd false
    mount_all /fstab.grouper
    restorecon /dev/block/platform/sdhci-tegra.3/by-name/PER

on post-fs-data
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/dhcp 0770 dhcp dhcp
    chown dhcp dhcp /data/misc/dhcp

    mkdir /data/media 0770 media_rw media_rw

    # change back to bluetooth from system
    chown bluetooth net_bt_stack /data/misc/bluetooth

    # sensors-config
    mkdir /data/sensors 751 system system
    mkdir /data/lightsensor 751 system system
    mkdir /data/calibration
    mkdir /data/amit

    # Set indication (checked by vold) that we have finished this action
    setprop vold.post_fs_data_done 1

on boot

# bluetooth
    # UART device
    chmod 0660 /dev/ttyHS2
    chown bluetooth net_bt_stack /dev/ttyHS2

    # power up/down interface
    chmod 0660 /sys/class/rfkill/rfkill0/state
    chmod 0660 /sys/class/rfkill/rfkill0/type
    chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
    chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
    restorecon /sys/devices/platform/bcm4330_rfkill/rfkill/rfkill0/state
    restorecon /sys/devices/platform/bcm4330_rfkill/rfkill/rfkill0/type

    # bluetooth MAC address programming
    chown bluetooth net_bt_stack ro.bt.bdaddr_path
    chown bluetooth net_bt_stack /system/etc/bluetooth
    chown bluetooth net_bt_stack /data/misc/bluetooth
    setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr"

    # bluetooth LPM
    chmod 0220 /proc/bluetooth/sleep/lpm
    chmod 0220 /proc/bluetooth/sleep/btwrite
    chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
    chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite

# NFC
    setprop ro.nfc.port "I2C"
    chmod 0660 /dev/pn544
    chown nfc nfc /dev/pn544

# backlight
    chown system system /sys/class/backlight/pwm-backlight/brightness

# didim
    chown system system /sys/class/graphics/fb0/device/smartdimmer/enable
    chown system system /sys/class/graphics/fb0/device/smartdimmer/aggressiveness

# power
    chown system system /sys/kernel/tegra_cap/core_cap_level
    chown system system /sys/kernel/tegra_cap/core_cap_state
    chown system system /sys/module/cpu_tegra/parameters/cpu_user_cap

# Sensor
# iio
    chown system system /dev/iio:device0
    chown system system /sys/bus/iio/devices/trigger0/name
    chown system system /sys/bus/iio/devices/iio:device0/accl_enable
    chown system system /sys/bus/iio/devices/iio:device0/accl_matrix
    chown system system /sys/bus/iio/devices/iio:device0/buffer/length
    chown system system /sys/bus/iio/devices/iio:device0/buffer/enable
    chown system system /sys/bus/iio/devices/iio:device0/compass_enable
    chown system system /sys/bus/iio/devices/iio:device0/compass_matrix
    chown system system /sys/bus/iio/devices/iio:device0/dmp_on
    chown system system /sys/bus/iio/devices/iio:device0/dmp_int_on
    chown system system /sys/bus/iio/devices/iio:device0/gyro_enable
    chown system system /sys/bus/iio/devices/iio:device0/gyro_matrix
    chown system system /sys/bus/iio/devices/iio:device0/in_accel_scale
    chown system system /sys/bus/iio/devices/iio:device0/in_anglvel_scale
    chown system system /sys/bus/iio/devices/iio:device0/in_magn_scale
    chown system system /sys/bus/iio/devices/iio:device0/key
    chown system system /sys/bus/iio/devices/iio:device0/power_state
    chown system system /sys/bus/iio/devices/iio:device0/sampling_frequency
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en
    chown system system /sys/bus/iio/devices/iio:device0/temperature
    chown system system /sys/bus/iio/devices/iio:device0/trigger/current_trigger

    # new in MA 5.1.5
    chown system system /sys/bus/iio/devices/iio:device0/secondary_name
    chown system system /sys/bus/iio/devices/iio:device0/dmp_firmware
    chown system system /sys/bus/iio/devices/iio:device0/firmware_loaded
    chown system system /sys/bus/iio/devices/iio:device0/dmp_event_int_on
    chown system system /sys/bus/iio/devices/iio:device0/dmp_output_rate
    chown system system /sys/bus/iio/devices/iio:device0/in_accel_x_offset
    chown system system /sys/bus/iio/devices/iio:device0/in_accel_y_offset
    chown system system /sys/bus/iio/devices/iio:device0/in_accel_z_offset
    chown system system /sys/bus/iio/devices/iio:device0/gyro_fsr
    ## LPQ
    chown system system /sys/bus/iio/devices/iio:device0/quaternion_on
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_z_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_y_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_x_en
    chown system system /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_r_en
    ## Screen orientation
    chown system system /sys/bus/iio/devices/iio:device0/event_display_orientation
    chown system system /sys/bus/iio/devices/iio:device0/display_orientation_on
    ## SMD
    chown system system /sys/bus/iio/devices/iio:device0/event_smd
    chown system system /sys/bus/iio/devices/iio:device0/smd_enable
    chown system system /sys/bus/iio/devices/iio:device0/smd_threshold
    chown system system /sys/bus/iio/devices/iio:device0/smd_delay_threshold
    chown system system /sys/bus/iio/devices/iio:device0/smd_delay_threshold2
    ## AMI compass sensor
    chown system system /dev/iio:device1
    chown system system /sys/bus/iio/devices/trigger1/name
    chown system system /sys/bus/iio/devices/iio:device1/buffer/length
    chown system system /sys/bus/iio/devices/iio:device1/buffer/enable
    chown system system /sys/bus/iio/devices/iio:device1/compass_enable
    chown system system /sys/bus/iio/devices/iio:device1/compass_matrix
    chown system system /sys/bus/iio/devices/iio:device1/in_magn_scale
    chown system system /sys/bus/iio/devices/iio:device1/power_state
    chown system system /sys/bus/iio/devices/iio:device1/sampling_frequency
    chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en
    chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en
    chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en
    chown system system /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en
    chown system system /sys/bus/iio/devices/iio:device1/trigger/current_trigger

    chmod 600 /dev/iio:device0
    chmod 600 /sys/bus/iio/devices/trigger0/name
    chmod 600 /sys/bus/iio/devices/iio:device0/accl_enable
    chmod 600 /sys/bus/iio/devices/iio:device0/accl_matrix
    chmod 600 /sys/bus/iio/devices/iio:device0/buffer/length
    chmod 600 /sys/bus/iio/devices/iio:device0/buffer/enable
    chmod 600 /sys/bus/iio/devices/iio:device0/compass_enable
    chmod 600 /sys/bus/iio/devices/iio:device0/compass_matrix
    chmod 600 /sys/bus/iio/devices/iio:device0/dmp_on
    chmod 600 /sys/bus/iio/devices/iio:device0/dmp_int_on
    chmod 600 /sys/bus/iio/devices/iio:device0/gyro_enable
    chmod 600 /sys/bus/iio/devices/iio:device0/gyro_matrix
    chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_scale
    chmod 600 /sys/bus/iio/devices/iio:device0/in_anglvel_scale
    chmod 600 /sys/bus/iio/devices/iio:device0/in_magn_scale
    chmod 600 /sys/bus/iio/devices/iio:device0/key
    chmod 600 /sys/bus/iio/devices/iio:device0/power_state
    chmod 600 /sys/bus/iio/devices/iio:device0/sampling_frequency
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_x_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_y_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_anglvel_z_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_x_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_y_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_magn_z_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en
    chmod 600 /sys/bus/iio/devices/iio:device0/temperature
    chmod 600 /sys/bus/iio/devices/iio:device0/trigger/current_trigger
    # new in MA 5.1.5
    chmod 600 /sys/bus/iio/devices/iio:device0/secondary_name
    chmod 600 /sys/bus/iio/devices/iio:device0/dmp_firmware
    chmod 600 /sys/bus/iio/devices/iio:device0/firmware_loaded
    chmod 600 /sys/bus/iio/devices/iio:device0/dmp_event_int_on
    chmod 600 /sys/bus/iio/devices/iio:device0/dmp_output_rate
    chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_x_offset
    chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_y_offset
    chmod 600 /sys/bus/iio/devices/iio:device0/in_accel_z_offset
    chmod 600 /sys/bus/iio/devices/iio:device0/gyro_fsr
    ## LPQ
    chmod 600 /sys/bus/iio/devices/iio:device0/quaternion_on
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_z_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_y_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_x_en
    chmod 600 /sys/bus/iio/devices/iio:device0/scan_elements/in_quaternion_r_en
    ## Screen orientation
    chmod 600 /sys/bus/iio/devices/iio:device0/event_display_orientation
    chmod 600 /sys/bus/iio/devices/iio:device0/display_orientation_on
    ## SMD
    chmod 600 /sys/bus/iio/devices/iio:device0/event_smd
    chmod 600 /sys/bus/iio/devices/iio:device0/smd_enable
    chmod 600 /sys/bus/iio/devices/iio:device0/smd_threshold
    chmod 600 /sys/bus/iio/devices/iio:device0/smd_delay_threshold
    chmod 600 /sys/bus/iio/devices/iio:device0/smd_delay_threshold2
    ## AMI compass sensor
    chmod 600 /dev/iio:device1
    chmod 600 /sys/bus/iio/devices/trigger1/name
    chmod 600 /sys/bus/iio/devices/iio:device1/buffer/length
    chmod 600 /sys/bus/iio/devices/iio:device1/buffer/enable
    chmod 600 /sys/bus/iio/devices/iio:device1/compass_enable
    chmod 600 /sys/bus/iio/devices/iio:device1/compass_matrix
    chmod 600 /sys/bus/iio/devices/iio:device1/in_magn_scale
    chmod 600 /sys/bus/iio/devices/iio:device1/power_state
    chmod 600 /sys/bus/iio/devices/iio:device1/sampling_frequency
    chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_x_en
    chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_y_en
    chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_magn_z_en
    chmod 600 /sys/bus/iio/devices/iio:device1/scan_elements/in_timestamp_en
    chmod 600 /sys/bus/iio/devices/iio:device1/trigger/current_trigger

# Power management settings
    write /sys/module/cpu_tegra3/parameters/no_lp 0
    #write /sys/module/tegra3_emc/parameters/emc_enable 0
    #write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1000000
    write /sys/devices/system/cpu/cpufreq/interactive/boost_factor 2
    write /sys/devices/system/cpu/cpufreq/interactive/input_boost 1
    write /sys/devices/system/cpu/cpufreq/interactive/sustain_load 80
    write /sys/module/cpu_tegra3/parameters/auto_hotplug 1
    #write /sys/module/cpuidle_t3/parameters/lp2_0_in_idle 0
    write /sys/module/cpuidle/parameters/lp2_in_idle 0

# Interactive governor settings
    chown system system /sys/devices/system/cpu/cpufreq/interactive/boost_factor
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost_factor
    chown system system /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
    chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
    chown system system /sys/devices/system/cpu/cpufreq/interactive/max_boost
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/max_boost
    chown system system /sys/devices/system/cpu/cpufreq/interactive/sustain_load
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/sustain_load

# Default Read Ahead value for sdcards
    write /sys/block/mmcblk0/queue/read_ahead_kb 2048
    write /sys/block/mmcblk1/queue/read_ahead_kb 2048

# GPS init
    write /sys/class/gpio/export 162
    write /sys/class/gpio/gpio162/value 0
    write /sys/class/gpio/gpio162/direction out
    chown gps system /sys/class/gpio/gpio162/value
    chmod 0664 /sys/class/gpio/gpio162/value
    mkdir /data/gps
    chown gps system /data/gps
    chmod 770 /data/gps
    chown gps system /dev/ttyHS1
    chmod 0660 /dev/ttyHS1


# Load WiFi driver

# BB mapping symbolic name to the logging ttyACM port
    symlink /dev/ttyACM2 /dev/log_modem

# Touch
    chown system system /dev/elan-iap
    chown system system /proc/ektf_dbg  
    restorecon /sys/bus/i2c/drivers/elan-ktf3k/1-0010/update_fw
    start touch_fw_update

service wpa_supplicant /system/bin/wpa_supplicant \
    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    -e/data/misc/wifi/entropy.bin
    #   we will start as root and wpa_supplicant will switch to user wifi
    #   after setting up the capabilities required for WEXT
    #   user wifi
    #   group wifi inet keystore
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

service p2p_supplicant /system/bin/wpa_supplicant \
    -iwlan0 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf \
    -I/system/etc/wifi/wpa_supplicant_overlay.conf -N \
    -ip2p0 -Dnl80211 -c /data/misc/wifi/p2p_supplicant.conf \
    -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1
#   we will start as root and wpa_supplicant will switch to user wifi
#   after setting up the capabilities required for WEXT
#   user wifi
#   group wifi inet keystore
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
    class main
    disabled
    oneshot

service dhcpcd_p2p /system/bin/dhcpcd -aABKL
    class main
    disabled
    oneshot

service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL -f/system/etc/dhcpcd/dhcpcd.conf
    class main
    disabled
    oneshot

service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
    class main
    disabled
    oneshot

service iprenew_wlan0 /system/bin/dhcpcd -n
    class main
    disabled
    oneshot

service iprenew_p2p /system/bin/dhcpcd -n
    class main
    disabled
    oneshot

service iprenew_eth0 /system/bin/dhcpcd -n
    class main
    disabled
    oneshot

service iprenew_bt-pan /system/bin/dhcpcd -n
    class main
    disabled
    oneshot

#Sensor: load calibration files.
    service sensors-config /system/bin/sensors-config
    class main
    user root
    oneshot
#Sensor load calibration files end

# virtual sdcard daemon running as media_rw (1023)
service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
    class late_start

# bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys
service bugreport /system/bin/dumpstate -d -p -B \
        -o /data/data/com.android.shell/files/bugreports/bugreport \
        -b /system/media/audio/ui/Dock.ogg -e /system/media/audio/ui/Undock.ogg
    class main
    disabled
    oneshot
    keycodes 115 114

# Start GPS daemon
  on boot
  service gps-daemon /system/bin/glgps -c /system/etc/gps/gpsconfig.xml
  user gps
  group system
  class late_start

# Recovery daemon: configure MSC partition
service recoveryd /system/bin/recoveryd /dev/block/platform/sdhci-tegra.3/by-name/MSC
    disabled
    class main
    user root
    group root
    oneshot

on property:sys.shutdown.requested=1recovery
    start recoveryd

# start tf_daemon service
service tf_daemon /system/bin/tf_daemon -storageDir /data/tf -d
    class main
    user root
    group shell

# may restart due to /data/tf not existing yet
on property:init.svc.tf_daemon=restarting
    mkdir /data/tf

#Raydium touch setting
service rm_ts_service    /system/bin/rm_ts_server
    class main

# create filesystems if necessary
service setup_fs /system/bin/setup_fs \
        /dev/block/platform/sdhci-tegra.3/by-name/UDA \
        /dev/block/platform/sdhci-tegra.3/by-name/CAC
    class core
    user root
    group root
    oneshot

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"
    class main
    disabled
    user root
    group root
    oneshot