blob: e29b015dfd845321dea298f0e1acec358177eb3a [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 chown root system /sys/fs/cgroup/bfqio/tasks
Diogo Ferreira3463bd02015-11-23 14:31:49 +000013 chmod 0664 /sys/fs/cgroup/bfqio/tasks
14 chmod 0220 /sys/fs/cgroup/bfqio/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070015
Steve Kondikb61b6df2015-09-20 20:58:43 -070016 # Soft realtime class for display service
Steve Kondik28dbc8b2015-09-07 23:23:10 -070017 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
Steve Kondikc815f702015-09-16 15:08:48 -070018 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
Steve Kondik28dbc8b2015-09-07 23:23:10 -070019 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
Steve Kondikdcbf2aa2015-09-20 03:33:31 -070020 chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
Steve Kondik28dbc8b2015-09-07 23:23:10 -070021 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
Diogo Ferreira3463bd02015-11-23 14:31:49 +000022 chmod 0220 /sys/fs/cgroup/bfqio/rt-display/cgroup.event_control
Steve Kondik28dbc8b2015-09-07 23:23:10 -070023
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010024on post-fs-data
Chirayu Desaice885402013-05-12 16:28:01 +053025 mkdir /data/.ssh 0750 root shell
Lin Mad32b7412015-05-31 15:55:38 -070026 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010027
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000028 # Run sysinit
29 start sysinit
30
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010031on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020032 # interactive governor
33 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010034 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010035 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
36 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020037 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010038 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020039 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010040 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010041 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
42 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020043 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010044 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020045 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010046 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020047 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010048 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020049 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010050 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020051 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010052 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020053 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010054 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020055 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010056 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080057 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010058 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010059 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
60 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080061 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010062 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080063 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010064 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondik9d1a8612014-01-15 01:44:07 +080065
Giulio Cerveraa76d8982013-05-21 14:23:19 +020066 # ondemand governor
67 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010068 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020069 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010070 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020071 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010072 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020073 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010074 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020075 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010076 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020077 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010078 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +020079 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +010080 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +020081 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010082 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020083 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +010084 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -070085 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010086 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -070087 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010088 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070089 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010090 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070091 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010092 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070093 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010094 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070095 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010096 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020097
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010098 chown system system /sys/block/mmcblk0/queue/scheduler
99 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700100 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100101
Arne Coucheron08297ed2015-04-03 02:01:36 +0200102 chown system system /dev/cpuctl/cpu.notify_on_migrate
103 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700104
Steve Kondik4462dfa2015-09-18 04:27:35 -0700105 # LiveDisplay sysfs
106 chown system system /sys/devices/virtual/graphics/fb0/aco
107 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
108 chown system system /sys/devices/virtual/graphics/fb0/cabc
109 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
110 chown system system /sys/devices/virtual/graphics/fb0/rgb
111 chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
112 chown system system /sys/devices/virtual/graphics/fb0/sre
113 chmod 0660 /sys/devices/virtual/graphics/fb0/sre
114
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200115 # Define TCP delayed ack settings for WiFi & LTE
116 chown system system /sys/kernel/ipv4/tcp_delack_seg
117 chown system system /sys/kernel/ipv4/tcp_use_userconfig
118 setprop net.tcp.delack.default 1
119 setprop net.tcp.delack.wifi 20
120 setprop net.tcp.delack.lte 8
121 setprop net.tcp.usercfg.default 0
122 setprop net.tcp.usercfg.wifi 1
123 setprop net.tcp.usercfg.lte 1
124
Steve Kondika3855012015-09-06 13:53:29 -0700125 # Persistent properties (only created if persist exists)
126 mkdir /persist/properties 0770 system system
127
Steve Kondikc815f702015-09-16 15:08:48 -0700128# sysinit (/system/etc/init.d)
129service sysinit /system/bin/sysinit
130 user root
131 oneshot
132 disabled
133
134# bugreport is triggered by holding down volume down, volume up and power
135service bugreport /system/bin/dumpstate -d -p -B \
136 -o /data/data/com.android.shell/files/bugreports/bugreport
137 oneshot
138 disabled
139 keycodes 114 115 116
140
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100141# adb over network
Ethan Chen909343f2015-12-15 10:00:00 -0800142on property:adb.network.port=*
143 setprop service.adb.tcp.port ${adb.network.port}
144
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100145on property:service.adb.tcp.port=5555
146 stop adbd
147 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700148
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100149on property:service.adb.tcp.port=-1
150 stop adbd
151 start adbd
152
Dan Pasanen15e432d2015-04-30 17:15:11 -0500153# Disable ril services if noril prop is set
154on property:ro.radio.noril=1
155 stop ril-daemon
156 stop qmuxd
157 stop netmgrd
158
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500159on property:persist.radio.noril=1
160 setprop ro.radio.noril 1
161
Steve Kondik26731f52015-09-07 16:42:00 -0700162# Configure IO scheduler
163on property:sys.io.scheduler=*
164 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
165
166on property:persist.sys.io.scheduler=*
167 setprop sys.io.scheduler ${persist.sys.io.scheduler}
168
Steve Kondikc815f702015-09-16 15:08:48 -0700169# Set slice_idle to 0 for CFQ
170on property:sys.io.scheduler=cfq
171 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700172
Steve Kondikc815f702015-09-16 15:08:48 -0700173# Set slice_idle to 0 for BFQ
174on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700175 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
176