Home | History | Annotate | Download | only in tuna
      1 import init.tuna.usb.rc
      2 
      3 on early-init
      4 	export EXTERNAL_STORAGE /storage/sdcard0
      5 	mkdir /storage 0050 system sdcard_r
      6 	mkdir /storage/sdcard0 0000 system system
      7 	# for backwards compatibility
      8 	symlink /storage/sdcard0 /sdcard
      9 	symlink /storage/sdcard0 /mnt/sdcard
     10 
     11 on post-fs-data
     12 	# we will remap this as /storage/sdcard0 with the sdcard fuse tool
     13 	mkdir /data/media 0770 media_rw media_rw
     14 	chown media_rw media_rw /data/media
     15 	mkdir /data/misc/wifi 0770 wifi wifi
     16 	mkdir /data/misc/wifi/sockets 0770 wifi wifi
     17 	mkdir /data/misc/dhcp 0770 dhcp dhcp
     18 	chown dhcp dhcp /data/misc/dhcp
     19 	mkdir /data/smc 0770 drmrpc drmrpc
     20         chown drmrpc drmrpc /data/smc/counter.bin
     21         chown drmrpc drmrpc /data/smc/storage.bin
     22         chown drmrpc drmrpc /data/smc/system.bin
     23 
     24 	# camera calibration
     25 	mkdir /data/misc/camera 0770 media media
     26 	mkdir /data/misc/camera/R5_MVEN003_LD2_ND0_IR0_SH0_FL1_SVEN003_DCCID1044 0770 media media
     27 
     28 	mkdir /data/radio 0775 radio radio
     29 	mkdir /data/radio/log 0775 radio radio
     30 
     31 	setprop vold.post_fs_data_done 1
     32 
     33 # LTE
     34     chown radio system /sys/devices/tuna_otg/usb_sel
     35     chown radio system /sys/devices/tuna_otg/uart_sel
     36     chown radio system /sys/bus/i2c/drivers/fsa9480/4-0025/switch
     37     chmod 0660 /sys/bus/i2c/drivers/fsa9480/4-0025/switch
     38     chmod 0660 /sys/devices/tuna_otg/uart_sel
     39     chmod 0660 /sys/devices/tuna_otg/usb_sel
     40 
     41 on boot
     42 	mount debugfs /sys/kernel/debug /sys/kernel/debug
     43 	chmod 0666 /dev/pvrsrvkm
     44 
     45 # autosuspend root hubs immediatly after attached devices
     46 	write /sys/bus/usb/devices/usb1/power/autosuspend_delay_ms 0
     47 	write /sys/bus/usb/devices/usb2/power/autosuspend_delay_ms 0
     48 
     49 on fs
     50 	mkdir /factory 0775 radio radio
     51 	mount_all /fstab.tuna
     52 	setprop ro.crypto.fuse_sdcard true
     53 
     54 # change permissions for mtd device
     55 	chmod 0660 /dev/mtd/mtd0
     56 	chown media media /dev/mtd/mtd0
     57 
     58 # change permissions for i2c-2 device
     59 	chmod 0660 /dev/i2c-2
     60 	chown media media /dev/i2c-2
     61 
     62 # change permissions for Tiler driver
     63     chmod 0777 /dev/tiler
     64     chmod 0777 /dev/dmm
     65 
     66 # change permissions for ION driver
     67     chmod 0777 /dev/ion
     68 
     69 # We chown/chmod /factory because mount is run as root + defaults
     70 	chown radio radio /factory
     71 	chmod 0775 /factory
     72 
     73 # add symlink for HDCP key
     74         symlink /factory/hdcp.keys /system/vendor/firmware/hdcp.keys
     75 
     76 # nfc
     77     setprop ro.nfc.port "COM4"
     78     chmod 0600 /dev/ttyO3
     79     chown nfc nfc /dev/ttyO3
     80     chmod 0600 /sys/devices/platform/nfc-power/nfc_power
     81     chown nfc nfc /sys/devices/platform/nfc-power/nfc_power
     82 
     83 # permissions for bluetooth.
     84 	setprop ro.bt.bdaddr_path "/factory/bluetooth/bt_addr"
     85 	chown bluetooth bluetooth ro.bt.bdaddr_path
     86 	chown bluetooth bluetooth /dev/ttyO1
     87 	chmod 0600 /dev/ttyO1
     88 	chmod 0660 /sys/class/rfkill/rfkill0/state
     89 	chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
     90 	chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
     91 
     92 # backlight
     93 	chown system system /sys/class/backlight/s6e8aa0/brightness
     94 
     95 # leds
     96 	chown system system /dev/an30259a_leds
     97 
     98 # for GPS
     99     chown root system /sys/class/sec/gps/GPS_PWR_EN/value
    100     chmod 0660 /sys/class/sec/gps/GPS_PWR_EN/value
    101     chown root system /sys/class/sec/gps/GPS_nRST/value
    102     chmod 0660 /sys/class/sec/gps/GPS_nRST/value
    103 
    104 # ril control auto-suspend
    105 	chmod 0660 /sys/bus/usb/devices/usb1/power/control
    106 	chown radio radio /sys/bus/usb/devices/usb1/power/control
    107 
    108 on property:persist.sys.tuna.off_mode=*
    109 	write /d/pm_debug/enable_off_mode ${persist.sys.tuna.off_mode}
    110 
    111 on property:ril.modem.lte.powercontrol=*
    112 	write /sys/bus/usb/devices/1-1/power/control ${ril.modem.lte.powercontrol}
    113 
    114 service fRom /system/bin/fRom \
    115 	-x /data/misc/camera/R5_MVEN003_LD2_ND0_IR0_SH0_FL1_SVEN003_DCCID1044 \
    116 	-d /dev/mtd/mtd0
    117 	user media
    118 	group media
    119 	class late_start
    120 	oneshot
    121 
    122 service hciattach /system/bin/brcm_patchram_plus --enable_hci --no2bytes --enable_lpm \
    123 	--tosleep 50000 --baudrate 3000000 --use_baudrate_for_download --i2s=1,1,0,1 \
    124 	--patchram /vendor/firmware/bcm4330.hcd /dev/ttyO1
    125 	class main
    126 	user bluetooth
    127 	group bluetooth net_bt_admin
    128 	disabled
    129 	oneshot
    130 
    131 service pvrsrvctl /vendor/bin/pvrsrvctl --start --no-module
    132 	class core
    133 	user root
    134 	group root
    135 	oneshot
    136 
    137 # create filesystems if necessary
    138 service setup_fs /system/bin/setup_fs \
    139 		/dev/block/platform/omap/omap_hsmmc.0/by-name/cache \
    140 		/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata
    141         class core
    142         user root
    143         group root
    144         oneshot
    145 
    146 service tf_daemon /system/bin/tf_daemon \
    147         -d -c /vendor/etc/smc_normal_world_android_cfg.ini
    148         class main
    149         user drmrpc
    150         group drmrpc
    151 
    152 service smc_pa_wvdrm /system/bin/smc_pa_ctrl \
    153         -c /vendor/etc/smc_normal_world_android_cfg.ini \
    154         start /vendor/firmware/smc_pa_wvdrm.ift
    155         class core
    156         user drmrpc
    157         group drmrpc
    158         oneshot
    159 
    160 # create virtual SD card at /storage/sdcard0, based on the /data/media directory
    161 # daemon will drop to user/group system/media_rw after initializing
    162 # underlying files in /data/media will be created with user and group media_rw (1023)
    163 service sdcard /system/bin/sdcard /data/media 1023 1023
    164 	class late_start
    165 
    166 service p2p_supplicant /system/bin/wpa_supplicant \
    167 	-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \
    168 	-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1
    169 	#   we will start as root and wpa_supplicant will switch to user wifi
    170 	#   after setting up the capabilities required for WEXT
    171 	#   user wifi
    172 	#   group wifi inet keystore
    173 	class main
    174 	socket wpa_wlan0 dgram 660 wifi wifi
    175 	disabled
    176 	oneshot
    177 
    178 service wpa_supplicant /system/bin/wpa_supplicant \
    179 	-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
    180 	#   we will start as root and wpa_supplicant will switch to user wifi
    181 	#   after setting up the capabilities required for WEXT
    182 	#   user wifi
    183 	#   group wifi inet keystore
    184 	class main
    185 	socket wpa_wlan0 dgram 660 wifi wifi
    186 	disabled
    187 	oneshot
    188 
    189 service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
    190 	class main
    191 	disabled
    192 	oneshot
    193 
    194 service dhcpcd_p2p /system/bin/dhcpcd -aABKL
    195 	class main
    196 	disabled
    197 	oneshot
    198 
    199 service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
    200 	class main
    201 	disabled
    202 	oneshot
    203 
    204 service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
    205 	class main
    206 	disabled
    207 	oneshot
    208 
    209 service iprenew_wlan0 /system/bin/dhcpcd -n
    210 	class main
    211 	disabled
    212 	oneshot
    213 
    214 service iprenew_p2p /system/bin/dhcpcd -n
    215 	class main
    216 	disabled
    217 	oneshot
    218 
    219 service iprenew_bnep0 /system/bin/dhcpcd -n
    220 	class main
    221 	disabled
    222 	oneshot
    223 
    224 # bugreport is triggered by holding down volume down, volume up and power
    225 service bugreport /system/bin/bugmailer.sh -v
    226 	class main
    227 	disabled
    228 	oneshot
    229 	keycodes 114 115 116
    230 
    231 service battery_charger /charger
    232 	class charger
    233