Home | History | Annotate | Download | only in manta
      1 import init.manta.usb.rc
      2 
      3 on init
      4     start watchdogd
      5 
      6     # See storage config details at http://source.android.com/tech/storage/
      7     mkdir /mnt/shell/emulated 0700 shell shell
      8     mkdir /storage/emulated 0555 root root
      9 
     10     export EXTERNAL_STORAGE /storage/emulated/legacy
     11     export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
     12     export EMULATED_STORAGE_TARGET /storage/emulated
     13 
     14     # Support legacy paths
     15     symlink /storage/emulated/legacy /sdcard
     16     symlink /storage/emulated/legacy /mnt/sdcard
     17     symlink /storage/emulated/legacy /storage/sdcard0
     18     symlink /mnt/shell/emulated/0 /storage/emulated/legacy
     19 
     20 # KSM
     21     write /sys/kernel/mm/ksm/pages_to_scan 100
     22     write /sys/kernel/mm/ksm/sleep_millisecs 500
     23 #    write /sys/kernel/mm/ksm/run 1
     24 
     25 on post-fs-data
     26     mkdir /data/media 0770 media_rw media_rw
     27 
     28     setprop vold.post_fs_data_done 1
     29     mkdir /data/misc/wifi 0770 wifi wifi
     30     mkdir /data/misc/wifi/sockets 0770 wifi wifi
     31     mkdir /data/misc/dhcp 0770 dhcp dhcp
     32     chown dhcp dhcp /data/misc/dhcp
     33 
     34 # permissions for bluetooth.
     35 	setprop ro.bt.bdaddr_path "/factory/bluetooth/bt_addr"
     36 	chown bluetooth net_bt_stack ro.bt.bdaddr_path
     37 	chown bluetooth net_bt_stack /dev/ttySAC0
     38 	chmod 0660 /dev/ttySAC0
     39 	chmod 0660 /sys/class/rfkill/rfkill0/state
     40 	chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
     41 	chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
     42 	restorecon /sys/class/rfkill/rfkill0/state
     43 	restorecon /sys/class/rfkill/rfkill0/type
     44 
     45 on boot
     46     # override init.rc to keep plenty of large order chunks around
     47     # to improve allocation times
     48     write /proc/sys/vm/min_free_order_shift 1
     49 
     50     mount debugfs /sys/kernel/debug /sys/kernel/debug
     51     setprop ro.radio.noril yes
     52 
     53     # Set up kernel tracing, but disable it by default
     54     chmod 0222 /sys/kernel/debug/tracing/trace_marker
     55     write /sys/kernel/debug/tracing/tracing_on 0
     56 
     57     chmod 0444 /sys/kernel/debug/smb347-regs
     58 
     59 # Set Mali power policy as Coarse demand
     60     write /sys/devices/platform/mali.0/power_policy coarse_demand
     61 
     62 on fs
     63     mkdir /factory 0775 radio radio
     64 
     65     mount_all /fstab.manta
     66     mount ext4 /dev/block/platform/dw_mmc.0/by-name/efs /factory rw remount
     67     restorecon /factory
     68     restorecon /factory/bluetooth
     69     restorecon /factory/bluetooth/bt_addr
     70     restorecon /factory/FactoryApp
     71     restorecon /factory/FactoryApp/
     72     restorecon /factory/FactoryApp/baro_delta
     73     restorecon /factory/FactoryApp/factorymode
     74     restorecon /factory/FactoryApp/fdata
     75     restorecon /factory/FactoryApp/hist_nv
     76     restorecon /factory/FactoryApp/hw_ver
     77     restorecon /factory/FactoryApp/keystr
     78     restorecon /factory/FactoryApp/reset_flag
     79     restorecon /factory/FactoryApp/test_nv
     80     restorecon /factory/hdcp2.keys
     81     restorecon /factory/wv.keys
     82     restorecon /factory/wifi
     83     restorecon /factory/wifi/
     84     mount ext4 /dev/block/platform/dw_mmc.0/by-name/efs /factory ro remount
     85     setprop ro.crypto.fuse_sdcard true
     86 
     87 # Permissions for backlight
     88     chmod 0660 /sys/class/backlight/pwm-backlight.0/brightness
     89     chown system system /sys/class/backlight/pwm-backlight.0/brightness
     90 
     91 # create data/gps for GPS daemon
     92     chown root system /sys/class/gps/bcm475x/GPS_PWR_EN/value
     93     chmod 0664 /sys/class/gps/bcm475x/GPS_PWR_EN/value
     94     chown root system /sys/class/gps/bcm475x/GPS_nRST/value
     95     chmod 0664 /sys/class/gps/bcm475x/GPS_nRST/value
     96     mkdir /data/gps 771 system system
     97     chown system system /data/gps
     98 
     99 # NFC: create data/nfc for nv storage
    100     mkdir /data/nfc 770 nfc nfc
    101     mkdir /data/nfc/param 770 nfc nfc
    102 
    103 # audio: permissions for voice processing
    104     # global switch for voice processing effects
    105     chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/voice_processing
    106     chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/voice_processing
    107     # voice processing chip sleep
    108     chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/sleep
    109     chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/sleep
    110     # voice processing usecase preset
    111     chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/preset
    112     chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/preset
    113     # voice processing noise suppression level
    114     chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/tx_ns_level
    115     chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/tx_ns_level
    116     # voice processing AGC enable (TX)
    117     chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/tx_agc_enable
    118     chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/tx_agc_enable
    119     # voice processing AEC enable
    120     chown root audio /sys/class/i2c-dev/i2c-4/device/4-003e/aec_enable
    121     chmod 0660 /sys/class/i2c-dev/i2c-4/device/4-003e/aec_enable
    122 
    123 # virtual sdcard daemon running as media_rw (1023)
    124 service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
    125     class late_start
    126 
    127 service p2p_supplicant /system/bin/wpa_supplicant \
    128     -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    129     -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    130     -O/data/misc/wifi/sockets \
    131     -puse_multi_chan_concurrent=1 -N -ip2p0 -Dnl80211 \
    132     -c/data/misc/wifi/p2p_supplicant.conf \
    133     -I/system/etc/wifi/p2p_supplicant_overlay.conf \
    134     -puse_p2p_group_interface=1use_multi_chan_concurrent=1 \
    135     -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
    136     #   we will start as root and wpa_supplicant will switch to user wifi
    137     #   after setting up the capabilities required for WEXT
    138     #   user wifi
    139     #   group wifi inet keystore
    140     class main
    141     socket wpa_wlan0 dgram 660 wifi wifi
    142     disabled
    143     oneshot
    144 
    145 service wpa_supplicant /system/bin/wpa_supplicant \
    146     -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    147     -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    148     -O/data/misc/wifi/sockets \
    149     -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
    150     #   we will start as root and wpa_supplicant will switch to user wifi
    151     #   after setting up the capabilities required for WEXT
    152     #   user wifi
    153     #   group wifi inet keystore
    154     class main
    155     socket wpa_wlan0 dgram 660 wifi wifi
    156     disabled
    157     oneshot
    158 
    159 service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
    160     class main
    161     disabled
    162     oneshot
    163 
    164 service dhcpcd_p2p /system/bin/dhcpcd -aABKL
    165     class main
    166     disabled
    167     oneshot
    168 
    169 service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL
    170     class main
    171     disabled
    172     oneshot
    173 
    174 service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
    175     class main
    176     disabled
    177     oneshot
    178 
    179 service iprenew_wlan0 /system/bin/dhcpcd -n
    180     class main
    181     disabled
    182     oneshot
    183 
    184 service iprenew_p2p /system/bin/dhcpcd -n
    185     class main
    186     disabled
    187     oneshot
    188 
    189 service iprenew_eth0 /system/bin/dhcpcd -n
    190     class main
    191     disabled
    192     oneshot
    193 
    194 service iprenew_bt-pan /system/bin/dhcpcd -n
    195     class main
    196     disabled
    197     oneshot
    198 
    199 service battery_charger /charger
    200     class charger
    201 
    202 # Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
    203 service watchdogd /sbin/watchdogd 10 20
    204     class core
    205     seclabel u:r:watchdogd:s0
    206 
    207 service gpsd /system/vendor/bin/gpsd -c /system/vendor/etc/gps.xml
    208     class main
    209     socket gps seqpacket 0660 gps system
    210     user gps
    211     group system inet
    212 
    213 # MobiCore startup
    214 service mobicore /system/bin/mcDriverDaemon -r /system/vendor/secapp/020a0000000000000000000000000000.drbin
    215     setenv MC_REGISTRY_PATH /system/vendor/secapp
    216     user drmrpc
    217     group drmrpc
    218     class main
    219 
    220 # on userdebug and eng builds, enable kgdb on the serial console
    221 on property:ro.debuggable=1
    222     write /sys/module/kgdboc/parameters/kgdboc ttyFIQ2
    223     write /sys/module/fiq_debugger/parameters/kgdb_enable 1
    224 
    225 # bugreport is triggered by holding down volume down, volume up and power
    226 service bugreport /system/bin/dumpstate -d -p -B \
    227         -o /data/data/com.android.shell/files/bugreports/bugreport
    228     class main
    229     disabled
    230     oneshot
    231     keycodes 114 115 116
    232