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