blob: 3082cfa9c1f0111517c8d036f3a0cbc04fe1f0ff [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
Steve Kondik100cc8e2015-09-19 12:41:38 -070011 mount cgroup none /sys/fs/cgroup/bfqio bfqio
Steve Kondik28dbc8b2015-09-07 23:23:10 -070012 write /sys/fs/cgroup/bfqio/bfqio.ioprio_class 2
13 write /sys/fs/cgroup/bfqio/bfqio.ioprio 4
Steve Kondik28dbc8b2015-09-07 23:23:10 -070014 chown root system /sys/fs/cgroup/bfqio/tasks
15 chmod 0666 /sys/fs/cgroup/bfqio/tasks
16
17 # Realtime audio class
18 mkdir /sys/fs/cgroup/bfqio/rt-audio 0755 root system
19 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.ioprio_class 1
20 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.ioprio 4
Steve Kondik28dbc8b2015-09-07 23:23:10 -070021 chown media system /sys/fs/cgroup/bfqio/rt-audio/tasks
22 chmod 0664 /sys/fs/cgroup/bfqio/rt-audio/tasks
23
24 # Realtime display class
25 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
Steve Kondikc815f702015-09-16 15:08:48 -070026 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
Steve Kondik28dbc8b2015-09-07 23:23:10 -070027 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
Steve Kondikdcbf2aa2015-09-20 03:33:31 -070028 chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
Steve Kondik28dbc8b2015-09-07 23:23:10 -070029 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
30
Steve Kondik28dbc8b2015-09-07 23:23:10 -070031 # Background class
32 mkdir /sys/fs/cgroup/bfqio/bg 0755 root system
33 write /sys/fs/cgroup/bfqio/bg/bfqio.ioprio_class 2
34 write /sys/fs/cgroup/bfqio/bg/bfqio.ioprio 7
Steve Kondik28dbc8b2015-09-07 23:23:10 -070035 chown root system /sys/fs/cgroup/bfqio/bg/tasks
36 chmod 0666 /sys/fs/cgroup/bfqio/bg/tasks
37
38 # Idle
39 mkdir /sys/fs/cgroup/bfqio/idle 0755 root system
40 write /sys/fs/cgroup/bfqio/idle/bfqio.ioprio_class 3
41 write /sys/fs/cgroup/bfqio/idle/bfqio.ioprio 0
Steve Kondik28dbc8b2015-09-07 23:23:10 -070042 chown root system /sys/fs/cgroup/bfqio/idle/tasks
43 chmod 0666 /sys/fs/cgroup/bfqio/idle/tasks
44
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010045on post-fs-data
Chirayu Desaice885402013-05-12 16:28:01 +053046 mkdir /data/.ssh 0750 root shell
Lin Mad32b7412015-05-31 15:55:38 -070047 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010048
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000049 # Run sysinit
50 start sysinit
51
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010052on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020053 # interactive governor
54 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010055 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010056 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
57 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020058 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010059 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020060 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010061 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010062 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
63 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020064 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010065 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020066 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010067 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020068 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010069 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020070 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010071 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020072 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010073 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020074 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010075 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020076 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010077 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080078 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010079 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010080 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
81 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080082 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010083 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080084 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010085 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondik9d1a8612014-01-15 01:44:07 +080086
Giulio Cerveraa76d8982013-05-21 14:23:19 +020087 # ondemand governor
88 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010089 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020090 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010091 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020092 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010093 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020094 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010095 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020096 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010097 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020098 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010099 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200100 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +0100101 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200102 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +0100103 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200104 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +0100105 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -0700106 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +0100107 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -0700108 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +0100109 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -0700110 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +0100111 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -0700112 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100113 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700114 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100115 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700116 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100117 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200118
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100119 chown system system /sys/block/mmcblk0/queue/scheduler
120 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700121 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100122
Arne Coucheron08297ed2015-04-03 02:01:36 +0200123 chown system system /dev/cpuctl/cpu.notify_on_migrate
124 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700125
Steve Kondik4462dfa2015-09-18 04:27:35 -0700126 # LiveDisplay sysfs
127 chown system system /sys/devices/virtual/graphics/fb0/aco
128 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
129 chown system system /sys/devices/virtual/graphics/fb0/cabc
130 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
131 chown system system /sys/devices/virtual/graphics/fb0/rgb
132 chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
133 chown system system /sys/devices/virtual/graphics/fb0/sre
134 chmod 0660 /sys/devices/virtual/graphics/fb0/sre
135
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200136 # Define TCP delayed ack settings for WiFi & LTE
137 chown system system /sys/kernel/ipv4/tcp_delack_seg
138 chown system system /sys/kernel/ipv4/tcp_use_userconfig
139 setprop net.tcp.delack.default 1
140 setprop net.tcp.delack.wifi 20
141 setprop net.tcp.delack.lte 8
142 setprop net.tcp.usercfg.default 0
143 setprop net.tcp.usercfg.wifi 1
144 setprop net.tcp.usercfg.lte 1
145
Steve Kondika3855012015-09-06 13:53:29 -0700146 # Persistent properties (only created if persist exists)
147 mkdir /persist/properties 0770 system system
148
Steve Kondikc815f702015-09-16 15:08:48 -0700149# sysinit (/system/etc/init.d)
150service sysinit /system/bin/sysinit
151 user root
152 oneshot
153 disabled
154
155# bugreport is triggered by holding down volume down, volume up and power
156service bugreport /system/bin/dumpstate -d -p -B \
157 -o /data/data/com.android.shell/files/bugreports/bugreport
158 oneshot
159 disabled
160 keycodes 114 115 116
161
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100162# adb over network
163on property:service.adb.tcp.port=5555
164 stop adbd
165 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700166
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100167on property:service.adb.tcp.port=-1
168 stop adbd
169 start adbd
170
Dan Pasanen15e432d2015-04-30 17:15:11 -0500171# Disable ril services if noril prop is set
172on property:ro.radio.noril=1
173 stop ril-daemon
174 stop qmuxd
175 stop netmgrd
176
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500177on property:persist.radio.noril=1
178 setprop ro.radio.noril 1
179
Steve Kondik26731f52015-09-07 16:42:00 -0700180# Configure IO scheduler
181on property:sys.io.scheduler=*
182 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
183
184on property:persist.sys.io.scheduler=*
185 setprop sys.io.scheduler ${persist.sys.io.scheduler}
186
Steve Kondikc815f702015-09-16 15:08:48 -0700187# Set slice_idle to 0 for CFQ
188on property:sys.io.scheduler=cfq
189 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700190
Steve Kondikc815f702015-09-16 15:08:48 -0700191# Set slice_idle to 0 for BFQ
192on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700193 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
194