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 |
Steve Kondik | 9b831e2 | 2015-09-19 12:41:38 -0700 | [diff] [blame] | 11 | mount cgroup none /sys/fs/cgroup/bfqio bfqio |
Steve Kondik | 35155b3 | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 12 | chown root system /sys/fs/cgroup/bfqio/tasks |
| 13 | chmod 0666 /sys/fs/cgroup/bfqio/tasks |
| 14 | |
Steve Kondik | e4b45cf | 2015-09-20 20:58:43 -0700 | [diff] [blame^] | 15 | # Soft realtime class for display service |
Steve Kondik | 35155b3 | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 16 | mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system |
Steve Kondik | b05ac82 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 17 | write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1 |
Steve Kondik | 35155b3 | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 18 | write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7 |
Steve Kondik | 4951a8d | 2015-09-20 03:33:31 -0700 | [diff] [blame] | 19 | chown system system /sys/fs/cgroup/bfqio/rt-display/tasks |
Steve Kondik | 35155b3 | 2015-09-07 23:23:10 -0700 | [diff] [blame] | 20 | chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks |
| 21 | |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 22 | on post-fs-data |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 23 | mkdir /data/.ssh 0750 root shell |
| 24 | |
| 25 | # Run sysinit |
| 26 | start sysinit |
| 27 | |
| 28 | on boot |
| 29 | # interactive governor |
| 30 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
| 31 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
| 32 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 33 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 34 | chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
| 35 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
| 36 | chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
| 37 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
| 38 | chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 39 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 40 | chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
| 41 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
| 42 | chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
| 43 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
| 44 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boost |
| 45 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost |
| 46 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
| 47 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
| 48 | chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost |
| 49 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost |
| 50 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
| 51 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
| 52 | chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
| 53 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
| 54 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
| 55 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
| 56 | chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq |
| 57 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq |
| 58 | chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load |
| 59 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load |
| 60 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
| 61 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
| 62 | |
| 63 | # ondemand governor |
| 64 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
| 65 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
| 66 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
| 67 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
| 68 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
| 69 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
| 70 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
| 71 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
| 72 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
| 73 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
| 74 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
| 75 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
| 76 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
| 77 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
| 78 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
| 79 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
| 80 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
| 81 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
| 82 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
| 83 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
| 84 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
| 85 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
| 86 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
| 87 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
| 88 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
| 89 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
| 90 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
| 91 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
| 92 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load |
| 93 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load |
| 94 | |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 95 | chown system system /sys/block/mmcblk0/queue/scheduler |
| 96 | chmod 0664 /sys/block/mmcblk0/queue/scheduler |
Pawit Pornkitprasan | 7e4f300 | 2015-01-03 12:44:43 +0700 | [diff] [blame] | 97 | restorecon /sys/block/mmcblk0/queue/scheduler |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 98 | |
Arne Coucheron | 55b7398 | 2015-04-03 02:01:36 +0200 | [diff] [blame] | 99 | chown system system /dev/cpuctl/cpu.notify_on_migrate |
| 100 | chmod 0664 /dev/cpuctl/cpu.notify_on_migrate |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 101 | |
Steve Kondik | 7005810 | 2015-09-18 04:27:35 -0700 | [diff] [blame] | 102 | # LiveDisplay sysfs |
| 103 | chown system system /sys/devices/virtual/graphics/fb0/aco |
| 104 | chmod 0660 /sys/devices/virtual/graphics/fb0/aco |
| 105 | chown system system /sys/devices/virtual/graphics/fb0/cabc |
| 106 | chmod 0660 /sys/devices/virtual/graphics/fb0/cabc |
| 107 | chown system system /sys/devices/virtual/graphics/fb0/rgb |
| 108 | chmod 0660 /sys/devices/virtual/graphics/fb0/rgb |
| 109 | chown system system /sys/devices/virtual/graphics/fb0/sre |
| 110 | chmod 0660 /sys/devices/virtual/graphics/fb0/sre |
| 111 | |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 112 | # Define TCP delayed ack settings for WiFi & LTE |
| 113 | chown system system /sys/kernel/ipv4/tcp_delack_seg |
| 114 | chown system system /sys/kernel/ipv4/tcp_use_userconfig |
| 115 | setprop net.tcp.delack.default 1 |
| 116 | setprop net.tcp.delack.wifi 20 |
| 117 | setprop net.tcp.delack.lte 8 |
| 118 | setprop net.tcp.usercfg.default 0 |
| 119 | setprop net.tcp.usercfg.wifi 1 |
| 120 | setprop net.tcp.usercfg.lte 1 |
| 121 | |
Steve Kondik | fc5d13a | 2015-09-06 13:53:29 -0700 | [diff] [blame] | 122 | # Persistent properties (only created if persist exists) |
| 123 | mkdir /persist/properties 0770 system system |
| 124 | |
Alberto97 | d3359a0 | 2014-11-30 17:20:55 +0100 | [diff] [blame] | 125 | # sysinit (/system/etc/init.d) |
| 126 | service sysinit /system/bin/sysinit |
| 127 | user root |
| 128 | oneshot |
| 129 | disabled |
Ethan Chen | 6b30a16 | 2015-05-05 12:30:59 -0700 | [diff] [blame] | 130 | |
| 131 | # bugreport is triggered by holding down volume down, volume up and power |
| 132 | service bugreport /system/bin/dumpstate -d -p -B \ |
| 133 | -o /data/data/com.android.shell/files/bugreports/bugreport |
| 134 | oneshot |
| 135 | disabled |
| 136 | keycodes 114 115 116 |
Steve Kondik | b05ac82 | 2015-09-16 15:08:48 -0700 | [diff] [blame] | 137 | |
| 138 | # Configure IO scheduler |
| 139 | on property:sys.io.scheduler=* |
| 140 | write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler} |
| 141 | |
| 142 | on property:persist.sys.io.scheduler=* |
| 143 | setprop sys.io.scheduler ${persist.sys.io.scheduler} |
| 144 | |
| 145 | # Set slice_idle to 0 for CFQ |
| 146 | on property:sys.io.scheduler=cfq |
| 147 | write /sys/block/mmcblk0/queue/iosched/slice_idle 0 |
| 148 | |
| 149 | # Set slice_idle to 0 for BFQ |
| 150 | on property:sys.io.scheduler=bfq |
| 151 | write /sys/block/mmcblk0/queue/iosched/slice_idle 0 |