blob: da6273eb2494fb0bcbbd370db396d75a1be8b818 [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
8on post-fs-data
Chirayu Desaice885402013-05-12 16:28:01 +05309 mkdir /data/.ssh 0750 root shell
Lin Mad32b7412015-05-31 15:55:38 -070010 mkdir /cache/recovery 0770 system cache
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010011
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +000012 # Run sysinit
13 start sysinit
14
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +010015on boot
Giulio Cerveraa76d8982013-05-21 14:23:19 +020016 # interactive governor
17 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010018 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010019 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
20 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Giulio Cerveraa76d8982013-05-21 14:23:19 +020021 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Steve Kondikb4fb9532014-02-23 21:49:00 +010022 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
Giulio Cerveraa76d8982013-05-21 14:23:19 +020023 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010024 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010025 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
26 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
Giulio Cerveraa76d8982013-05-21 14:23:19 +020027 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010028 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020029 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Steve Kondikb4fb9532014-02-23 21:49:00 +010030 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
Giulio Cerveraa76d8982013-05-21 14:23:19 +020031 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010032 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020033 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010034 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020035 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010036 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
Giulio Cerveraa76d8982013-05-21 14:23:19 +020037 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Steve Kondikb4fb9532014-02-23 21:49:00 +010038 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
Giulio Cervera989a3132013-07-12 17:44:16 +020039 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010040 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
Steve Kondik9d1a8612014-01-15 01:44:07 +080041 chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010042 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
Arne Coucheron1a1b4dc2014-11-19 01:48:30 +010043 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
44 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
Steve Kondik9d1a8612014-01-15 01:44:07 +080045 chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010046 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
Steve Kondik9d1a8612014-01-15 01:44:07 +080047 chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010048 chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
Steve Kondik9d1a8612014-01-15 01:44:07 +080049
Giulio Cerveraa76d8982013-05-21 14:23:19 +020050 # ondemand governor
51 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Steve Kondikb4fb9532014-02-23 21:49:00 +010052 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020053 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Steve Kondikb4fb9532014-02-23 21:49:00 +010054 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
Giulio Cerveraa76d8982013-05-21 14:23:19 +020055 chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Steve Kondikb4fb9532014-02-23 21:49:00 +010056 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
Giulio Cerveraa76d8982013-05-21 14:23:19 +020057 chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Steve Kondikb4fb9532014-02-23 21:49:00 +010058 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
Giulio Cerveraa76d8982013-05-21 14:23:19 +020059 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Steve Kondikb4fb9532014-02-23 21:49:00 +010060 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
Giulio Cerveraa76d8982013-05-21 14:23:19 +020061 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Steve Kondikb4fb9532014-02-23 21:49:00 +010062 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
Giulio Cerveraa76d8982013-05-21 14:23:19 +020063 chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Steve Kondikb4fb9532014-02-23 21:49:00 +010064 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
Giulio Cerveraa76d8982013-05-21 14:23:19 +020065 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Steve Kondikb4fb9532014-02-23 21:49:00 +010066 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020067 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondikb4fb9532014-02-23 21:49:00 +010068 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Steve Kondik686cbf22013-10-04 04:31:56 -070069 chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikb4fb9532014-02-23 21:49:00 +010070 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
Steve Kondikf9bb7772013-10-07 23:39:12 -070071 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010072 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070073 chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikb4fb9532014-02-23 21:49:00 +010074 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
Steve Kondikf9bb7772013-10-07 23:39:12 -070075 chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010076 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070077 chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010078 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
Steve Kondikf9bb7772013-10-07 23:39:12 -070079 chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Steve Kondikb4fb9532014-02-23 21:49:00 +010080 chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
Giulio Cerveraa76d8982013-05-21 14:23:19 +020081
82 # Assume SMP uses shared cpufreq policy for all CPUs
83 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Steve Kondikb4fb9532014-02-23 21:49:00 +010084 chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Giulio Cerveraa76d8982013-05-21 14:23:19 +020085 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010086 chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020087 chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Steve Kondikb4fb9532014-02-23 21:49:00 +010088 chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Giulio Cerveraa76d8982013-05-21 14:23:19 +020089
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010090 chown system system /sys/block/mmcblk0/queue/scheduler
91 chmod 0664 /sys/block/mmcblk0/queue/scheduler
Pawit Pornkitprasan24a971a2015-01-03 12:44:43 +070092 restorecon /sys/block/mmcblk0/queue/scheduler
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +010093
Arne Coucheron08297ed2015-04-03 02:01:36 +020094 chown system system /dev/cpuctl/cpu.notify_on_migrate
95 chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
Steve Kondik6a0f5302013-10-02 11:28:28 -070096
Arne Coucheron1f3653e2014-05-20 23:52:30 +020097 # Define TCP delayed ack settings for WiFi & LTE
98 chown system system /sys/kernel/ipv4/tcp_delack_seg
99 chown system system /sys/kernel/ipv4/tcp_use_userconfig
100 setprop net.tcp.delack.default 1
101 setprop net.tcp.delack.wifi 20
102 setprop net.tcp.delack.lte 8
103 setprop net.tcp.usercfg.default 0
104 setprop net.tcp.usercfg.wifi 1
105 setprop net.tcp.usercfg.lte 1
106
Ricardo Cerqueira8f412cb2012-10-18 16:38:25 +0100107# adb over network
108on property:service.adb.tcp.port=5555
109 stop adbd
110 start adbd
111on property:service.adb.tcp.port=-1
112 stop adbd
113 start adbd
114
Dan Pasanen15e432d2015-04-30 17:15:11 -0500115# Disable ril services if noril prop is set
116on property:ro.radio.noril=1
117 stop ril-daemon
118 stop qmuxd
119 stop netmgrd
120
Dan Pasanen374ca9d2015-04-30 17:16:07 -0500121on property:persist.radio.noril=1
122 setprop ro.radio.noril 1
123
Steve Kondik26731f52015-09-07 16:42:00 -0700124# Configure IO scheduler
125on property:sys.io.scheduler=*
126 write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
127
128on property:persist.sys.io.scheduler=*
129 setprop sys.io.scheduler ${persist.sys.io.scheduler}
130
Ricardo Cerqueira6698e5e2012-11-23 17:15:16 +0000131# sysinit (/system/etc/init.d)
132service sysinit /system/bin/sysinit
133 user root
134 oneshot
Ricardo Cerqueira79ba9972013-06-12 12:12:18 +0100135 disabled
Ethan Chen3866f702015-05-05 12:30:59 -0700136
137# bugreport is triggered by holding down volume down, volume up and power
138service bugreport /system/bin/dumpstate -d -p -B \
139 -o /data/data/com.android.shell/files/bugreports/bugreport
140 oneshot
141 disabled
142 keycodes 114 115 116