blob: 73e7aaec3ebdddf55373eb95886d7e4ef7d84c1e [file] [log] [blame]
Steve Kondika89711a2010-07-07 09:06:13 -04001# CyanogenMod Extras
Koushik Dutta5af62eb2013-07-27 19:52:40 -07002import /init.superuser.rc
Steve Kondika89711a2010-07-07 09:06:13 -04003
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +01004on init
5 export ANDROID_CACHE /cache
6 export TERMINFO /system/etc/terminfo
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +01007
Steve Kondik28dbc8b2015-09-07 23:23:10 -07008 # Set up the BFQIO hierarchy
9 chmod 0755 /sys/fs/cgroup
10 mkdir /sys/fs/cgroup/bfqio 0755 root system
11 mount cgroup none /sys/fs/cgroup/bfqio bfqio,xattr
12 write /sys/fs/cgroup/bfqio/bfqio.ioprio_class 2
13 write /sys/fs/cgroup/bfqio/bfqio.ioprio 4
14 write /sys/fs/cgroup/bfqio/bfqio.weight 1000
15 chown root system /sys/fs/cgroup/bfqio/tasks
16 chmod 0666 /sys/fs/cgroup/bfqio/tasks
17
18 # Realtime audio class
19 mkdir /sys/fs/cgroup/bfqio/rt-audio 0755 root system
20 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.ioprio_class 1
21 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.ioprio 4
22 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.weight 1000
23 chown media system /sys/fs/cgroup/bfqio/rt-audio/tasks
24 chmod 0664 /sys/fs/cgroup/bfqio/rt-audio/tasks
25
26 # Realtime display class
27 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
Steve Kondikc815f702015-09-16 15:08:48 -070028 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
Steve Kondik28dbc8b2015-09-07 23:23:10 -070029 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
30 write /sys/fs/cgroup/bfqio/rt-display/bfqio.weight 1000
31 chown system graphics /sys/fs/cgroup/bfqio/rt-display/tasks
32 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
33
34 # Display class
35 mkdir /sys/fs/cgroup/bfqio/display 0755 root system
36 write /sys/fs/cgroup/bfqio/display/bfqio.ioprio_class 2
37 write /sys/fs/cgroup/bfqio/display/bfqio.ioprio 0
38 write /sys/fs/cgroup/bfqio/display/bfqio.weight 1000
39 chown root system /sys/fs/cgroup/bfqio/display/tasks
40 chmod 0666 /sys/fs/cgroup/bfqio/display/tasks
41
42 # Hipri class
43 mkdir /sys/fs/cgroup/bfqio/hipri 0755 root system
44 write /sys/fs/cgroup/bfqio/hipri/bfqio.ioprio_class 2
Steve Kondikc815f702015-09-16 15:08:48 -070045 write /sys/fs/cgroup/bfqio/hipri/bfqio.ioprio 2
Steve Kondik28dbc8b2015-09-07 23:23:10 -070046 write /sys/fs/cgroup/bfqio/hipri/bfqio.weight 1000
47 chown root system /sys/fs/cgroup/bfqio/hipri/tasks
48 chmod 0666 /sys/fs/cgroup/bfqio/hipri/tasks
49
50 # Background class
51 mkdir /sys/fs/cgroup/bfqio/bg 0755 root system
52 write /sys/fs/cgroup/bfqio/bg/bfqio.ioprio_class 2
53 write /sys/fs/cgroup/bfqio/bg/bfqio.ioprio 7
54 write /sys/fs/cgroup/bfqio/bg/bfqio.weight 1000
55 chown root system /sys/fs/cgroup/bfqio/bg/tasks
56 chmod 0666 /sys/fs/cgroup/bfqio/bg/tasks
57
58 # Idle
59 mkdir /sys/fs/cgroup/bfqio/idle 0755 root system
60 write /sys/fs/cgroup/bfqio/idle/bfqio.ioprio_class 3
61 write /sys/fs/cgroup/bfqio/idle/bfqio.ioprio 0
62 write /sys/fs/cgroup/bfqio/idle/bfqio.weight 1000
63 chown root system /sys/fs/cgroup/bfqio/idle/tasks
64 chmod 0666 /sys/fs/cgroup/bfqio/idle/tasks
65
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010066on post-fs-data
Chirayu Desaice885402013-05-12 16:28:01 +053067 mkdir /data/.ssh 0750 root shell
Lin Mad32b7412015-05-31 15:55:38 -070068 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010069
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000070 # Run sysinit
71 start sysinit
72
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010073on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020074 # interactive governor
75 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010076 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010077 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
78 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020079 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010080 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020081 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010082 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010083 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
84 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020085 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010086 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020087 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010088 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020089 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010090 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020091 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010092 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020093 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010094 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020095 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010096 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020097 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010098 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080099 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100100 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +0100101 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
102 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +0800103 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100104 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +0800105 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +0100106 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondik9d1a8612014-01-15 01:44:07 +0800107
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200108 # ondemand governor
109 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100110 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200111 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +0100112 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200113 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +0100114 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200115 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +0100116 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200117 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +0100118 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200119 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +0100120 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200121 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +0100122 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200123 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +0100124 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200125 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +0100126 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -0700127 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +0100128 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -0700129 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +0100130 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -0700131 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +0100132 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -0700133 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100134 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700135 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100136 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700137 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100138 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200139
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100140 chown system system /sys/block/mmcblk0/queue/scheduler
141 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700142 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100143
Arne Coucheron08297ed2015-04-03 02:01:36 +0200144 chown system system /dev/cpuctl/cpu.notify_on_migrate
145 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700146
Steve Kondik4462dfa2015-09-18 04:27:35 -0700147 # LiveDisplay sysfs
148 chown system system /sys/devices/virtual/graphics/fb0/aco
149 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
150 chown system system /sys/devices/virtual/graphics/fb0/cabc
151 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
152 chown system system /sys/devices/virtual/graphics/fb0/rgb
153 chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
154 chown system system /sys/devices/virtual/graphics/fb0/sre
155 chmod 0660 /sys/devices/virtual/graphics/fb0/sre
156
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200157 # Define TCP delayed ack settings for WiFi & LTE
158 chown system system /sys/kernel/ipv4/tcp_delack_seg
159 chown system system /sys/kernel/ipv4/tcp_use_userconfig
160 setprop net.tcp.delack.default 1
161 setprop net.tcp.delack.wifi 20
162 setprop net.tcp.delack.lte 8
163 setprop net.tcp.usercfg.default 0
164 setprop net.tcp.usercfg.wifi 1
165 setprop net.tcp.usercfg.lte 1
166
Steve Kondika3855012015-09-06 13:53:29 -0700167 # Persistent properties (only created if persist exists)
168 mkdir /persist/properties 0770 system system
169
Steve Kondikc815f702015-09-16 15:08:48 -0700170# sysinit (/system/etc/init.d)
171service sysinit /system/bin/sysinit
172 user root
173 oneshot
174 disabled
175
176# bugreport is triggered by holding down volume down, volume up and power
177service bugreport /system/bin/dumpstate -d -p -B \
178 -o /data/data/com.android.shell/files/bugreports/bugreport
179 oneshot
180 disabled
181 keycodes 114 115 116
182
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100183# adb over network
184on property:service.adb.tcp.port=5555
185 stop adbd
186 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700187
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100188on property:service.adb.tcp.port=-1
189 stop adbd
190 start adbd
191
Dan Pasanen15e432d2015-04-30 17:15:11 -0500192# Disable ril services if noril prop is set
193on property:ro.radio.noril=1
194 stop ril-daemon
195 stop qmuxd
196 stop netmgrd
197
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500198on property:persist.radio.noril=1
199 setprop ro.radio.noril 1
200
Steve Kondik26731f52015-09-07 16:42:00 -0700201# Configure IO scheduler
202on property:sys.io.scheduler=*
203 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
204
205on property:persist.sys.io.scheduler=*
206 setprop sys.io.scheduler ${persist.sys.io.scheduler}
207
Steve Kondikc815f702015-09-16 15:08:48 -0700208# Set slice_idle to 0 for CFQ
209on property:sys.io.scheduler=cfq
210 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700211
Steve Kondikc815f702015-09-16 15:08:48 -0700212# Set slice_idle to 0 for BFQ
213on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700214 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
215