blob: ebad726779655dcceb30f389e506b473368699be [file] [log] [blame]
Steve Kondika89711a2010-07-07 09:06:13 -04001# CyanogenMod Extras
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +01002on init
3 export ANDROID_CACHE /cache
4 export TERMINFO /system/etc/terminfo
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +01005
Zhao Wei Liewc4e4e0d2016-09-08 12:14:05 +08006 # Create cgroup mount point for BFQ
7 mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
8
Steve Kondik28dbc8b2015-09-07 23:23:10 -07009 # Set up the BFQIO hierarchy
10 chmod 0755 /sys/fs/cgroup
11 mkdir /sys/fs/cgroup/bfqio 0755 root system
Steve Kondik100cc8e2015-09-19 12:41:38 -070012 mount cgroup none /sys/fs/cgroup/bfqio bfqio
Steve Kondik28dbc8b2015-09-07 23:23:10 -070013 chown root system /sys/fs/cgroup/bfqio/tasks
Diogo Ferreira3463bd02015-11-23 14:31:49 +000014 chmod 0664 /sys/fs/cgroup/bfqio/tasks
15 chmod 0220 /sys/fs/cgroup/bfqio/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070016
Steve Kondikb61b6df2015-09-20 20:58:43 -070017 # Soft realtime class for display service
Steve Kondik28dbc8b2015-09-07 23:23:10 -070018 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
Steve Kondikc815f702015-09-16 15:08:48 -070019 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
Steve Kondik28dbc8b2015-09-07 23:23:10 -070020 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
Steve Kondikdcbf2aa2015-09-20 03:33:31 -070021 chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
Steve Kondik28dbc8b2015-09-07 23:23:10 -070022 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
Diogo Ferreira3463bd02015-11-23 14:31:49 +000023 chmod 0220 /sys/fs/cgroup/bfqio/rt-display/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070024
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010025on post-fs-data
Luca Stefanibd3d22e2016-01-09 06:53:54 -080026 mkdir /data/ssh 0750 root shell
27 mkdir /data/ssh/empty 0600 root shell
Lin Mad32b7412015-05-31 15:55:38 -070028 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010029
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000030 # Run sysinit
31 start sysinit
32
Matt Mower1b4eeb32016-06-03 16:41:00 -050033 # Change permissions on fsck log so it can be added to the dropbox
34 chown root log /dev/fscklogs/log
35 chmod 0640 /dev/fscklogs/log
36
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010037on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020038 # interactive governor
39 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010040 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010041 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
42 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020043 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010044 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020045 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010046 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010047 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
48 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020049 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010050 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020051 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010052 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020053 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010054 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020055 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010056 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020057 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010058 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020059 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010060 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020061 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010062 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080063 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010064 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010065 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
66 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080067 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010068 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080069 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010070 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Dave Daynard4a2f5672016-01-16 10:26:18 -050071 chown system system /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
72 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
Steve Kondik9d1a8612014-01-15 01:44:07 +080073
Giulio Cerveraa76d8982013-05-21 14:23:19 +020074 # ondemand governor
75 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010076 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020077 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010078 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020079 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010080 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020081 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010082 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020083 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010084 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020085 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010086 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +020087 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +010088 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +020089 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010090 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020091 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +010092 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -070093 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010094 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -070095 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010096 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070097 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010098 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070099 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100100 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700101 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100102 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700103 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100104 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200105
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100106 chown system system /sys/block/mmcblk0/queue/scheduler
107 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700108 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100109
Chenxi Mao869a04f2016-06-23 17:08:28 +0800110 chown system system /sys/block/sda/queue/scheduler
111 chmod 0664 /sys/block/sda/queue/scheduler
112 restorecon /sys/block/sda/queue/scheduler
113
114 chown system system /sys/block/sde/queue/scheduler
115 chmod 0664 /sys/block/sde/queue/scheduler
116 restorecon /sys/block/sde/queue/scheduler
117
118 chown system system /sys/block/dm-0/queue/scheduler
119 chmod 0664 /sys/block/dm-0/queue/scheduler
120 restorecon /sys/block/dm-0/queue/scheduler
121
Arne Coucheron08297ed2015-04-03 02:01:36 +0200122 chown system system /dev/cpuctl/cpu.notify_on_migrate
123 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700124
Steve Kondik4462dfa2015-09-18 04:27:35 -0700125 # LiveDisplay sysfs
126 chown system system /sys/devices/virtual/graphics/fb0/aco
127 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
128 chown system system /sys/devices/virtual/graphics/fb0/cabc
129 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
130 chown system system /sys/devices/virtual/graphics/fb0/rgb
131 chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
132 chown system system /sys/devices/virtual/graphics/fb0/sre
133 chmod 0660 /sys/devices/virtual/graphics/fb0/sre
Zhao Wei Liewde1ad362016-04-30 14:57:22 +0800134 chown system system /sys/devices/virtual/graphics/fb0/color_enhance
135 chmod 0660 /sys/devices/virtual/graphics/fb0/color_enhance
Steve Kondik4462dfa2015-09-18 04:27:35 -0700136
Michael Bestas2d2eb9a2016-06-14 22:09:53 +0300137 # Vibrator intensity control
138 chown system system /sys/class/timed_output/vibrator/vtg_level
139 chmod 0644 /sys/class/timed_output/vibrator/vtg_level
140
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200141 # Define TCP delayed ack settings for WiFi & LTE
142 chown system system /sys/kernel/ipv4/tcp_delack_seg
143 chown system system /sys/kernel/ipv4/tcp_use_userconfig
144 setprop net.tcp.delack.default 1
145 setprop net.tcp.delack.wifi 20
146 setprop net.tcp.delack.lte 8
147 setprop net.tcp.usercfg.default 0
148 setprop net.tcp.usercfg.wifi 1
149 setprop net.tcp.usercfg.lte 1
150
Steve Kondika3855012015-09-06 13:53:29 -0700151 # Persistent properties (only created if persist exists)
152 mkdir /persist/properties 0770 system system
153
Steve Kondikc815f702015-09-16 15:08:48 -0700154# sysinit (/system/etc/init.d)
155service sysinit /system/bin/sysinit
156 user root
157 oneshot
158 disabled
159
160# bugreport is triggered by holding down volume down, volume up and power
161service bugreport /system/bin/dumpstate -d -p -B \
162 -o /data/data/com.android.shell/files/bugreports/bugreport
163 oneshot
164 disabled
165 keycodes 114 115 116
166
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100167# adb over network
Ethan Chen909343f2015-12-15 10:00:00 -0800168on property:adb.network.port=*
169 setprop service.adb.tcp.port ${adb.network.port}
170
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100171on property:service.adb.tcp.port=5555
172 stop adbd
173 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700174
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100175on property:service.adb.tcp.port=-1
176 stop adbd
177 start adbd
178
Dan Pasanen15e432d2015-04-30 17:15:11 -0500179# Disable ril services if noril prop is set
180on property:ro.radio.noril=1
181 stop ril-daemon
182 stop qmuxd
183 stop netmgrd
184
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500185on property:persist.radio.noril=1
186 setprop ro.radio.noril 1
187
Steve Kondik26731f52015-09-07 16:42:00 -0700188# Configure IO scheduler
189on property:sys.io.scheduler=*
190 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200191 write /sys/block/mmcblk1/queue/scheduler ${sys.io.scheduler}
Chenxi Mao869a04f2016-06-23 17:08:28 +0800192 write /sys/block/sda/queue/scheduler ${sys.io.scheduler}
193 write /sys/block/sde/queue/scheduler ${sys.io.scheduler}
194 write /sys/block/dm-0/queue/scheduler ${sys.io.scheduler}
Steve Kondik26731f52015-09-07 16:42:00 -0700195
196on property:persist.sys.io.scheduler=*
197 setprop sys.io.scheduler ${persist.sys.io.scheduler}
198
Steve Kondikc815f702015-09-16 15:08:48 -0700199# Set slice_idle to 0 for CFQ
200on property:sys.io.scheduler=cfq
201 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200202 write /sys/block/mmcblk1/queue/iosched/slice_idle 0
Chenxi Mao869a04f2016-06-23 17:08:28 +0800203 write /sys/block/sda/queue/iosched/slice_idle 0
204 write /sys/block/sde/queue/iosched/slice_idle 0
205 write /sys/block/dm-0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700206
Steve Kondikc815f702015-09-16 15:08:48 -0700207# Set slice_idle to 0 for BFQ
208on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700209 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200210 write /sys/block/mmcblk1/queue/iosched/slice_idle 0
Chenxi Mao869a04f2016-06-23 17:08:28 +0800211 write /sys/block/sda/queue/iosched/slice_idle 0
212 write /sys/block/sde/queue/iosched/slice_idle 0
213 write /sys/block/dm-0/queue/iosched/slice_idle 0
Steve Kondik4462dfa2015-09-18 04:27:35 -0700214