Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 1 | # CyanogenMod Extras |
| 2 | import /init.superuser.rc |
| 3 | |
| 4 | on init |
| 5 | export ANDROID_CACHE /cache |
| 6 | export TERMINFO /system/etc/terminfo |
| 7 | |
Steve Kondik | 35155b3 | 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 |
| 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 |
Steve Kondik | b05ac82 | 2015-09-16 15:08:48 -0700 | [diff] [blame^] | 28 | write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1 |
Steve Kondik | 35155b3 | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 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 |
Steve Kondik | b05ac82 | 2015-09-16 15:08:48 -0700 | [diff] [blame^] | 45 | write /sys/fs/cgroup/bfqio/hipri/bfqio.ioprio 2 |
Steve Kondik | 35155b3 | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 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 | |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 66 | on post-fs-data |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 67 | mkdir /data/.ssh 0750 root shell |
| 68 | |
| 69 | # Run sysinit |
| 70 | start sysinit |
| 71 | |
| 72 | on boot |
| 73 | # interactive governor |
| 74 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
| 75 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
| 76 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 77 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 78 | chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
| 79 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
| 80 | chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
| 81 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
| 82 | chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 83 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 84 | chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
| 85 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
| 86 | chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
| 87 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
| 88 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boost |
| 89 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost |
| 90 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
| 91 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
| 92 | chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost |
| 93 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost |
| 94 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
| 95 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
| 96 | chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
| 97 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
| 98 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
| 99 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
| 100 | chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq |
| 101 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq |
| 102 | chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load |
| 103 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load |
| 104 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
| 105 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
| 106 | |
| 107 | # ondemand governor |
| 108 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
| 109 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
| 110 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
| 111 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
| 112 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
| 113 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
| 114 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
| 115 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
| 116 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
| 117 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
| 118 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
| 119 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
| 120 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
| 121 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
| 122 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
| 123 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
| 124 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
| 125 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
| 126 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
| 127 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
| 128 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
| 129 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
| 130 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
| 131 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
| 132 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
| 133 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
| 134 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
| 135 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
| 136 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load |
| 137 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load |
| 138 | |
| 139 | # Assume SMP uses shared cpufreq policy for all CPUs |
| 140 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
| 141 | chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
| 142 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
| 143 | chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
| 144 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq |
| 145 | chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq |
| 146 | |
| 147 | chown system system /sys/block/mmcblk0/queue/scheduler |
| 148 | chmod 0664 /sys/block/mmcblk0/queue/scheduler |
Pawit Pornkitprasan | 7e4f300 | 2015-01-03 12:44:43 +0700 | [diff] [blame] | 149 | restorecon /sys/block/mmcblk0/queue/scheduler |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 150 | |
Arne Coucheron | 55b7398 | 2015-04-03 02:01:36 +0200 | [diff] [blame] | 151 | chown system system /dev/cpuctl/cpu.notify_on_migrate |
| 152 | chmod 0664 /dev/cpuctl/cpu.notify_on_migrate |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 153 | |
| 154 | # Define TCP delayed ack settings for WiFi & LTE |
| 155 | chown system system /sys/kernel/ipv4/tcp_delack_seg |
| 156 | chown system system /sys/kernel/ipv4/tcp_use_userconfig |
| 157 | setprop net.tcp.delack.default 1 |
| 158 | setprop net.tcp.delack.wifi 20 |
| 159 | setprop net.tcp.delack.lte 8 |
| 160 | setprop net.tcp.usercfg.default 0 |
| 161 | setprop net.tcp.usercfg.wifi 1 |
| 162 | setprop net.tcp.usercfg.lte 1 |
| 163 | |
Steve Kondik | fc5d13a | 2015-09-06 13:53:29 -0700 | [diff] [blame] | 164 | # Persistent properties (only created if persist exists) |
| 165 | mkdir /persist/properties 0770 system system |
| 166 | |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 167 | # sysinit (/system/etc/init.d) |
| 168 | service sysinit /system/bin/sysinit |
| 169 | user root |
| 170 | oneshot |
| 171 | disabled |
Ethan Chen | 6b30a16 | 2015-05-05 12:30:59 -0700 | [diff] [blame] | 172 | |
| 173 | # bugreport is triggered by holding down volume down, volume up and power |
| 174 | service bugreport /system/bin/dumpstate -d -p -B \ |
| 175 | -o /data/data/com.android.shell/files/bugreports/bugreport |
| 176 | oneshot |
| 177 | disabled |
| 178 | keycodes 114 115 116 |
Steve Kondik | b05ac82 | 2015-09-16 15:08:48 -0700 | [diff] [blame^] | 179 | |
| 180 | # Configure IO scheduler |
| 181 | on property:sys.io.scheduler=* |
| 182 | write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler} |
| 183 | |
| 184 | on property:persist.sys.io.scheduler=* |
| 185 | setprop sys.io.scheduler ${persist.sys.io.scheduler} |
| 186 | |
| 187 | # Set slice_idle to 0 for CFQ |
| 188 | on property:sys.io.scheduler=cfq |
| 189 | write /sys/block/mmcblk0/queue/iosched/slice_idle 0 |
| 190 | |
| 191 | # Set slice_idle to 0 for BFQ |
| 192 | on property:sys.io.scheduler=bfq |
| 193 | write /sys/block/mmcblk0/queue/iosched/slice_idle 0 |