Steve Kondik | a89711a | 2010-07-07 09:06:13 -0400 | [diff] [blame] | 1 | # CyanogenMod Extras |
Koushik Dutta | 5af62eb | 2013-07-27 19:52:40 -0700 | [diff] [blame] | 2 | import /init.superuser.rc |
Steve Kondik | a89711a | 2010-07-07 09:06:13 -0400 | [diff] [blame] | 3 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 4 | on init |
| 5 | export ANDROID_CACHE /cache |
| 6 | export TERMINFO /system/etc/terminfo |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 7 | |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 8 | # Set up the BFQIO hierarchy |
| 9 | chmod 0755 /sys/fs/cgroup |
| 10 | mkdir /sys/fs/cgroup/bfqio 0755 root system |
Steve Kondik | 100cc8e | 2015-09-19 12:41:38 -0700 | [diff] [blame] | 11 | mount cgroup none /sys/fs/cgroup/bfqio bfqio |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 12 | chown root system /sys/fs/cgroup/bfqio/tasks |
Diogo Ferreira | 3463bd0 | 2015-11-23 14:31:49 +0000 | [diff] [blame] | 13 | chmod 0664 /sys/fs/cgroup/bfqio/tasks |
| 14 | chmod 0220 /sys/fs/cgroup/bfqio/cgroup.event_control |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 15 | |
Steve Kondik | b61b6df | 2015-09-20 20:58:43 -0700 | [diff] [blame] | 16 | # Soft realtime class for display service |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 17 | mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system |
Steve Kondik | c815f70 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 18 | write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1 |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 19 | write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7 |
Steve Kondik | dcbf2aa | 2015-09-20 03:33:31 -0700 | [diff] [blame] | 20 | chown system system /sys/fs/cgroup/bfqio/rt-display/tasks |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 21 | chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks |
Diogo Ferreira | 3463bd0 | 2015-11-23 14:31:49 +0000 | [diff] [blame] | 22 | chmod 0220 /sys/fs/cgroup/bfqio/rt-display/cgroup.event_control |
Steve Kondik | 28dbc8b | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 23 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 24 | on post-fs-data |
Chirayu Desai | ce88540 | 2013-05-12 16:28:01 +0530 | [diff] [blame] | 25 | mkdir /data/.ssh 0750 root shell |
Lin Ma | d32b741 | 2015-05-31 15:55:38 -0700 | [diff] [blame] | 26 | mkdir /cache/recovery 0770 system cache |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 27 | |
Ricardo Cerqueira | 6698e5e | 2012-11-23 17:15:16 +0000 | [diff] [blame] | 28 | # Run sysinit |
| 29 | start sysinit |
| 30 | |
Ricardo Cerqueira | 79ba997 | 2013-06-12 12:12:18 +0100 | [diff] [blame] | 31 | on boot |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 32 | # interactive governor |
| 33 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 34 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame] | 35 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 36 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 37 | chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 38 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 39 | chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 40 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame] | 41 | chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 42 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 43 | chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 44 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 45 | chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 46 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 47 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boost |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 48 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 49 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 50 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 51 | chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 52 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 53 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 54 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
Giulio Cervera | 989a313 | 2013-07-12 17:44:16 +0200 | [diff] [blame] | 55 | chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 56 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
Steve Kondik | 9d1a861 | 2014-01-15 01:44:07 +0800 | [diff] [blame] | 57 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 58 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame] | 59 | 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 Kondik | 9d1a861 | 2014-01-15 01:44:07 +0800 | [diff] [blame] | 61 | chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 62 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load |
Steve Kondik | 9d1a861 | 2014-01-15 01:44:07 +0800 | [diff] [blame] | 63 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 64 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
Steve Kondik | 9d1a861 | 2014-01-15 01:44:07 +0800 | [diff] [blame] | 65 | |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 66 | # ondemand governor |
| 67 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 68 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 69 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 70 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 71 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 72 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 73 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 74 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 75 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 76 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 77 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 78 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 79 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 80 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 81 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 82 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 83 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 84 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
Steve Kondik | 686cbf2 | 2013-10-04 04:31:56 -0700 | [diff] [blame] | 85 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 86 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 87 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 88 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 89 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 90 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 91 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 92 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 93 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 94 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 95 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 96 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 97 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 98 | chown system system /sys/block/mmcblk0/queue/scheduler |
| 99 | chmod 0664 /sys/block/mmcblk0/queue/scheduler |
Pawit Pornkitprasan | 24a971a | 2015-01-03 12:44:43 +0700 | [diff] [blame] | 100 | restorecon /sys/block/mmcblk0/queue/scheduler |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 101 | |
Arne Coucheron | 08297ed | 2015-04-03 02:01:36 +0200 | [diff] [blame] | 102 | chown system system /dev/cpuctl/cpu.notify_on_migrate |
| 103 | chmod 0664 /dev/cpuctl/cpu.notify_on_migrate |
Steve Kondik | 6a0f530 | 2013-10-02 11:28:28 -0700 | [diff] [blame] | 104 | |
Steve Kondik | 4462dfa | 2015-09-18 04:27:35 -0700 | [diff] [blame] | 105 | # 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 Coucheron | 1f3653e | 2014-05-20 23:52:30 +0200 | [diff] [blame] | 115 | # 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 Kondik | a385501 | 2015-09-06 13:53:29 -0700 | [diff] [blame] | 125 | # Persistent properties (only created if persist exists) |
| 126 | mkdir /persist/properties 0770 system system |
| 127 | |
Steve Kondik | c815f70 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 128 | # sysinit (/system/etc/init.d) |
| 129 | service 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 |
| 135 | service 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 Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 141 | # adb over network |
Ethan Chen | 909343f | 2015-12-15 10:00:00 -0800 | [diff] [blame^] | 142 | on property:adb.network.port=* |
| 143 | setprop service.adb.tcp.port ${adb.network.port} |
| 144 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 145 | on property:service.adb.tcp.port=5555 |
| 146 | stop adbd |
| 147 | start adbd |
Steve Kondik | c815f70 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 148 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 149 | on property:service.adb.tcp.port=-1 |
| 150 | stop adbd |
| 151 | start adbd |
| 152 | |
Dan Pasanen | 15e432d | 2015-04-30 17:15:11 -0500 | [diff] [blame] | 153 | # Disable ril services if noril prop is set |
| 154 | on property:ro.radio.noril=1 |
| 155 | stop ril-daemon |
| 156 | stop qmuxd |
| 157 | stop netmgrd |
| 158 | |
Dan Pasanen | 374ca9d | 2015-04-30 17:16:07 -0500 | [diff] [blame] | 159 | on property:persist.radio.noril=1 |
| 160 | setprop ro.radio.noril 1 |
| 161 | |
Steve Kondik | 26731f5 | 2015-09-07 16:42:00 -0700 | [diff] [blame] | 162 | # Configure IO scheduler |
| 163 | on property:sys.io.scheduler=* |
| 164 | write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler} |
| 165 | |
| 166 | on property:persist.sys.io.scheduler=* |
| 167 | setprop sys.io.scheduler ${persist.sys.io.scheduler} |
| 168 | |
Steve Kondik | c815f70 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 169 | # Set slice_idle to 0 for CFQ |
| 170 | on property:sys.io.scheduler=cfq |
| 171 | write /sys/block/mmcblk0/queue/iosched/slice_idle 0 |
Ethan Chen | 3866f70 | 2015-05-05 12:30:59 -0700 | [diff] [blame] | 172 | |
Steve Kondik | c815f70 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 173 | # Set slice_idle to 0 for BFQ |
| 174 | on property:sys.io.scheduler=bfq |
Steve Kondik | 4462dfa | 2015-09-18 04:27:35 -0700 | [diff] [blame] | 175 | write /sys/block/mmcblk0/queue/iosched/slice_idle 0 |
| 176 | |