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 | |
| 8 | on post-fs-data |
| 9 | mkdir /cache/dalvik-cache 0771 system system |
| 10 | chown system system /cache/dalvik-cache |
| 11 | chmod 0771 /cache/dalvik-cache |
Chirayu Desai | ce88540 | 2013-05-12 16:28:01 +0530 | [diff] [blame] | 12 | mkdir /data/.ssh 0750 root shell |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 13 | |
Ricardo Cerqueira | 6698e5e | 2012-11-23 17:15:16 +0000 | [diff] [blame] | 14 | # Run sysinit |
| 15 | start sysinit |
| 16 | |
Ricardo Cerqueira | 79ba997 | 2013-06-12 12:12:18 +0100 | [diff] [blame] | 17 | on boot |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 18 | # interactive governor |
| 19 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 20 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame^] | 21 | chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
| 22 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 23 | chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 24 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 25 | chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 26 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame^] | 27 | chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads |
| 28 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 29 | chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 30 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 31 | chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 32 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 33 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boost |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 34 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 35 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 36 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 37 | chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 38 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 39 | chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 40 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration |
Giulio Cervera | 989a313 | 2013-07-12 17:44:16 +0200 | [diff] [blame] | 41 | chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 42 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy |
Steve Kondik | 9d1a861 | 2014-01-15 01:44:07 +0800 | [diff] [blame] | 43 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 44 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame^] | 45 | chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq |
| 46 | 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] | 47 | 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] | 48 | 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] | 49 | chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 50 | chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor |
Steve Kondik | 9d1a861 | 2014-01-15 01:44:07 +0800 | [diff] [blame] | 51 | |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 52 | # ondemand governor |
| 53 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 54 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 55 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 56 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 57 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 58 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 59 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 60 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 61 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 62 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 63 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 64 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 65 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 66 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 67 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 68 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 69 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 70 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold |
Steve Kondik | 686cbf2 | 2013-10-04 04:31:56 -0700 | [diff] [blame] | 71 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 72 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 73 | 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] | 74 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 75 | 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] | 76 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 77 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 78 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 79 | chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 80 | chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq |
Steve Kondik | f9bb777 | 2013-10-07 23:39:12 -0700 | [diff] [blame] | 81 | 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] | 82 | 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] | 83 | |
| 84 | # Assume SMP uses shared cpufreq policy for all CPUs |
| 85 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 86 | chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 87 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 88 | chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 89 | chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq |
Steve Kondik | b4fb953 | 2014-02-23 21:49:00 +0100 | [diff] [blame] | 90 | chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq |
Giulio Cervera | a76d898 | 2013-05-21 14:23:19 +0200 | [diff] [blame] | 91 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 92 | chown system system /sys/block/mmcblk0/queue/scheduler |
| 93 | chmod 0664 /sys/block/mmcblk0/queue/scheduler |
| 94 | |
Michael Bestas | 7a46cf7 | 2013-10-24 05:04:24 +0300 | [diff] [blame] | 95 | # allow system to modify ksm control files |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 96 | chown root system /sys/kernel/mm/ksm/pages_to_scan |
| 97 | chmod 0664 /sys/kernel/mm/ksm/pages_to_scan |
| 98 | chown root system /sys/kernel/mm/ksm/sleep_millisecs |
| 99 | chmod 0664 /sys/kernel/mm/ksm/sleep_millisecs |
| 100 | chown root system /sys/kernel/mm/ksm/run |
| 101 | chmod 0664 /sys/kernel/mm/ksm/run |
Michael Bestas | 0ccf7ef | 2014-01-10 02:46:18 +0200 | [diff] [blame] | 102 | write /sys/kernel/mm/ksm/sleep_millisecs 500 |
| 103 | write /sys/kernel/mm/ksm/pages_to_scan 100 |
Arne Coucheron | 2cbcab3 | 2014-05-26 05:49:16 +0200 | [diff] [blame] | 104 | write /sys/kernel/mm/ksm/deferred_timer 1 |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 105 | |
Steve Kondik | 6a0f530 | 2013-10-02 11:28:28 -0700 | [diff] [blame] | 106 | chown system system /dev/cpuctl/apps/cpu.notify_on_migrate |
Arne Coucheron | 1a1b4dc | 2014-11-19 01:48:30 +0100 | [diff] [blame^] | 107 | chmod 0664 /dev/cpuctl/apps/cpu.notify_on_migrate |
Steve Kondik | 6a0f530 | 2013-10-02 11:28:28 -0700 | [diff] [blame] | 108 | |
Arne Coucheron | 1f3653e | 2014-05-20 23:52:30 +0200 | [diff] [blame] | 109 | # Define TCP delayed ack settings for WiFi & LTE |
| 110 | chown system system /sys/kernel/ipv4/tcp_delack_seg |
| 111 | chown system system /sys/kernel/ipv4/tcp_use_userconfig |
| 112 | setprop net.tcp.delack.default 1 |
| 113 | setprop net.tcp.delack.wifi 20 |
| 114 | setprop net.tcp.delack.lte 8 |
| 115 | setprop net.tcp.usercfg.default 0 |
| 116 | setprop net.tcp.usercfg.wifi 1 |
| 117 | setprop net.tcp.usercfg.lte 1 |
| 118 | |
Ricardo Cerqueira | 8f412cb | 2012-10-18 16:38:25 +0100 | [diff] [blame] | 119 | # adb over network |
| 120 | on property:service.adb.tcp.port=5555 |
| 121 | stop adbd |
| 122 | start adbd |
| 123 | on property:service.adb.tcp.port=-1 |
| 124 | stop adbd |
| 125 | start adbd |
| 126 | |
Ricardo Cerqueira | 6698e5e | 2012-11-23 17:15:16 +0000 | [diff] [blame] | 127 | # sysinit (/system/etc/init.d) |
| 128 | service sysinit /system/bin/sysinit |
| 129 | user root |
| 130 | oneshot |
Ricardo Cerqueira | 79ba997 | 2013-06-12 12:12:18 +0100 | [diff] [blame] | 131 | disabled |