[Nexus 6 Android Development] jcrompton:
Thank you

I'll try the su/su.d thing ... but it seems like this caused a bootloop once before as well

Here is script:

#!/system/bin/sh

# Values/Fields taken from UKM's UCI output

# Valid CPU Frequency Options

# 35800:"35 MHz", 98300:"98 MHz", 223200:"223 MHz", 300000:"300 MHz", 422400:"422 MHz", 652800:"652 MHz",

# 729600:"729 MHz", 883200:"883 MHz", 960000:"960 MHz", 1036800:"1036 MHz", 1190400:"1190 MHz", 1267200:"1267 MHz",

# 1497600:"1497 MHz", 1574400:"1574 MHz", 1728000:"1728 MHz", 1958400:"1958 MHz", 2265600:"2265 MHz", 2419200:"2419 MHz",

# 2496000:"2496 MHz", 2572800:"2572 MHz", 2649600:"2649 MHz", 2726400:"2726 MHz", 2803200:"2803 MHz", 2880000:"2880 MHz",

# 2956800:"2956 MHz", 3033600:"3033 MHz", 3091200:"3091 MHz",

# Valid Governor Options

# "zzmoove", "xperience", "umbrella_core", "tripndroid", "smartmax_eps", "ragingmolasses", "preservative", "ondemand_eps",

# "nightmare", "lulzactive", "impulse", "hyper", "hellsactive", "elementalx", "dyninteractive", "despair", "conservativex",

# "blu_active", "barry_allen", "adaptive", "conservative", "wave", "bioshock", "performance",

# Setup MSM_LIMITER

#

# MSM Limiter Enable/Disbale. Valid values: 0 (off) or 1 (on)

# If limiter is disabled, set cpufreq in the legacy location.

echo 1 > /sys/kernel/msm_limiter/limiter_enabled

# MSM Limiter Governor. Valid Values: Any valid governor name

echo umbrella_core > /sys/kernel/msm_limiter/scaling_governor

echo umbrella_core > /sys/kernel/msm_limiter/scaling_governor_0

echo umbrella_core > /sys/kernel/msm_limiter/scaling_governor_1

echo umbrella_core > /sys/kernel/msm_limiter/scaling_governor_2

echo umbrella_core > /sys/kernel/msm_limiter/scaling_governor_3

# MSM Limiter Resume max Freq. Valid Values: Any valid frequency

echo 3091200 > /sys/kernel/msm_limiter/resume_max_freq

echo 3091200 > /sys/kernel/msm_limiter/resume_max_freq_0

echo 3091200 > /sys/kernel/msm_limiter/resume_max_freq_1

echo 3091200 > /sys/kernel/msm_limiter/resume_max_freq_2

echo 3091200 > /sys/kernel/msm_limiter/resume_max_freq_3

# MSM Limiter Suspend Max Freq. Valid Values: Any valid frequency

echo 729600 > /sys/kernel/msm_limiter/suspend_max_freq

# MSM Limiter Suspend Min Freq. Valid Values: Any valid frequency

echo 35800 > /sys/kernel/msm_limiter/suspend_min_freq

echo 35800 > /sys/kernel/msm_limiter/suspend_min_freq_0

echo 35800 > /sys/kernel/msm_limiter/suspend_min_freq_1

echo 35800 > /sys/kernel/msm_limiter/suspend_min_freq_2

echo 35800 > /sys/kernel/msm_limiter/suspend_min_freq_3

# CPU Governor - Legacy location. Uncomment this line if disabling MSM_Limiter to set your cpu governor

# echo elementalx > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# Configure CPU BOOST

#

# Boost Time. Valid values: 0-5000

echo 1500 > /sys/module/cpu_boost/parameters/boost_ms

# Sync Threshold. Valid values: 0 for disabled, or a valid cpu frequency.

echo 0 > /sys/module/cpu_boost/parameters/sync_threshold

# Input Boost. Valid Values: 0-5000

echo 1500 > /sys/module/cpu_boost/parameters/input_boost_ms

# Min Input Interval. Valid Values: 100-1500

echo 0 > /sys/module/cpu_boost/parameters/min_input_interval

# Load Based Syncs. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/cpu_boost/parameters/load_based_syncs

# Migration Load Threshhold. Valid Values: 0-100

echo 40 > /sys/module/cpu_boost/parameters/migration_load_threshold

