blob: 1db6ec56d4386448ae43d45d4626d47e2ce921bf [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
Zhao Wei Liew726a4fc2016-09-08 22:17:15 +08007 mkdir /dev/bfqio 0755 root system
8 mount cgroup none /dev/bfqio bfqio
9 chown root system /dev/bfqio/tasks
10 chmod 0664 /dev/bfqio/tasks
11 chmod 0220 /dev/bfqio/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070012
Steve Kondikb61b6df2015-09-20 20:58:43 -070013 # Soft realtime class for display service
Zhao Wei Liew726a4fc2016-09-08 22:17:15 +080014 mkdir /dev/bfqio/rt-display 0755 root system
15 write /dev/bfqio/rt-display/bfqio.ioprio_class 1
16 chown system system /dev/bfqio/rt-display/tasks
17 chmod 0664 /dev/bfqio/rt-display/tasks
18 chmod 0220 /dev/bfqio/rt-display/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070019
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010020on post-fs-data
Luca Stefanibd3d22e2016-01-09 06:53:54 -080021 mkdir /data/ssh 0750 root shell
22 mkdir /data/ssh/empty 0600 root shell
Lin Mad32b7412015-05-31 15:55:38 -070023 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010024
Gabriele Mf395bed2017-07-19 18:47:07 +020025 # Create an additional OTA package directory that unlike /data/ota_package
26 # will not be touched by GmsCore.
27 mkdir /data/lineageos_updates 0770 system cache
28
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000029 # Run sysinit
30 start sysinit
31
Matt Mower1b4eeb32016-06-03 16:41:00 -050032 # Change permissions on fsck log so it can be added to the dropbox
33 chown root log /dev/fscklogs/log
34 chmod 0640 /dev/fscklogs/log
35
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010036on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020037 # interactive governor
38 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010039 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010040 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
41 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020042 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010043 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020044 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010045 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010046 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
47 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020048 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010049 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020050 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010051 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020052 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010053 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020054 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010055 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020056 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010057 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020058 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010059 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020060 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010061 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080062 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010063 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010064 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
65 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080066 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010067 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080068 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010069 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Dave Daynard4a2f5672016-01-16 10:26:18 -050070 chown system system /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
71 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
Steve Kondik9d1a8612014-01-15 01:44:07 +080072
Giulio Cerveraa76d8982013-05-21 14:23:19 +020073 # ondemand governor
74 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010075 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020076 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010077 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020078 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010079 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020080 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010081 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020082 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010083 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020084 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010085 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +020086 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +010087 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +020088 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010089 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020090 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +010091 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -070092 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010093 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -070094 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010095 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070096 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010097 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070098 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010099 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700100 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100101 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700102 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100103 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200104
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100105 chown system system /sys/block/mmcblk0/queue/scheduler
106 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700107 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100108
Chenxi Mao869a04f2016-06-23 17:08:28 +0800109 chown system system /sys/block/sda/queue/scheduler
110 chmod 0664 /sys/block/sda/queue/scheduler
111 restorecon /sys/block/sda/queue/scheduler
112
113 chown system system /sys/block/sde/queue/scheduler
114 chmod 0664 /sys/block/sde/queue/scheduler
115 restorecon /sys/block/sde/queue/scheduler
116
117 chown system system /sys/block/dm-0/queue/scheduler
118 chmod 0664 /sys/block/dm-0/queue/scheduler
119 restorecon /sys/block/dm-0/queue/scheduler
120
Arne Coucheron08297ed2015-04-03 02:01:36 +0200121 chown system system /dev/cpuctl/cpu.notify_on_migrate
122 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700123
Steve Kondik4462dfa2015-09-18 04:27:35 -0700124 # LiveDisplay sysfs
125 chown system system /sys/devices/virtual/graphics/fb0/aco
126 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
127 chown system system /sys/devices/virtual/graphics/fb0/cabc
128 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
Michael Bestas3ada2012016-12-05 14:11:28 +0200129 chown system system /sys/devices/virtual/graphics/fb0/hbm
130 chmod 0660 /sys/devices/virtual/graphics/fb0/hbm
Steve Kondik4462dfa2015-09-18 04:27:35 -0700131 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
Zhao Wei Liewde1ad362016-04-30 14:57:22 +0800135 chown system system /sys/devices/virtual/graphics/fb0/color_enhance
136 chmod 0660 /sys/devices/virtual/graphics/fb0/color_enhance
Steve Kondik4462dfa2015-09-18 04:27:35 -0700137
Michael Bestas2d2eb9a2016-06-14 22:09:53 +0300138 # Vibrator intensity control
139 chown system system /sys/class/timed_output/vibrator/vtg_level
140 chmod 0644 /sys/class/timed_output/vibrator/vtg_level
141
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200142 # Define TCP delayed ack settings for WiFi & LTE
143 chown system system /sys/kernel/ipv4/tcp_delack_seg
144 chown system system /sys/kernel/ipv4/tcp_use_userconfig
145 setprop net.tcp.delack.default 1
146 setprop net.tcp.delack.wifi 20
147 setprop net.tcp.delack.lte 8
148 setprop net.tcp.usercfg.default 0
149 setprop net.tcp.usercfg.wifi 1
150 setprop net.tcp.usercfg.lte 1
151
Steve Kondika3855012015-09-06 13:53:29 -0700152 # Persistent properties (only created if persist exists)
153 mkdir /persist/properties 0770 system system
154
Steve Kondikc815f702015-09-16 15:08:48 -0700155# sysinit (/system/etc/init.d)
156service sysinit /system/bin/sysinit
157 user root
158 oneshot
159 disabled
160
161# bugreport is triggered by holding down volume down, volume up and power
Felipe Leme49b60482015-11-12 13:47:09 -0800162service bugreport /system/bin/dumpstate -d -p -B -z \
Jeff Sharkeye4831012016-02-06 21:34:47 -0700163 -o /data/user_de/0/com.android.shell/files/bugreports/bugreport
Steve Kondikc815f702015-09-16 15:08:48 -0700164 oneshot
165 disabled
166 keycodes 114 115 116
167
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100168# adb over network
Ethan Chen909343f2015-12-15 10:00:00 -0800169on property:adb.network.port=*
170 setprop service.adb.tcp.port ${adb.network.port}
171
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100172on property:service.adb.tcp.port=5555
173 stop adbd
174 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700175
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100176on property:service.adb.tcp.port=-1
177 stop adbd
178 start adbd
179
Dan Pasanen15e432d2015-04-30 17:15:11 -0500180# Disable ril services if noril prop is set
181on property:ro.radio.noril=1
182 stop ril-daemon
183 stop qmuxd
184 stop netmgrd
185
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500186on property:persist.radio.noril=1
187 setprop ro.radio.noril 1
188
Steve Kondik26731f52015-09-07 16:42:00 -0700189# Configure IO scheduler
190on property:sys.io.scheduler=*
191 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200192 write /sys/block/mmcblk1/queue/scheduler ${sys.io.scheduler}
Chenxi Mao869a04f2016-06-23 17:08:28 +0800193 write /sys/block/sda/queue/scheduler ${sys.io.scheduler}
194 write /sys/block/sde/queue/scheduler ${sys.io.scheduler}
195 write /sys/block/dm-0/queue/scheduler ${sys.io.scheduler}
Steve Kondik26731f52015-09-07 16:42:00 -0700196
197on property:persist.sys.io.scheduler=*
198 setprop sys.io.scheduler ${persist.sys.io.scheduler}
199
Steve Kondikc815f702015-09-16 15:08:48 -0700200# Set slice_idle to 0 for CFQ
201on property:sys.io.scheduler=cfq
202 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200203 write /sys/block/mmcblk1/queue/iosched/slice_idle 0
Chenxi Mao869a04f2016-06-23 17:08:28 +0800204 write /sys/block/sda/queue/iosched/slice_idle 0
205 write /sys/block/sde/queue/iosched/slice_idle 0
206 write /sys/block/dm-0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700207
Steve Kondikc815f702015-09-16 15:08:48 -0700208# Set slice_idle to 0 for BFQ
209on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700210 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Zhao Wei Liew374d1382016-07-18 06:05:07 +0200211 write /sys/block/mmcblk1/queue/iosched/slice_idle 0
Chenxi Mao869a04f2016-06-23 17:08:28 +0800212 write /sys/block/sda/queue/iosched/slice_idle 0
213 write /sys/block/sde/queue/iosched/slice_idle 0
214 write /sys/block/dm-0/queue/iosched/slice_idle 0
Steve Kondik4462dfa2015-09-18 04:27:35 -0700215