forked from Evervolv/android_device_htc_bravo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.bravo.rc
194 lines (159 loc) · 6.22 KB
/
init.bravo.rc
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import init.power.rc
import init.bravo.usb.rc
on init
# for backwards compatibility
symlink /sdcard /mnt/sdcard
symlink /sdcard /storage/sdcard0
export LD_SHIM_LIBS "/system/lib/hw/camera.qsd8k.so|libshim_camera.so:/system/lib/hw/camera.qsd8k.so|libshim_skia.so"
on fs
# mount mtd partitions
mount_all ./fstab.bravo
# Wait to ensure SD Card is available, and scanning file system of EXT
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
on post-fs-data
# create dalvik-cache on NAND by creating a symbolic link to /dataint/dalvik-cache
mkdir /dataint/dalvik-cache 0771 root root
mkdir /dataint/dalvik-cache/arm 0771 system system
chown system system /dataint/dalvik-cache
chmod 0771 /dataint/dalvik-cache
ln -s /dataint/dalvik-cache /data/dalvik-cache
ln -s /dataint/dalvik-cache/arm /data/dalvik-cache/arm
chown system system /data/dalvik-cache
chmod 0771 /data/dalvik-cache
on boot
mount debugfs /sys/kernel/debug /sys/kernel/debug
# bluetooth power up/down interface
chown bluetooth bluetooth /dev/ttyHS0
chmod 0600 /dev/ttyHS0
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
chown radio radio /sys/module/pm2/parameters/idle_sleep_mode
# bluetooth MAC address programming
chown bluetooth bluetooth /sys/module/board_bravo/parameters/bdaddr
setprop ro.bt.bdaddr_path /sys/module/board_bravo/parameters/bdaddr
# bluetooth car dock pin
chown system system /sys/class/switch/dock/bt_pin
# Permissions for Liblights.
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/green/blink
chown system system /sys/class/leds/amber/brightness
chown system system /sys/class/leds/amber/blink
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/blue/blink
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
# flashlight
chown system system /sys/class/leds/flashlight/brightness
chmod 667 /sys/class/leds/flashlight/brightness
chown system system /sys/class/leds/flashlight/max_brightness
chmod 667 /sys/class/leds/flashlight/max_brightness
chown system system /sys/class/leds/flashlight/trigger
chmod 667 /sys/class/leds/flashlight/trigger
# enable the GPS
setprop ro.ril.def.agps.mode 2
# performance tweaks for flash
write /sys/block/mtdblock3/bdi/read_ahead_kb 4
write /sys/block/mtdblock4/bdi/read_ahead_kb 4
write /sys/block/mtdblock5/bdi/read_ahead_kb 4
# Wakelock debug
write /sys/module/wakelock/parameters/debug_mask 7
# Fast dormancy settings
setprop ro.ril.fast.dormancy.rule 1
setprop ro.ril.fd.scron.timeout 4
setprop ro.ril.fd.scroff.timeout 3
# KSM
write /sys/kernel/mm/ksm/pages_to_scan 100
write /sys/kernel/mm/ksm/sleep_millisecs 500
write /sys/kernel/mm/ksm/run 1
# The next two settings will be overwritten every time
# the network type switches (wifi <-> umts etc.)
# so we start with wifi values to ensure best
# performance after boot.
write /proc/sys/net/ipv4/tcp_rmem "4096 87380 404480"
write /proc/sys/net/ipv4/tcp_wmem "8192 87380 393216"
setprop net.tcp.buffersize.wifi 8192,87380,404480,8192,87380,404480
setprop net.tcp.buffersize.hsdpa 8192,87380,404480,8192,65536,393216
setprop net.tcp.buffersize.umts 6144,87380,393216,6144,32768,283008
setprop net.tcp.buffersize.edge 4096,32768,220416,4096,32768,110208
setprop net.tcp.buffersize.gprs 4096,16384,32768,4096,11680,16384
# Set Google DNS
setprop net.dns1 8.8.8.8
setprop net.dns2 8.8.4.4
# To prevent out of order acknowledgements from making
# connection tracking to treat them as not belonging to
# the connection they belong to.
# Otherwise, a weird issue happens in which some long
# connections on high-throughput links get dropped when
# an ack packet comes out of order
write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1
chown root system /proc/net/ip_conntrack
# To allow interfaces to get v6 address when tethering is enabled
write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
# compass/accelerometer daemon
#service akmd /system/bin/akmd
# class main
# user compass
# group compass misc input
# seclabel u:r:akmd:s0
# bluetooth
service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
# bluetooth
service iprenew_bt-pan /system/bin/dhcpcd -n
class main
disabled
oneshot
# wifi
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
# wifi
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-e/data/misc/wifi/entropy.bin \
-g@android:wpa_wlan0
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
# wifi
service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
class main
disabled
oneshot
# wifi - Tethering
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
# LMK values
# 6, 12, 26, 48, 64, 96 MB
on property:sys.boot_completed=1
write /sys/module/lowmemorykiller/parameters/minfree 1536,3072,6656,12288,16384,24576
# swap enabler
service swap-enabler /system/bin/sh /system/bin/handle_swap.sh
class late_start
user root
disabled
oneshot
service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh
class late_start
user root
disabled
oneshot
on property:dev.bootcomplete=1
start qcom-post-boot
start swap-enabler
service dspcrashd /system/bin/dspcrashd