# Hotplug Boost. Valid values: 0 (off) or 1 (on)

echo 0 > /sys/module/cpu_boost/parameters/hotplug_boost

# WakeUp Boost. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/cpu_boost/parameters/wakeup_boost

#Power Efficient Workqueues. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/workqueue/parameters/power_efficient

# Choose Hotplug. Only set one of the following to 1. All others must be 0.

echo 0 > /sys/kernel/intelli_plug/intelli_plug_active

echo 1 > /sys/module/blu_plug/parameters/enabled

echo 0 > /sys/devices/virtual/misc/mako_hotplug_control/enabled

echo 0 > /sys/module/autosmp/parameters/enabled

echo 0 > /sys/kernel/zen_decision/enabled

# Intelliplug Tunales.

#

# Debug IntellinPlug. No reason to set to anything other than 0.

echo 0 > /sys/kernel/intelli_plug/debug_intelli_plug

# Intelliplug Profile. Valid Values: 0:"Balanced", 1:"Performance", 2:"Conservative", 3:"Disabled", 4:"Tri", 5:"Eco", 6:"Strict"

echo 0 > /sys/kernel/intelli_plug/full_mode_profile

# Number of CPUs Boosted at once. Valid Values 0-4

echo 0 > /sys/kernel/intelli_plug/cpus_boosted

# Hysteris Value. Valid Values: 0-16

echo 4 > /sys/kernel/intelli_plug/nr_run_hysteresis

# Min CPUs Online. Valid Values 1-4

echo 1 > /sys/kernel/intelli_plug/min_cpus_online

# Max CPUs Online. Valid Values 1-4

echo 4 > /sys/kernel/intelli_plug/max_cpus_online

# Max CPUs while screen is off. Valid Values: 1-4

echo 4 > /sys/kernel/intelli_plug/max_cpus_online_susp

# Susped Defer Timer. Valid Values: 0-5000

echo 10 > /sys/kernel/intelli_plug/suspend_defer_time

# Defer Sampling. Valid Values 0-1000

echo 200 > /sys/kernel/intelli_plug/def_sampling_ms

# Boost Lock Duration. Valid Values: 1-5000

echo 2500 > /sys/kernel/intelli_plug/boost_lock_duration

# Down Lock Duration. Valid Values: 1-5000

echo 2500 > /sys/kernel/intelli_plug/down_lock_duration

# Threshold Value. Valid Values: 0-1000

echo 950 > /sys/kernel/intelli_plug/cpu_nr_run_threshold

# FShift. Valid Values: 0-3

echo 3 > /sys/kernel/intelli_plug/nr_fshift

# Blu_Plug Tunables.

#

# Minimum Online CPUs. Valid Values: 1-4

echo 1 > /sys/module/blu_plug/parameters/min_online

# Maximum Online CPU. Valid Values: 1-4

echo 4 > /sys/module/blu_plug/parameters/max_online

# Maximum CPUs while screen off. Valid Values: 1-4

echo 1 > /sys/module/blu_plug/parameters/max_cores_screenoff

# Maximum Frequency while Screen off. Valid Values: 0 (Disabled) or Any valid CPU freq.

echo 0 > /sys/module/blu_plug/parameters/max_freq_screenoff

# Up Threshold. Valid Values: 0-100

echo 80 > /sys/module/blu_plug/parameters/up_threshold

# Up Timer Control. Valid Values: 0-20

echo 2 > /sys/module/blu_plug/parameters/up_timer_cnt

# Down Timer Control. Valid Values: 0-20

echo 6 > /sys/module/blu_plug/parameters/down_timer_cnt

# MAKO Hotplug Tunables

#

# CPU Freq unplug Limit. Valid Values: Any valid CPU Freq.

echo 1267200 > /sys/devices/virtual/misc/mako_hotplug_control/cpufreq_unplug_limit

# High Load Counter. Valid Values: 0-100

echo 10 > /sys/devices/virtual/misc/mako_hotplug_control/high_load_counter

# Load Threshold. Valid Values: 0-100

echo 80 > /sys/devices/virtual/misc/mako_hotplug_control/load_threshold

# Max Load Counter. Valid Values: 0-100

echo 20 > /sys/devices/virtual/misc/mako_hotplug_control/max_load_counter

# Min Time CPU online. Valid Values: 0-100

