blob: 7abf3d7fca63ea6fa63f9a43ce7acc29cef97843 [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
11 mount cgroup none /sys/fs/cgroup/bfqio bfqio,xattr
12 write /sys/fs/cgroup/bfqio/bfqio.ioprio_class 2
13 write /sys/fs/cgroup/bfqio/bfqio.ioprio 4
14 write /sys/fs/cgroup/bfqio/bfqio.weight 1000
15 chown root system /sys/fs/cgroup/bfqio/tasks
16 chmod 0666 /sys/fs/cgroup/bfqio/tasks
17
18 # Realtime audio class
19 mkdir /sys/fs/cgroup/bfqio/rt-audio 0755 root system
20 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.ioprio_class 1
21 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.ioprio 4
22 write /sys/fs/cgroup/bfqio/rt-audio/bfqio.weight 1000
23 chown media system /sys/fs/cgroup/bfqio/rt-audio/tasks
24 chmod 0664 /sys/fs/cgroup/bfqio/rt-audio/tasks
25
26 # Realtime display class
27 mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
28 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
29 write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
30 write /sys/fs/cgroup/bfqio/rt-display/bfqio.weight 1000
31 chown system graphics /sys/fs/cgroup/bfqio/rt-display/tasks
32 chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
33
34 # Display class
35 mkdir /sys/fs/cgroup/bfqio/display 0755 root system
36 write /sys/fs/cgroup/bfqio/display/bfqio.ioprio_class 2
37 write /sys/fs/cgroup/bfqio/display/bfqio.ioprio 0
38 write /sys/fs/cgroup/bfqio/display/bfqio.weight 1000
39 chown root system /sys/fs/cgroup/bfqio/display/tasks
40 chmod 0666 /sys/fs/cgroup/bfqio/display/tasks
41
42 # Hipri class
43 mkdir /sys/fs/cgroup/bfqio/hipri 0755 root system
44 write /sys/fs/cgroup/bfqio/hipri/bfqio.ioprio_class 2
45 write /sys/fs/cgroup/bfqio/hipri/bfqio.ioprio 2
46 write /sys/fs/cgroup/bfqio/hipri/bfqio.weight 1000
47 chown root system /sys/fs/cgroup/bfqio/hipri/tasks
48 chmod 0666 /sys/fs/cgroup/bfqio/hipri/tasks
49
50 # Background class
51 mkdir /sys/fs/cgroup/bfqio/bg 0755 root system
52 write /sys/fs/cgroup/bfqio/bg/bfqio.ioprio_class 2
53 write /sys/fs/cgroup/bfqio/bg/bfqio.ioprio 7
54 write /sys/fs/cgroup/bfqio/bg/bfqio.weight 1000
55 chown root system /sys/fs/cgroup/bfqio/bg/tasks
56 chmod 0666 /sys/fs/cgroup/bfqio/bg/tasks
57
58 # Idle
59 mkdir /sys/fs/cgroup/bfqio/idle 0755 root system
60 write /sys/fs/cgroup/bfqio/idle/bfqio.ioprio_class 3
61 write /sys/fs/cgroup/bfqio/idle/bfqio.ioprio 0
62 write /sys/fs/cgroup/bfqio/idle/bfqio.weight 1000
63 chown root system /sys/fs/cgroup/bfqio/idle/tasks
64 chmod 0666 /sys/fs/cgroup/bfqio/idle/tasks
65
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010066on post-fs-data
Chirayu Desaice885402013-05-12 16:28:01 +053067 mkdir /data/.ssh 0750 root shell
Lin Mad32b7412015-05-31 15:55:38 -070068 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010069
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000070 # Run sysinit
71 start sysinit
72
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010073on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020074 # interactive governor
75 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010076 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010077 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
78 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020079 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010080 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020081 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010082 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010083 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
84 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020085 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010086 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020087 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010088 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020089 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010090 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020091 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010092 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020093 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010094 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020095 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010096 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020097 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010098 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080099 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100100 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +0100101 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
102 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +0800103 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100104 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +0800105 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +0100106 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondik9d1a8612014-01-15 01:44:07 +0800107
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200108 # ondemand governor
109 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100110 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200111 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +0100112 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200113 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +0100114 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200115 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +0100116 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200117 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +0100118 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200119 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +0100120 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200121 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +0100122 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200123 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +0100124 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200125 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +0100126 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -0700127 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +0100128 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -0700129 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +0100130 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -0700131 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +0100132 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -0700133 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100134 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700135 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100136 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -0700137 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +0100138 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200139
140 # Assume SMP uses shared cpufreq policy for all CPUs
141 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Steve Kondikb4fb9532014-02-23 21:49:00 +0100142 chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200143 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100144 chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200145 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +0100146 chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Giulio Cerveraa76d8982013-05-21 14:23:19 +0200147
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100148 chown system system /sys/block/mmcblk0/queue/scheduler
149 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +0700150 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100151
Arne Coucheron08297ed2015-04-03 02:01:36 +0200152 chown system system /dev/cpuctl/cpu.notify_on_migrate
153 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -0700154
Arne Coucheron1f3653e2014-05-20 23:52:30 +0200155 # Define TCP delayed ack settings for WiFi & LTE
156 chown system system /sys/kernel/ipv4/tcp_delack_seg
157 chown system system /sys/kernel/ipv4/tcp_use_userconfig
158 setprop net.tcp.delack.default 1
159 setprop net.tcp.delack.wifi 20
160 setprop net.tcp.delack.lte 8
161 setprop net.tcp.usercfg.default 0
162 setprop net.tcp.usercfg.wifi 1
163 setprop net.tcp.usercfg.lte 1
164
Steve Kondika3855012015-09-06 13:53:29 -0700165 # Persistent properties (only created if persist exists)
166 mkdir /persist/properties 0770 system system
167
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100168# adb over network
169on property:service.adb.tcp.port=5555
170 stop adbd
171 start adbd
172on 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}
188
189on property:persist.sys.io.scheduler=*
190 setprop sys.io.scheduler ${persist.sys.io.scheduler}
191
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +0000192# sysinit (/system/etc/init.d)
193service sysinit /system/bin/sysinit
194 user root
195 oneshot
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +0100196 disabled
Ethan Chen3866f702015-05-05 12:30:59 -0700197
198# bugreport is triggered by holding down volume down, volume up and power
199service bugreport /system/bin/dumpstate -d -p -B \
200 -o /data/data/com.android.shell/files/bugreports/bugreport
201 oneshot
202 disabled
203 keycodes 114 115 116