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 # cpufreq interactive governor: timer 20ms, min sample 20ms, hispeed 700MHz 45 write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 20000 46 write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 20000 47 write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 700000 48 49 # autosuspend root hubs immediatly after attached devices 50 write /sys/bus/usb/devices/usb1/power/autosuspend_delay_ms 0 51 write /sys/bus/usb/devices/usb2/power/autosuspend_delay_ms 0 52 53 on fs 54 mkdir /factory 0775 radio radio 55 mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/system /system wait ro 56 setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000 57 mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data wait noatime nosuid nodev nomblk_io_submit,errors=panic 58 mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache wait noatime nosuid nodev nomblk_io_submit,errors=panic 59 mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory wait ro 60 setprop ro.crypto.fuse_sdcard true 61 62 # change permissions for mtd device 63 chmod 0660 /dev/mtd/mtd0 64 chown media media /dev/mtd/mtd0 65 66 # change permissions for i2c-2 device 67 chmod 0660 /dev/i2c-2 68 chown media media /dev/i2c-2 69 70 # change permissions for Tiler driver 71 chmod 0777 /dev/tiler 72 chmod 0777 /dev/dmm 73 74 # change permissions for ION driver 75 chmod 0777 /dev/ion 76 77 # We chown/chmod /factory because mount is run as root + defaults 78 chown radio radio /factory 79 chmod 0775 /factory 80 mkdir /data/radio 0775 radio radio 81 mkdir /data/radio/log 0775 radio radio 82 83 # add symlink for HDCP key 84 symlink /factory/hdcp.keys /system/vendor/firmware/hdcp.keys 85 86 # nfc 87 setprop ro.nfc.port "COM4" 88 chmod 0600 /dev/ttyO3 89 chown nfc nfc /dev/ttyO3 90 chmod 0600 /sys/devices/platform/nfc-power/nfc_power 91 chown nfc nfc /sys/devices/platform/nfc-power/nfc_power 92 93 # permissions for bluetooth. 94 setprop ro.bt.bdaddr_path "/factory/bluetooth/bt_addr" 95 chown bluetooth bluetooth ro.bt.bdaddr_path 96 chown bluetooth bluetooth /dev/ttyO1 97 chmod 0600 /dev/ttyO1 98 chmod 0660 /sys/class/rfkill/rfkill0/state 99 chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state 100 chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type 101 102 # backlight 103 chown system system /sys/class/backlight/s6e8aa0/brightness 104 105 # leds 106 chown system system /dev/an30259a_leds 107 108 # for GPS 109 chown root system /sys/class/sec/gps/GPS_PWR_EN/value 110 chmod 0660 /sys/class/sec/gps/GPS_PWR_EN/value 111 chown root system /sys/class/sec/gps/GPS_nRST/value 112 chmod 0660 /sys/class/sec/gps/GPS_nRST/value 113 114 # ril control auto-suspend 115 chmod 0660 /sys/bus/usb/devices/usb1/power/control 116 chown radio radio /sys/bus/usb/devices/usb1/power/control 117 118 on property:persist.sys.tuna.off_mode=* 119 write /d/pm_debug/enable_off_mode $persist.sys.tuna.off_mode 120 121 on property:ril.modem.lte.powercontrol=* 122 write /sys/bus/usb/devices/1-1/power/control $ril.modem.lte.powercontrol 123 124 service fRom /system/bin/fRom \ 125 -x /data/misc/camera/R5_MVEN003_LD2_ND0_IR0_SH0_FL1_SVEN003_DCCID1044 \ 126 -d /dev/mtd/mtd0 127 user media 128 group media 129 class late_start 130 oneshot 131 132 service hciattach /system/bin/brcm_patchram_plus --enable_hci --no2bytes --enable_lpm \ 133 --tosleep 50000 --baudrate 3000000 --use_baudrate_for_download --i2s=1,1,0,1 \ 134 --patchram /vendor/firmware/bcm4330.hcd /dev/ttyO1 135 class main 136 user bluetooth 137 group bluetooth net_bt_admin 138 disabled 139 oneshot 140 141 service pvrsrvinit /vendor/bin/pvrsrvinit 142 class core 143 user root 144 group root 145 oneshot 146 147 # create filesystems if necessary 148 service setup_fs /system/bin/setup_fs \ 149 /dev/block/platform/omap/omap_hsmmc.0/by-name/cache \ 150 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata 151 class core 152 user root 153 group root 154 oneshot 155 156 service tf_daemon /system/bin/tf_daemon \ 157 -d -c /vendor/etc/smc_normal_world_android_cfg.ini 158 class main 159 user drmrpc 160 group drmrpc 161 162 service smc_pa_wvdrm /system/bin/smc_pa_ctrl \ 163 -c /vendor/etc/smc_normal_world_android_cfg.ini \ 164 start /vendor/firmware/smc_pa_wvdrm.ift 165 class core 166 user drmrpc 167 group drmrpc 168 oneshot 169 170 # create virtual SD card at /mnt/sdcard, based on the /data/media directory 171 # daemon will drop to user/group system/media_rw after initializing 172 # underlying files in /data/media will be created with user and group media_rw (1023) 173 service sdcard /system/bin/sdcard /data/media 1023 1023 174 class late_start 175 176 service wpa_supplicant /system/bin/wpa_supplicant \ 177 -Dnl80211 -iwlan0 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin 178 # we will start as root and wpa_supplicant will switch to user wifi 179 # after setting up the capabilities required for WEXT 180 # user wifi 181 # group wifi inet keystore 182 class main 183 socket wpa_wlan0 dgram 660 wifi wifi 184 disabled 185 oneshot 186 187 service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL 188 class main 189 disabled 190 oneshot 191 192 service dhcpcd_p2p /system/bin/dhcpcd -aABKL 193 class main 194 disabled 195 oneshot 196 197 service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL 198 class main 199 disabled 200 oneshot 201 202 service iprenew_wlan0 /system/bin/dhcpcd -n 203 class main 204 disabled 205 oneshot 206 207 service iprenew_p2p /system/bin/dhcpcd -n 208 class main 209 disabled 210 oneshot 211 212 service iprenew_bnep0 /system/bin/dhcpcd -n 213 class main 214 disabled 215 oneshot 216 217 # bugreport is triggered by holding down volume down, volume up and power 218 service bugreport /system/bin/bugmailer.sh -v 219 class main 220 disabled 221 oneshot 222 keycodes 114 115 116 223 224 service battery_charger /charger 225 class charger 226