echo 1 > /sys/devices/virtual/misc/mako_hotplug_control/min_time_cpu_online

# Timer. Valid Values: 0-100

echo 1 > /sys/devices/virtual/misc/mako_hotplug_control/timer

# AutoSMP Tunables

#

# Screen Off Single Core. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/kernel/autosmp/conf/scroff_single_core

# Min CPUs online. Valid Values: 1-4

echo 4 > /sys/kernel/autosmp/conf/min_cpus

# Max CPUs online. Valid Values: 1-4

echo 4 > /sys/kernel/autosmp/conf/max_cpus

# CPU Frequency Down. Valid Values: 0-100

echo 20 > /sys/kernel/autosmp/conf/cpufreq_down

# CPU Frequency Up. Valid Values: 0-100

echo 80 > /sys/kernel/autosmp/conf/cpufreq_up

# Cycle Up. Valid Values: 0-3

echo 1 > /sys/kernel/autosmp/conf/cycle_up

# Cycle Down. Valid Values: 0-3

echo 3 > /sys/kernel/autosmp/conf/cycle_down

# Delay. Valid Values: 0-500

echo 400 > /sys/kernel/autosmp/conf/delay

# Thermal Tunables

#

# Temperature Threshold. Valid Values 40-90

echo 70 > /sys/module/msm_thermal/parameters/temp_threshold

# Temperature Threshold Step. Valid Values: 1-6

echo 4 > /sys/module/msm_thermal/parameters/temp_step

# First stage Limiting Frequency. Valid Values: Any valid CPU freq

echo 2265600 > /sys/module/msm_thermal/parameters/freq_warm

# Second stage Limiting Frequency. Valid Values: Any valid CPU freq

echo 1728000 > /sys/module/msm_thermal/parameters/freq_hot

# Third stage Limiting Frequency. Valid Values: Any valid CPU freq

echo 1267200 > /sys/module/msm_thermal/parameters/freq_very_hot

# Fourth stage Limiting Frequency. Valid Values: Any valid CPU freq

echo 960000 > /sys/module/msm_thermal/parameters/freq_hell

# Polling Interval. Valid Values: 250000-3000000

echo 1000000 > /sys/module/msm_thermal/parameters/poll_interval

# I/O Controls

#

# Read-Ahead Size. Valid Values: 128-4096

echo 2048 > /sys/block/mmcblk0/queue/read_ahead_kb

# I/O Scheduler. Valid Values: "cfq", "deadline", "fiops", "noop", "row", "sio", "sioplus", "tripndroid", "vr", "zen",

echo row > /sys/block/mmcblk0/queue/scheduler

# Add Random. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/block/mmcblk0/queue/add_random

# I/O Statistics. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/block/mmcblk0/queue/iostats

# Treat Device as Rotational Storage. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/block/mmcblk0/queue/rotational

# No Merges. Valid Values: 0:"All", 1:"Simple Only", 2:"None"

echo 0 > /sys/block/mmcblk0/queue/nomerges

# RQ Affitinity. Valid Values: 0:"Disabled", 1:"Enabled", 2:"Aggressive"

echo 2 > /sys/block/mmcblk0/queue/rq_affinity

# NR Requests. Valid Values: 128-2048

echo 2048 > /sys/block/mmcblk0/queue/nr_requests

# GPU Tunables

#

# Valid Power Levels: 10:"700 MHz", 9:"600 MHz", 8:"500 MHz", 7:"430 MHz", 6:"389 MHz", 5:" MHz", 4:"300 MHz", 3:"240 MHz", 2:"160 MHz", 1:"80 MHz",

# Valid Frequencies: 80000000:"80 MHz", 160000000:"160 MHz", 240000000:"240 MHz", 300000000:"300 MHz", 389000000:"389 MHz",

# 430000000:"430 MHz", 500000000:"500 MHz", 600000000:"600 MHz", 700000000:"700 MHz,

#

# GPU Min Freq. Valid Values: 1-10 (corresponding to Valid Power Levels)

echo 1 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel

# GPU Max Freq. Valid Values: Any Valid GPU Freq.

echo 700000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk

# GPU Governor. Valid Values: "cache_hwmon", "cpubw_hwmon", "userspace", "performance", "powersave", "msm-adreno-tz", "simple_ondemand", "msm_cpufreq"

