-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.tenderloin.rc
227 lines (181 loc) · 8.06 KB
/
init.tenderloin.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
on early-fs
mkdir /system
mkdir /data 0771 system system
mkdir /cache 0770 system cache
# Enable LVM
# We need to set LVM_SYSTEM_DIR for lvm to work and it does not work
# with embedded export command until too late, so we exploit
# the fact that there is /bin/sh on the 13th partition that we can use.
mount ext3 /dev/block/mmcblk0p13 /mnt wait noatime barrier=1
# Unfortunately it's dynamically linked so we need to create this
# /lib symlink first and kill it later when no longer needed.
symlink /mnt/lib /lib
# Also stupid lvm binary expects block devices to live in /dev,
# not /dev/block
symlink /dev/block/mmcblk0p14 /dev/mmcblk0p14
exec /mnt/bin/sh -c "LVM_SYSTEM_DIR=/mnt/etc/lvm /mnt/usr/sbin/lvm.static vgchange -ay"
# regular mounts
mount ext4 /dev/store/cm-system /system wait ro barrier=1
exec /system/bin/e2fsck -ay /dev/store/cm-data
exec /system/bin/fsck_msdos.tenderloin -ay /dev/store/media
mount ext4 /dev/store/cm-data /data wait noatime nosuid nodev barrier=1 noauto_da_alloc
mount ext4 /dev/store/cm-cache /cache wait noatime nosuid nodev barrier=1
# remove all the lvm stuff as well as the moboot nextboot instruction
exec /system/xbin/rm -rf /dev/mmcblk0p14 /lib /mnt/moboot.next /var
umount /mnt
on early-init
start serial
on init
# for Invense MPU3050
chmod 0664 /dev/mpu
chmod 0664 /dev/mpuirq
chmod 0664 /dev/timerirq
chown system system /dev/mpu
chown system system /dev/mpuirq
chown system system /dev/timerirq
chown system system /dev/compasssensor
chmod 0666 /dev/compasssensor
chown system system /dev/lightsensor
chmod 0666 /dev/lightsensor
chown system system /dev/gsensor
chmod 0666 /dev/gsensor
chown system system /dev/magsensor
chmod 0666 /dev/magsensor
chown system system /dev/gyrosensor
chmod 0666 /dev/gyrosensor
chown system system /dev/psensor
chmod 0666 /dev/psensor
chmod 0666 /sys/bus/platform/devices/max8903-charger/CEN_N_pin/value
chmod 0666 /sys/bus/platform/devices/max8903-charger/DCM_pin/value
chmod 0666 /sys/bus/platform/devices/max8903-charger/USUS_pin/value
chmod 0666 /sys/bus/platform/devices/max8903-charger/IUSB_pin/value
chmod 0666 /sys/bus/platform/devices/max8903-charger/CHG_D_ISET1_GPIO/value
chmod 0666 /sys/bus/platform/devices/max8903-charger/CHG_D_ISET2_GPIO/value
chmod 0664 /sys/class/leds/button-backlight/brightness
chmod 0664 /sys/class/leds/core_navi_left/brightness
chmod 0664 /sys/class/leds/core_navi_right/brightness
chown system system /sys/class/leds/core_navi_left/brightness
chown system system /sys/class/leds/core_navi_right/brightness
chown system system /sys/devices/platform/msm_sdcc.4/polling
# for emmc (shared with webos at /dev/share/media)
export PHONE_STORAGE /mnt/emmc
mkdir /mnt/emmc 0000 system system
symlink /mnt/emmc /emmc
# for mounting USB storage
mkdir /mnt/usbdisk 0000 system system
# For TS control
chown system system /sys/devices/platform/cy8ctma395/vdd
chown system system /sys/devices/platform/cy8ctma395/xres
chown system system /sys/user_hw/pins/ctp/wake/level
chown system system /dev/i2c-5
# increase per-process file limit to prevent warning
setrlimit 7 10000 10000
on boot
mkdir /data/misc/wifi 0770 system wifi
mkdir /data/misc/wifi/sockets 0770 system wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
mount debugfs /sys/kernel/debug /sys/kernel/debug
# permissions for kgsl
chmod 0666 /dev/kgsl-2d0
chmod 0666 /dev/kgsl-2d1
chmod 0666 /dev/kgsl-3d0
chown system graphics /dev/kgsl-2d0
chown system graphics /dev/kgsl-2d1
chown system graphics /dev/kgsl-3d0
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# fmtx
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/state
chmod 0660 /sys/class/rfkill/rfkill1/state
chown bluetooth bluetooth /dev/rfkill
chmod 0660 /dev/rfkill
chown bluetooth bluetooth /sys/user_hw/pins/bt/reset/level
chown bluetooth bluetooth /sys/user_hw/pins/bt/host_wake/level
# bluetooth MAC address programming
chown bluetooth bluetooth /sys/module/hp_bdaddress/parameters/bdaddress
setprop ro.bt.bdaddr_path /sys/module/hp_bdaddress/parameters/bdaddress
chown audio audio /dev/input/event5
chmod 0660 /dev/input/event5
# Increase readahead buffers on MMC devices
write /sys/block/mmcblk0/bdi/read_ahead_kb 1024
# Enable low memory killer to check file pages
write /sys/module/lowmemorykiller/parameters/minfree 8192,10240,12288,14336,16384,20480
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
# allow libaudio to change idle collapse on open/close
#chown audio audio /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled
#chmod 0660 /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled
#chown audio audio /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled
#chmod 0660 /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled
#chown audio audio /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled
#chmod 0660 /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled
#chown audio audio /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled
#chmod 0660 /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled
# Enable power collapse where always safe
write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
#write /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
#write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
write /sys/module/rpm_resources/enable_low_power/vdd_dig 2
write /sys/module/rpm_resources/enable_low_power/vdd_mem 2
write /sys/module/rpm_resources/enable_low_power/L2_cache 1
write /sys/module/rpm_resources/enable_low_power/pxo 1
# wifi modules
insmod /system/lib/modules/librasdioif.ko
# modules
insmod /system/lib/modules/nls_utf8.ko
insmod /system/lib/modules/cifs.ko
insmod /system/lib/modules/ntfs.ko
insmod /system/lib/modules/tun.ko
service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
-Dwext -iwlan0 -W -c/data/misc/wifi/wpa_supplicant.conf
group wifi inet net_raw
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL wlan0
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
disabled
oneshot
# from tenderloin
# bugreport is triggered by the KEY_BACK and KEY_MENU keycodes
service bugreport /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
disabled
oneshot
keycodes 158 139
service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh
user bluetooth
group qcom_oncrpc bluetooth net_bt_admin system
disabled
oneshot
service tsdriver /system/bin/ts_srv
critical
service dcvs0 /system/bin/dcvs --cpu=0 --slacktime=64
user root
disabled
service dcvs1 /system/bin/dcvs --cpu=1 --slacktime=64
user root
disabled
service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
user root
disabled
service thermald /system/bin/thermald
user root
disabled
service serial /sbin/serial
disabled
oneshot
on property:init.svc.bootanim=stopped
start thermald
start mpdecision
on property:init.svc.bluetoothd=running
write /sys/devices/virtual/bluetooth/hci0/idle_timeout 7000
start abtfilt