summaryrefslogtreecommitdiffstats
path: root/init.tuna.rc
blob: 99ef5103256c64f33090464a72a788bed17f4ef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import init.tuna.usb.rc

on early-init
	export EXTERNAL_STORAGE /mnt/sdcard
	mkdir /mnt/sdcard 0000 system system
	# for backwards compatibility
	symlink /mnt/sdcard /sdcard

on post-fs-data
	# we will remap this as /mnt/sdcard with the sdcard fuse tool
	mkdir /data/media 0775 media_rw media_rw
	chown media_rw media_rw /data/media
	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

	setprop vold.post_fs_data_done 1

# LTE
    chown radio system /sys/devices/platform/switch-sio/usb_sel
    chown radio system /sys/devices/platform/switch-sio/uart_sel

on boot
	mount debugfs /sys/kernel/debug /sys/kernel/debug
	chmod 0666 /dev/pvrsrvkm
	setprop ro.crypto.keyfile.userdata /efs/userdata_footer

on fs
	mkdir /efs 0775 radio radio
	mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/system /system wait ro
	mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data wait noatime nosuid nodev
	mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache wait noatime nosuid nodev
	mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/efs /efs wait noatime nosuid nodev

# change permissions for Tiler driver
    chmod 0777 /dev/tiler
    chmod 0777 /dev/dmm

# We chown/chmod /efs because mount is run as root + defaults
	chown radio radio /efs
	chmod 0775 /efs

# nfc
    setprop ro.nfc.port "COM4"
    chmod 0600 /dev/ttyO3
    chown nfc nfc /dev/ttyO3
    chmod 0600 /sys/devices/platform/nfc-power/nfc_power
    chown nfc nfc /sys/devices/platform/nfc-power/nfc_power

# permissions for bluetooth.
	setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr"
	chown bluetooth bluetooth ro.bt.bdaddr_path
	chown bluetooth bluetooth /dev/ttyO1
	chmod 0600 /dev/ttyO1
	chmod 0660 /sys/class/rfkill/rfkill0/state
	chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
	chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type

# backlight
	chown system system /sys/class/backlight/s6e8aa0/brightness

# for GPS
    chown root system /sys/class/sec/gps/GPS_PWR_EN/value
    chmod 0660 /sys/class/sec/gps/GPS_PWR_EN/value
    chown root system /sys/class/sec/gps/GPS_nRST/value
    chmod 0660 /sys/class/sec/gps/GPS_nRST/value

service hciattach /system/bin/brcm_patchram_plus --enable_hci --no2bytes \
	--tosleep 50000 --baudrate 3000000 --use_baudrate_for_download --i2s=1,1,0,1 \
	--patchram /vendor/firmware/bcm4330.hcd /dev/ttyO1
	class main
	user bluetooth
	group bluetooth net_bt_admin
	disabled
	oneshot

service pvrsrvinit /vendor/bin/pvrsrvinit
	class core
	user root
	group root
	oneshot

# create filesystems if necessary
service setup_fs /system/bin/setup_fs \
		/dev/block/platform/omap/omap_hsmmc.0/by-name/cache \
		/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata \
		/dev/block/platform/omap/omap_hsmmc.0/by-name/efs
        class core
        user root
        group root
        oneshot

# create virtual SD card at /mnt/sdcard, based on the /data/media directory
# daemon will drop to user/group system/media_rw after initializing
# underlying files in /data/media will be created with user and group media_rw (1023)
service sdcard /system/bin/sdcard /data/media 1023 1023
	class late_start

service wpa_supplicant /system/bin/wpa_supplicant \
	-Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
	#   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 -ABKL
	class main
	disabled
	oneshot

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

# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/bugmailer.sh -v
	class main
	disabled
	oneshot
	keycodes 114 115 116