blob: 3636731a80928c5a24348f338c5857acee0c69d5 [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
Steve Kondik28dbc8b2015-09-07 23:23:10 -07006 # Set up the BFQIO hierarchy
7 chmod 0755 /sys/fs/cgroup
8 mkdir /sys/fs/cgroup/bfqio 0755 root system
Steve Kondik100cc8e2015-09-19 12:41:38 -07009 mount cgroup none /sys/fs/cgroup/bfqio bfqio
Steve Kondik28dbc8b2015-09-07 23:23:10 -070010 chown root system /sys/fs/cgroup/bfqio/tasks
Diogo Ferreira3463bd02015-11-23 14:31:49 +000011 chmod 0664 /sys/fs/cgroup/bfqio/tasks
12 chmod 0220 /sys/fs/cgroup/bfqio/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070013
Steve Kondikb61b6df2015-09-20 20:58:43 -070014 # Soft realtime class for display service
Steve Kondik28dbc8b2015-09-07 23:23:10 -070015 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
Steve Kondikc815f702015-09-16 15:08:48 -070016 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
Steve Kondik28dbc8b2015-09-07 23:23:10 -070017 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
Steve Kondikdcbf2aa2015-09-20 03:33:31 -070018 chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
Steve Kondik28dbc8b2015-09-07 23:23:10 -070019 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
Diogo Ferreira3463bd02015-11-23 14:31:49 +000020 chmod 0220 /sys/fs/cgroup/bfqio/rt-display/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070021
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010022on post-fs-data
Luca Stefanibd3d22e2016-01-09 06:53:54 -080023 mkdir /data/ssh 0750 root shell
24 mkdir /data/ssh/empty 0600 root shell
Lin Mad32b7412015-05-31 15:55:38 -070025 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010026
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000027 # Run sysinit
28 start sysinit
29
Matt Mower1b4eeb32016-06-03 16:41:00 -050030 # Change permissions on fsck log so it can be added to the dropbox
31 chown root log /dev/fscklogs/log
32 chmod 0640 /dev/fscklogs/log
33
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010034on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020035 # interactive governor
36 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010037 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010038 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
39 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020040 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010041 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020042 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010043 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010044 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
45 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020046 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010047 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020048 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010049 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020050 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010051 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020052 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010053 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020054 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010055 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020056 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010057 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020058 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010059 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080060 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010061 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010062 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
63 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080064 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010065 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080066 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010067 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Dave Daynard4a2f5672016-01-16 10:26:18 -050068 chown system system /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
69 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
Steve Kondik9d1a8612014-01-15 01:44:07 +080070
Giulio Cerveraa76d8982013-05-21 14:23:19 +020071 # ondemand governor
72 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010073 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020074 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010075 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020076 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010077 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020078 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010079 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020080 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010081 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020082 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010083 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +020084 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +010085 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +020086 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010087 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020088 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +010089 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -070090 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010091 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -070092 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010093 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070094 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010095 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070096 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010097 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070098 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010099 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700100 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100101 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200102
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100103 chown system system /sys/block/mmcblk0/queue/scheduler
104 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700105 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100106
Chenxi Mao869a04f2016-06-23 17:08:28 +0800107 chown system system /sys/block/sda/queue/scheduler
108 chmod 0664 /sys/block/sda/queue/scheduler
109 restorecon /sys/block/sda/queue/scheduler
110
111 chown system system /sys/block/sde/queue/scheduler
112 chmod 0664 /sys/block/sde/queue/scheduler
113 restorecon /sys/block/sde/queue/scheduler
114
115 chown system system /sys/block/dm-0/queue/scheduler
116 chmod 0664 /sys/block/dm-0/queue/scheduler
117 restorecon /sys/block/dm-0/queue/scheduler
118
Arne Coucheron08297ed2015-04-03 02:01:36 +0200119 chown system system /dev/cpuctl/cpu.notify_on_migrate
120 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700121
Steve Kondik4462dfa2015-09-18 04:27:35 -0700122 # LiveDisplay sysfs
123 chown system system /sys/devices/virtual/graphics/fb0/aco
124 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
125 chown system system /sys/devices/virtual/graphics/fb0/cabc
126 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
127 chown system system /sys/devices/virtual/graphics/fb0/rgb
128 chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
129 chown system system /sys/devices/virtual/graphics/fb0/sre
130 chmod 0660 /sys/devices/virtual/graphics/fb0/sre
Zhao Wei Liewde1ad362016-04-30 14:57:22 +0800131 chown system system /sys/devices/virtual/graphics/fb0/color_enhance
132 chmod 0660 /sys/devices/virtual/graphics/fb0/color_enhance
Steve Kondik4462dfa2015-09-18 04:27:35 -0700133
Michael Bestas2d2eb9a2016-06-14 22:09:53 +0300134 # Vibrator intensity control
135 chown system system /sys/class/timed_output/vibrator/vtg_level
136 chmod 0644 /sys/class/timed_output/vibrator/vtg_level
137
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200138 # Define TCP delayed ack settings for WiFi & LTE
139 chown system system /sys/kernel/ipv4/tcp_delack_seg
140 chown system system /sys/kernel/ipv4/tcp_use_userconfig
141 setprop net.tcp.delack.default 1
142 setprop net.tcp.delack.wifi 20
143 setprop net.tcp.delack.lte 8
144 setprop net.tcp.usercfg.default 0
145 setprop net.tcp.usercfg.wifi 1
146 setprop net.tcp.usercfg.lte 1
147
Steve Kondika3855012015-09-06 13:53:29 -0700148 # Persistent properties (only created if persist exists)
149 mkdir /persist/properties 0770 system system
150
Steve Kondikc815f702015-09-16 15:08:48 -0700151# sysinit (/system/etc/init.d)
152service sysinit /system/bin/sysinit
153 user root
154 oneshot
155 disabled
156
157# bugreport is triggered by holding down volume down, volume up and power
158service bugreport /system/bin/dumpstate -d -p -B \
159 -o /data/data/com.android.shell/files/bugreports/bugreport
160 oneshot
161 disabled
162 keycodes 114 115 116
163
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100164# adb over network
Ethan Chen909343f2015-12-15 10:00:00 -0800165on property:adb.network.port=*
166 setprop service.adb.tcp.port ${adb.network.port}
167
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100168on property:service.adb.tcp.port=5555
169 stop adbd
170 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700171
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100172on property:service.adb.tcp.port=-1
173 stop adbd
174 start adbd
175
Dan Pasanen15e432d2015-04-30 17:15:11 -0500176# Disable ril services if noril prop is set
177on property:ro.radio.noril=1
178 stop ril-daemon
179 stop qmuxd
180 stop netmgrd
181
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500182on property:persist.radio.noril=1
183 setprop ro.radio.noril 1
184
Steve Kondik26731f52015-09-07 16:42:00 -0700185# Configure IO scheduler
186on property:sys.io.scheduler=*
187 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200188 write /sys/block/mmcblk1/queue/scheduler ${sys.io.scheduler}
Chenxi Mao869a04f2016-06-23 17:08:28 +0800189 write /sys/block/sda/queue/scheduler ${sys.io.scheduler}
190 write /sys/block/sde/queue/scheduler ${sys.io.scheduler}
191 write /sys/block/dm-0/queue/scheduler ${sys.io.scheduler}
Steve Kondik26731f52015-09-07 16:42:00 -0700192
193on property:persist.sys.io.scheduler=*
194 setprop sys.io.scheduler ${persist.sys.io.scheduler}
195
Steve Kondikc815f702015-09-16 15:08:48 -0700196# Set slice_idle to 0 for CFQ
197on property:sys.io.scheduler=cfq
198 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200199 write /sys/block/mmcblk1/queue/iosched/slice_idle 0
Chenxi Mao869a04f2016-06-23 17:08:28 +0800200 write /sys/block/sda/queue/iosched/slice_idle 0
201 write /sys/block/sde/queue/iosched/slice_idle 0
202 write /sys/block/dm-0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700203
Steve Kondikc815f702015-09-16 15:08:48 -0700204# Set slice_idle to 0 for BFQ
205on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700206 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200207 write /sys/block/mmcblk1/queue/iosched/slice_idle 0
Chenxi Mao869a04f2016-06-23 17:08:28 +0800208 write /sys/block/sda/queue/iosched/slice_idle 0
209 write /sys/block/sde/queue/iosched/slice_idle 0
210 write /sys/block/dm-0/queue/iosched/slice_idle 0
Steve Kondik4462dfa2015-09-18 04:27:35 -0700211