blob: 83a5cb1df4d316c8cc6b25c8608cafdb7f6be007 [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
13 chmod 0666 /sys/fs/cgroup/bfqio/tasks
14
Steve Kondikb61b6df2015-09-20 20:58:43 -070015 # Soft realtime class for display service
Steve Kondik28dbc8b2015-09-07 23:23:10 -070016 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
Steve Kondikc815f702015-09-16 15:08:48 -070017 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
Steve Kondik28dbc8b2015-09-07 23:23:10 -070018 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
Steve Kondikdcbf2aa2015-09-20 03:33:31 -070019 chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
Steve Kondik28dbc8b2015-09-07 23:23:10 -070020 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
21
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010022on post-fs-data
Chirayu Desaice885402013-05-12 16:28:01 +053023 mkdir /data/.ssh 0750 root shell
Lin Mad32b7412015-05-31 15:55:38 -070024 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010025
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000026 # Run sysinit
27 start sysinit
28
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010029on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020030 # interactive governor
31 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010032 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010033 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
34 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020035 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010036 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020037 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010038 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010039 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
40 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020041 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010042 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020043 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010044 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020045 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010046 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020047 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010048 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020049 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010050 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020051 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010052 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020053 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010054 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080055 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010056 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010057 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
58 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080059 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010060 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080061 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010062 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondik9d1a8612014-01-15 01:44:07 +080063
Giulio Cerveraa76d8982013-05-21 14:23:19 +020064 # ondemand governor
65 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010066 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020067 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010068 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020069 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010070 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020071 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010072 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020073 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010074 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020075 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010076 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +020077 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +010078 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +020079 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010080 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020081 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +010082 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -070083 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010084 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -070085 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010086 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070087 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010088 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070089 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010090 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070091 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010092 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070093 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010094 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020095
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010096 chown system system /sys/block/mmcblk0/queue/scheduler
97 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +070098 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010099
Arne Coucheron08297ed2015-04-03 02:01:36 +0200100 chown system system /dev/cpuctl/cpu.notify_on_migrate
101 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700102
Steve Kondik4462dfa2015-09-18 04:27:35 -0700103 # LiveDisplay sysfs
104 chown system system /sys/devices/virtual/graphics/fb0/aco
105 chmod 0660 /sys/devices/virtual/graphics/fb0/aco
106 chown system system /sys/devices/virtual/graphics/fb0/cabc
107 chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
108 chown system system /sys/devices/virtual/graphics/fb0/rgb
109 chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
110 chown system system /sys/devices/virtual/graphics/fb0/sre
111 chmod 0660 /sys/devices/virtual/graphics/fb0/sre
112
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200113 # Define TCP delayed ack settings for WiFi & LTE
114 chown system system /sys/kernel/ipv4/tcp_delack_seg
115 chown system system /sys/kernel/ipv4/tcp_use_userconfig
116 setprop net.tcp.delack.default 1
117 setprop net.tcp.delack.wifi 20
118 setprop net.tcp.delack.lte 8
119 setprop net.tcp.usercfg.default 0
120 setprop net.tcp.usercfg.wifi 1
121 setprop net.tcp.usercfg.lte 1
122
Steve Kondika3855012015-09-06 13:53:29 -0700123 # Persistent properties (only created if persist exists)
124 mkdir /persist/properties 0770 system system
125
Steve Kondikc815f702015-09-16 15:08:48 -0700126# sysinit (/system/etc/init.d)
127service sysinit /system/bin/sysinit
128 user root
129 oneshot
130 disabled
131
132# bugreport is triggered by holding down volume down, volume up and power
133service bugreport /system/bin/dumpstate -d -p -B \
134 -o /data/data/com.android.shell/files/bugreports/bugreport
135 oneshot
136 disabled
137 keycodes 114 115 116
138
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100139# adb over network
140on property:service.adb.tcp.port=5555
141 stop adbd
142 start adbd
Steve Kondikc815f702015-09-16 15:08:48 -0700143
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100144on property:service.adb.tcp.port=-1
145 stop adbd
146 start adbd
147
Dan Pasanen15e432d2015-04-30 17:15:11 -0500148# Disable ril services if noril prop is set
149on property:ro.radio.noril=1
150 stop ril-daemon
151 stop qmuxd
152 stop netmgrd
153
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500154on property:persist.radio.noril=1
155 setprop ro.radio.noril 1
156
Steve Kondik26731f52015-09-07 16:42:00 -0700157# Configure IO scheduler
158on property:sys.io.scheduler=*
159 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
160
161on property:persist.sys.io.scheduler=*
162 setprop sys.io.scheduler ${persist.sys.io.scheduler}
163
Steve Kondikc815f702015-09-16 15:08:48 -0700164# Set slice_idle to 0 for CFQ
165on property:sys.io.scheduler=cfq
166 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
Ethan Chen3866f702015-05-05 12:30:59 -0700167
Steve Kondikc815f702015-09-16 15:08:48 -0700168# Set slice_idle to 0 for BFQ
169on property:sys.io.scheduler=bfq
Steve Kondik4462dfa2015-09-18 04:27:35 -0700170 write /sys/block/mmcblk0/queue/iosched/slice_idle 0
171