echo msm-adreno-tz > /sys/devices/fdb00000.qcom,kgsl-3d0/devfreq/fdb00000.qcom,kgsl-3d0/governor

# Simple GPU Governor Tuneables. (These affect msm-adreno-tz)

#

# Enable. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/module/simple_gpu_algorithm/parameters/simple_gpu_activate

# Laziness. Valid Values: 0-10

echo 4 > /sys/module/simple_gpu_algorithm/parameters/simple_laziness

# Ramp Threshold. Valid Values: 0-10000

echo 5000 > /sys/module/simple_gpu_algorithm/parameters/simple_ramp_threshold

# Adreno Idler Tunables. (These affect msm-adreno-tz)

#

# Enable. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/adreno_idler/parameters/adreno_idler_active

# Down Differential

echo 25 > /sys/module/adreno_idler/parameters/adreno_idler_downdifferential

# Idle Wait.

echo 25 > /sys/module/adreno_idler/parameters/adreno_idler_idlewait

# Idle Workload.

echo 6000 > /sys/module/adreno_idler/parameters/adreno_idler_idleworkload

# KCAL

#

# Enable. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/devices/platform/kcal_ctrl.0/kcal_enable

# KCAL RGB Values. Valid Values: 0-256

echo 256 256 256 > /sys/devices/platform/kcal_ctrl.0/kcal

# Inverted Colors. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/devices/platform/kcal_ctrl.0/kcal_invert

# KCAL Minimum allowed value. Valid Values: 0-255

echo 35 > /sys/devices/platform/kcal_ctrl.0/kcal_min

# Contrast. Valid Values: 128-383

echo 255 > /sys/devices/platform/kcal_ctrl.0/kcal_cont

# Hue. Valid Values: 0-1536

echo 0 > /sys/devices/platform/kcal_ctrl.0/kcal_hue

# Saturation. Valid Values: 128-383

echo 255 > /sys/devices/platform/kcal_ctrl.0/kcal_sat

# Value. Valid Values: 128-383

echo 255 > /sys/devices/platform/kcal_ctrl.0/kcal_val

# Memory

#

# Z-Ram Disk Size. Valid Values: 0-1024 ( Our Device has 3gb of ram... We probably don't need a Z-RAM disk)

echo 1024 > /sys/devices/virtual/block/zram0/disksize

# Virtual Memory

#

# VM Dirty Background Ratio. Valid Values: 0-100

echo 10 > /proc/sys/vm/dirty_background_ratio

# VM Dirty Ratio. Valid Values: 0-100

echo 20 > /proc/sys/vm/dirty_ratio

# Dirty Expire Centisecs. Valid Values: 10-5000

echo 200 > /proc/sys/vm/dirty_expire_centisecs

# Dirty Writeback Centisecs. Valid Values: 0-9000

echo 400 > /proc/sys/vm/dirty_writeback_centisecs

# Drop Caches. Valid Values: 0 (off) or 1 (on) (Warning: Enabling this can delay your boot until it finishes)

echo 1 > /proc/sys/vm/drop_caches

# Laptop Mode. Valid Values: 0 (off) or 1 (on)

echo 1 > /proc/sys/vm/laptop_mode

# Swappiness. Valid Values: 0-100

echo 40 > /proc/sys/vm/swappiness

# VFS Cache Pressure. Valid Values: 0-150

echo 60 > /proc/sys/vm/vfs_cache_pressure

# Wake Gestures

#

# DoubleTap2Wake. Valid Values: 0:"Disabled", 1:"Center (Default)", 2:"Full", 3:"Bottom half", 4:"Top half"

echo 1 > /sys/android_touch/doubletap2wake

# DoubleTap2Wake Timeout. Valid Values: 25-100

echo 50 > /sys/android_touch/dt2w_time

# DoubleTap2Wake Feather (X Axis). Valid Values: 1-500

echo 150 > /sys/android_touch/dt2w_feather_x

# DoubeTap2Wake Feather (Y Axis). Valid Values: 1-500

echo 150 > /sys/android_touch/dt2w_feather_y

#

# Sweep2Wake. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/android_touch/sweep2wake

# Sweep2Sleep. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/android_touch/sweep2sleep

# Sweep2Wake Timeout. Valid Values: 1-200

echo 30 > /sys/android_touch/sweep_timeout

# Vibrator Strength for wake controls. Values: 0-90

