2010-07-07 13:06:13 +00:00
|
|
|
# CyanogenMod Extras
|
2013-07-28 02:52:40 +00:00
|
|
|
import /init.superuser.rc
|
2010-07-07 13:06:13 +00:00
|
|
|
|
2012-10-18 15:38:25 +00:00
|
|
|
on init
|
|
|
|
export ANDROID_CACHE /cache
|
|
|
|
export TERMINFO /system/etc/terminfo
|
|
|
|
|
2015-09-08 06:23:10 +00:00
|
|
|
# Set up the BFQIO hierarchy
|
|
|
|
chmod 0755 /sys/fs/cgroup
|
|
|
|
mkdir /sys/fs/cgroup/bfqio 0755 root system
|
2015-09-19 19:41:38 +00:00
|
|
|
mount cgroup none /sys/fs/cgroup/bfqio bfqio
|
2015-09-08 06:23:10 +00:00
|
|
|
chown root system /sys/fs/cgroup/bfqio/tasks
|
|
|
|
chmod 0666 /sys/fs/cgroup/bfqio/tasks
|
|
|
|
|
2015-09-21 03:58:43 +00:00
|
|
|
# Soft realtime class for display service
|
2015-09-08 06:23:10 +00:00
|
|
|
mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
|
2015-09-16 22:08:48 +00:00
|
|
|
write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
|
2015-09-08 06:23:10 +00:00
|
|
|
write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
|
2015-09-20 10:33:31 +00:00
|
|
|
chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
|
2015-09-08 06:23:10 +00:00
|
|
|
chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
|
|
|
|
|
2012-10-18 15:38:25 +00:00
|
|
|
on post-fs-data
|
2013-05-12 10:58:01 +00:00
|
|
|
mkdir /data/.ssh 0750 root shell
|
2015-05-31 22:55:38 +00:00
|
|
|
mkdir /cache/recovery 0770 system cache
|
2012-10-18 15:38:25 +00:00
|
|
|
|
2012-11-23 17:15:16 +00:00
|
|
|
# Run sysinit
|
|
|
|
start sysinit
|
|
|
|
|
2013-06-12 11:12:18 +00:00
|
|
|
on boot
|
2013-05-21 12:23:19 +00:00
|
|
|
# interactive governor
|
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
|
2014-11-19 00:48:30 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
|
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
|
2014-11-19 00:48:30 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
|
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
|
2013-07-12 15:44:16 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
|
2014-01-14 17:44:07 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
|
2014-11-19 00:48:30 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
|
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
|
2014-01-14 17:44:07 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
|
2014-01-14 17:44:07 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
|
2014-01-14 17:44:07 +00:00
|
|
|
|
2013-05-21 12:23:19 +00:00
|
|
|
# ondemand governor
|
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
|
2013-05-21 12:23:19 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
|
2013-10-04 11:31:56 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
|
2013-10-08 06:39:12 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
|
2013-10-08 06:39:12 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
|
2013-10-08 06:39:12 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
|
2013-10-08 06:39:12 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
|
2013-10-08 06:39:12 +00:00
|
|
|
chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
|
2014-02-23 20:49:00 +00:00
|
|
|
chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
|
2013-05-21 12:23:19 +00:00
|
|
|
|
2012-10-18 15:38:25 +00:00
|
|
|
chown system system /sys/block/mmcblk0/queue/scheduler
|
|
|
|
chmod 0664 /sys/block/mmcblk0/queue/scheduler
|
2015-01-03 05:44:43 +00:00
|
|
|
restorecon /sys/block/mmcblk0/queue/scheduler
|
2012-10-18 15:38:25 +00:00
|
|
|
|
2015-04-03 00:01:36 +00:00
|
|
|
chown system system /dev/cpuctl/cpu.notify_on_migrate
|
|
|
|
chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
|
2013-10-02 18:28:28 +00:00
|
|
|
|
2015-09-18 11:27:35 +00:00
|
|
|
# LiveDisplay sysfs
|
|
|
|
chown system system /sys/devices/virtual/graphics/fb0/aco
|
|
|
|
chmod 0660 /sys/devices/virtual/graphics/fb0/aco
|
|
|
|
chown system system /sys/devices/virtual/graphics/fb0/cabc
|
|
|
|
chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
|
|
|
|
chown system system /sys/devices/virtual/graphics/fb0/rgb
|
|
|
|
chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
|
|
|
|
chown system system /sys/devices/virtual/graphics/fb0/sre
|
|
|
|
chmod 0660 /sys/devices/virtual/graphics/fb0/sre
|
|
|
|
|
2014-05-20 21:52:30 +00:00
|
|
|
# Define TCP delayed ack settings for WiFi & LTE
|
|
|
|
chown system system /sys/kernel/ipv4/tcp_delack_seg
|
|
|
|
chown system system /sys/kernel/ipv4/tcp_use_userconfig
|
|
|
|
setprop net.tcp.delack.default 1
|
|
|
|
setprop net.tcp.delack.wifi 20
|
|
|
|
setprop net.tcp.delack.lte 8
|
|
|
|
setprop net.tcp.usercfg.default 0
|
|
|
|
setprop net.tcp.usercfg.wifi 1
|
|
|
|
setprop net.tcp.usercfg.lte 1
|
|
|
|
|
2015-09-06 20:53:29 +00:00
|
|
|
# Persistent properties (only created if persist exists)
|
|
|
|
mkdir /persist/properties 0770 system system
|
|
|
|
|
2015-09-16 22:08:48 +00:00
|
|
|
# sysinit (/system/etc/init.d)
|
|
|
|
service sysinit /system/bin/sysinit
|
|
|
|
user root
|
|
|
|
oneshot
|
|
|
|
disabled
|
|
|
|
|
|
|
|
# bugreport is triggered by holding down volume down, volume up and power
|
|
|
|
service bugreport /system/bin/dumpstate -d -p -B \
|
|
|
|
-o /data/data/com.android.shell/files/bugreports/bugreport
|
|
|
|
oneshot
|
|
|
|
disabled
|
|
|
|
keycodes 114 115 116
|
|
|
|
|
2012-10-18 15:38:25 +00:00
|
|
|
# adb over network
|
|
|
|
on property:service.adb.tcp.port=5555
|
|
|
|
stop adbd
|
|
|
|
start adbd
|
2015-09-16 22:08:48 +00:00
|
|
|
|
2012-10-18 15:38:25 +00:00
|
|
|
on property:service.adb.tcp.port=-1
|
|
|
|
stop adbd
|
|
|
|
start adbd
|
|
|
|
|
2015-04-30 22:15:11 +00:00
|
|
|
# Disable ril services if noril prop is set
|
|
|
|
on property:ro.radio.noril=1
|
|
|
|
stop ril-daemon
|
|
|
|
stop qmuxd
|
|
|
|
stop netmgrd
|
|
|
|
|
2015-04-30 22:16:07 +00:00
|
|
|
on property:persist.radio.noril=1
|
|
|
|
setprop ro.radio.noril 1
|
|
|
|
|
2015-09-07 23:42:00 +00:00
|
|
|
# Configure IO scheduler
|
|
|
|
on property:sys.io.scheduler=*
|
|
|
|
write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
|
|
|
|
|
|
|
|
on property:persist.sys.io.scheduler=*
|
|
|
|
setprop sys.io.scheduler ${persist.sys.io.scheduler}
|
|
|
|
|
2015-09-16 22:08:48 +00:00
|
|
|
# Set slice_idle to 0 for CFQ
|
|
|
|
on property:sys.io.scheduler=cfq
|
|
|
|
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
|
2015-05-05 19:30:59 +00:00
|
|
|
|
2015-09-16 22:08:48 +00:00
|
|
|
# Set slice_idle to 0 for BFQ
|
|
|
|
on property:sys.io.scheduler=bfq
|
2015-09-18 11:27:35 +00:00
|
|
|
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
|
|
|
|
|