echo 90 > /sys/android_touch/vib_strength

# MISC

#

# TCP Congestion Control. Valid Values: "illinois", "reno", "bic", "cdg", "cubic", "highspeed",

# "htcp", "hybla", # "lp", "scalable", "sociopath", "vegas", "veno", "yeah"

echo illinois > /proc/sys/net/ipv4/tcp_congestion_control

# Vibrator Strength PWM. Valid Values: 1-127

echo 127 > /sys/vibrator/pwmvalue

# FrameBuffer Notifiers. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/state_notifier/parameters/use_fb_notifier

# USB Fast Charge. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/kernel/fast_charge/force_fast_charge

# Wakelocks. Valid Values: 0 (off) or 1 (on) (1 Will let the wakelock happen.)

# MSM_HSIC Wakelock

echo 0 > /sys/module/wakeup/parameters/enable_msm_hsic_ws

# Valid Values: 0-8

echo 1 > /sys/module/xhci_hcd/parameters/wl_divide

# BlueSleep Wakelock

echo 0 > /sys/module/wakeup/parameters/enable_bluesleep_ws

# SensorIND Wakelock

echo 1 > /sys/module/wakeup/parameters/enable_si_ws

# SMB135x Wakelock

echo 0 > /sys/module/wakeup/parameters/enable_smb135x_wake_ws

# WLAN Ctrl Wakelock

echo 1 > /sys/module/wakeup/parameters/enable_wlan_ctrl_wake_ws

# WLAN RX Wakelock

echo 1 > /sys/module/wakeup/parameters/enable_wlan_rx_wake_ws

# WLAN Wakelock

echo 1 > /sys/module/wakeup/parameters/enable_wlan_wake_ws

# BCMD Wakelock Divisor. 1 = Stock Value, Higher = Lower Wake Time

echo 2 > /sys/module/bcmdhd/parameters/wl_divide

# Advanced

#

# Krait C-States

# C0 (WFI). Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/msm_pm/modes/cpu0/wfi/idle_enabled wfi

# C1 (Retention). Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/msm_pm/modes/cpu0/retention/idle_enabled retention

# C2 (Stand Alone Power Collapse). Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled standalone_power_collapse

# C3 (Power Collapse). Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled power_collapse

# Ultra Kernel Samepage Merging

# Enable. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/kernel/mm/uksm/run

# Sleep. Valid Values: 0- 3000

echo 800 > /sys/kernel/mm/uksm/sleep_millisecs

# CPU Usage Governor. Valid Values: "full", "medium", "low", "quiet"

echo full > /sys/kernel/mm/uksm/cpu_governor

# Max CPU Consumption. Valid Values: 10-99

echo 80 > /sys/kernel/mm/uksm/max_cpu_percentage

# Gentle Fair Sleepers. Valid Values: 0 (off) or 1 (on)

echo 0 > /sys/kernel/sched/gentle_fair_sleepers

# Arch Power. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/kernel/sched/arch_power

# Adaptive LMK

#

# Enable. Valid Values: 0 (off) or 1 (on)

echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk

# VMPressure File Min. Valid Values: 0-100

echo 80 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min

# LMK Settings. Values from UKM Profiles:

# Low	MINFREE="1536,2048,2560,8192,16384,20480" COST="64"

# Medium MINFREE="1536,2048,4096,16384,18432,20480" COST="48"

# Default MINFREE="1536,2048,4096,16384,28672,32768" COST="32"

# Aggressive	MINFREE="2048,4096,4096,16384,32768,49152" COST="16"

# Exterminate MINFREE="4096,8192,16384,19200,49152,65536" COST="16"

echo 2048,4096,4096,16384,32768,49152 > /sys/module/lowmemorykiller/parameters/minfree

echo 16 > /sys/module/lowmemorykiller/parameters/cost

# Build.prop Tweaks --- Uncomment to use these, otherwise they're disabled.

#Wifi Scan Interval. Value is in seconds

setprop wifi.supplicant_scan_interval 300

# VM Heapsize. Size is in MB

setprop dalvik.vm.heapsize 1024

# Allow Purging of Assets. Valid Values: 0 (off) or 1 (on)

setprop persist.sys.purgeable_assets 1

# Selinux toggle. Valid Values: 0 (Permissive) or 1 (Enforcing) --- Uncomment to use

setenforce 0

echo "Finished Setting Values"