[Android Q&A, Help & Troubleshooting] Williamsss:
So I have a script I am working on and it all works expect for one line and I can figure out what is going on! I would love some advice. Anyways, here is the part that isnt working.

##SCHEDULER
if [ "$SCHED" == "bfq" ]; then
echo bfq > /sys/block/mmcblk0/queue/scheduler;
echo BFQ io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "cfq" ]; then
echo cfq > /sys/block/mmcblk0/queue/scheduler;
echo CFQ io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "deadline" ]; then
echo deadline > /sys/block/mmcblk0/queue/scheduler;
echo deadline io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "fifo" ]; then
echo fifo > /sys/block/mmcblk0/queue/scheduler;
echo FIFO io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "fiops" ]; then
echo fiops > /sys/block/mmcblk0/queue/scheduler;
echo FIOPS io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "sio" ]; then
echo sio > /sys/block/mmcblk0/queue/scheduler;
echo SIO io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "tripndroid" ]; then
echo tripndroid > /sys/block/mmcblk0/queue/scheduler;
echo tripndroid io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "vr" ]; then
echo vr > /sys/block/mmcblk0/queue/scheduler;
echo VR io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "zen" ]; then
echo zen > /sys/block/mmcblk0/queue/scheduler;
echo ZEN io scheduler >> $UBER_LOGFILE;
else
echo row > /sys/block/mmcblk0/queue/scheduler;
echo ROW io scheduler >> $UBER_LOGFILE;
fi

So I have SCHED set to bfq in

. /system/etc/uber.cfg\

However BFQ doesnt get set as the Scheduler. HOWEVER, (This is the confusing part), BFQ io scheduler is placed in the Uber log as if the command ran. so I went to /sys/block/mmcblk0/queue/scheduler and made sure that the file was there. and i deleted all the other scirpts so it is the only one. I have no apps on the device, just the rom gapps and the script. And the Set on boot command in settings menu is uncheck for all of the kernel settings. So I am super confused on what is happening here.

Device: Nexus 5

Rom: Custom Vanir

Kernel: Uber

Rest of Script:

#!/system/bin/sh
UBER_LOGFILE="/data/local/tmp/uber.log"
UBER_CFG="/system/etc/uber.cfg"
. /system/etc/uber.cfg\

if [ -f $UBER_LOGFILE ]; then
mv $UBER_LOGFILE $UBER_LOGFILE.2;
fi
echo $(date) >> $UBER_LOGFILE

if $ENABLED; then

##FRANDOM
if $FRANDOM; then
chmod 644 /dev/frandom
chmod 644 /dev/erandom
mv /dev/random /dev/random.ori
mv /dev/urandom /dev/urandom.ori
ln /dev/frandom /dev/random
chmod 644 /dev/random
ln /dev/erandom /dev/urandom
chmod 644 /dev/urandom
echo Frandom On >> $UBER_LOGFILE;
else
echo Frandom Off >> $UBER_LOGFILE;
fi

##FILE SYSTEM TRIM
if $FSTRIM; then
fstrim -v /cache| tee -a $UBER_LOGFILE;
fstrim -v /data| tee -a $UBER_LOGFILE;
echo Fstrim On >> $UBER_LOGFILE;
else
echo Fstrim Off >> $UBER_LOGFILE;
fi

##COLOR PRESET
if $COLORS; then
# Red Positive = /sys/module/dsi_panel/kgamma_rp
echo "0 12 19 30 39 48 56 72 83 105 118 126 121 114 109 102 93 73 63 54 40 33 20" > /sys/module/dsi_panel/kgamma_rp
# Red Negative = /sys/module/dsi_panel/kgamma_rn
echo "0 12 19 30 39 48 56 72 83 105 118 130 121 115 114 102 82 76 63 54 40 33 20" > /sys/module/dsi_panel/kgamma_rn
# Green Positive = /sys/module/dsi_panel/kgamma_gp
echo "0 12 19 30 39 54 61 78 84 107 123 132 117 110 108 97 90 71 61 52 45 37 21" > /sys/module/dsi_panel/kgamma_gp
# Green Negative = /sys/module/dsi_panel/kgamma_gn
echo "0 12 19 30 39 54 61 78 84 107 121 130 119 112 107 99 76 72 57 50 45 37 21" > /sys/module/dsi_panel/kgamma_gn
# Blue Positive = /sys/module/dsi_panel/kgamma_bp
echo "0 12 19 30 39 48 56 72 83 105 121 126 119 112 107 99 91 71 63 53 44 36 22" > /sys/module/dsi_panel/kgamma_bp
# Blue Negative = /sys/module/dsi_panel/kgamma_bn
echo "0 12 19 30 39 48 56 72 83 105 121 134 119 113 110 98 78 72 59 50 44 36 22" > /sys/module/dsi_panel/kgamma_bn
# White Point = /sys/module/dsi_panel/kgamma_w
echo "28" > /sys/module/dsi_panel/kgamma_w
echo Colors Cl3Keners Fav >> $UBER_LOGFILE;
else
echo Stock Colors >> $UBER_LOGFILE;
fi

##FRANCO/FAUX SOUND CONTROL
if [ "$SOUND" == "franco" ]; then
echo $CALL >> /sys/devices/virtual/misc/soundcontrol/headset_boost;
echo $MIC >> /sys/devices/virtual/misc/soundcontrol/mic_boost;
echo $SPEAKER >> /sys/devices/virtual/misc/soundcontrol/speaker_boost;
echo $VOLUME >> /sys/devices/virtual/misc/soundcontrol/volume_boost;
echo Franco Sound >> $UBER_LOGFILE;
fi
if [ "$SOUND" == "faux" ]; then
echo "$FCAM" > /sys/kernel/sound_control_3/gpl_cam_mic_gain
echo "$FHEAD $FHEAD" > /sys/kernel/sound_control_3/gpl_headphone_gain
echo "$FPOW $FPOW" > /sys/kernel/sound_control_3/gpl_headphone_pa_gain
echo "$FMIC" > /sys/kernel/sound_control_3/gpl_mic_gain
echo "$FLOCK" > /sys/kernel/sound_control_3/gpl_sound_control_locked
echo "$FSPEAKER $FSPEAKER" > /sys/kernel/sound_control_3/gpl_speaker_gain
echo Faux Sound >> $UBER_LOGFILE;

else
echo Stock Sound >> $UBER_LOGFILE;
fi

##BACKLIGHT
if $BACKLIGHT; then
echo 1 > /sys/module/lm3630_bl/parameters/backlight_dimmer
echo Backlight Dimmer Enabled >> $UBER_LOGFILE;
else
echo Backlight Dimmer Disabled >> $UBER_LOGFILE;
fi

##KSM
if $KSM; then
echo "1" > /sys/kernel/mm/ksm/run
echo KSM On >> $UBER_LOGFILE;
else
echo KSM Off >> $UBER_LOGFILE;
fi

##SCHEDULER
if [ "$SCHED" == "bfq" ]; then
echo bfq > /sys/block/mmcblk0/queue/scheduler;
echo BFQ io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "cfq" ]; then
echo cfq > /sys/block/mmcblk0/queue/scheduler;
echo CFQ io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "deadline" ]; then
echo deadline > /sys/block/mmcblk0/queue/scheduler;
echo deadline io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "fifo" ]; then
echo fifo > /sys/block/mmcblk0/queue/scheduler;
echo FIFO io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "fiops" ]; then
echo fiops > /sys/block/mmcblk0/queue/scheduler;
echo FIOPS io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "sio" ]; then
echo sio > /sys/block/mmcblk0/queue/scheduler;
echo SIO io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "tripndroid" ]; then
echo tripndroid > /sys/block/mmcblk0/queue/scheduler;
echo tripndroid io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "vr" ]; then
echo vr > /sys/block/mmcblk0/queue/scheduler;
echo VR io scheduler >> $UBER_LOGFILE;
elif [ "$SCHED" == "zen" ]; then
echo zen > /sys/block/mmcblk0/queue/scheduler;
echo ZEN io scheduler >> $UBER_LOGFILE;
else
echo row > /sys/block/mmcblk0/queue/scheduler;
echo ROW io scheduler >> $UBER_LOGFILE;
fi

##IO READAHEAD
echo $IOREAD >> /sys/block/mmcblk0/queue/read_ahead_kb
echo IO Read ahead size\: $IOREAD >> $UBER_LOGFILE;

##SDCARD READAHEAD
echo $SDCARD >> /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo SDCARD Read ahead size\: $SDCARD >> $UBER_LOGFILE;

##CPU SETTINGS
if $CPU; then

##GOVERNOR
if [ "$GOV" != "false" ]; then
echo "1" > /sys/devices/system/cpu/cpu0/online;
echo $GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo CPU0 $GOV >> $UBER_LOGFILE;
echo "1" > /sys/devices/system/cpu/cpu1/online;
echo $GOV > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor;
echo CPU1 $GOV >> $UBER_LOGFILE;
echo "1" > /sys/devices/system/cpu/cpu2/online;
echo $GOV > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor;
echo CPU2 $GOV >> $UBER_LOGFILE;
echo "1" > /sys/devices/system/cpu/cpu3/online;
echo $GOV > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor;
echo CPU3 $GOV >> $UBER_LOGFILE;
else
echo Stock CPU GOVs >> $UBER_LOGFILE;
fi

##CPU FREQS
if $CPUFREQ; then
echo $CPUMAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo CPU0 $CPUMAX Hz >> $UBER_LOGFILE;
echo $CPUMAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq;
echo CPU1 $CPUMAX Hz >> $UBER_LOGFILE;
echo $CPUMAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq;
echo CPU2 $CPUMAX MHz >> $UBER_LOGFILE;
echo $CPUMAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq;
echo CPU3 $CPUMAX Hz >> $UBER_LOGFILE;
echo $CPU0MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo CPU0 $CPU0MIN Hz >> $UBER_LOGFILE;
echo $CPUMIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq;
echo CPU1 $CPUMIN Hz >> $UBER_LOGFILE;
echo $CPUMIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq;
echo CPU2 $CPUMIN Hz >> $UBER_LOGFILE;
echo $CPUMIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq;
echo CPU3 $CPUMIN Hz >> $UBER_LOGFILE;
else
echo Stock CPU FREQs >> $UBER_LOGFILE;
fi

##UNDERVOLTING
if $UV; then
echo "1" > /sys/devices/system/cpu/cpu0/online;
echo "730 730 755 755 755 775 785 805 815 825 845 855 890 905 935 975 1030 1045 1060 1080 1115 1130" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo "1" > /sys/devices/system/cpu/cpu1/online;
echo "730 730 755 755 755 775 785 805 815 825 845 855 890 905 935 975 1030 1045 1060 1080 1115 1130" > /sys/devices/system/cpu/cpu1/cpufreq/UV_mV_table
echo "1" > /sys/devices/system/cpu/cpu2/online;
echo "730 730 755 755 755 775 785 805 815 825 845 855 890 905 935 975 1030 1045 1060 1080 1115 1130" > /sys/devices/system/cpu/cpu2/cpufreq/UV_mV_table
echo "1" > /sys/devices/system/cpu/cpu3/online;
echo "730 730 755 755 755 775 785 805 815 825 845 855 890 905 935 975 1030 1045 1060 1080 1115 1130" > /sys/devices/system/cpu/cpu3/cpufreq/UV_mV_table
echo Under Voltz >> $UBER_LOGFILE;
else
echo Stock Voltz >> $UBER_LOGFILE;
fi

else
echo Stock CPU Values >> $UBER_LOGFILE;

fi

##TOUCH BOOST
if $TOUCH; then
echo "1" > /sys/kernel/msm_mpdecision/conf/boost_enabled
echo Touch Boost On >> $UBER_LOGFILE;
else
echo "0" > /sys/kernel/msm_mpdecision/conf/boost_enabled
echo Touch Boost Off >> $UBER_LOGFILE;
fi

##FSYNC
if $FSYNC; then
echo "1" > /sys/kernel/dyn_fsync/Dyn_fsync_active
echo FSync Enabled >> $UBER_LOGFILE;
else
echo "0" > /sys/kernel/dyn_fsync/Dyn_fsync_active
echo FSync Disabled >> $UBER_LOGFILE;
fi

##WAKE CONTROLS
if $WAKE; then
##DOUBLETAP2WAKE
echo $DT2W > /sys/android_touch/doubletap2wake

##SWEEP2WAKE
echo $S2W > /sys/android_touch/sweep2wake

##S2W/DT2W POWER KEY TOGGLE
echo $PWRKEY > /sys/module/qpnp_power_on/parameters/pwrkey_suspend

##S2W/DT2W TIMEOUT
echo $TIMEOUT > /sys/android_touch/wake_timeout
echo S2W/DT2W Timeout\: $TIMEOUT >> $UBER_LOGFILE;
else
echo WAKE CONTROLLS Disabled >> $UBER_LOGFILE;
fi

##FASTCHARGE
if $FASTCHARGE; then
echo 1 > /sys/kernel/fast_charge/force_fast_charge
echo USB Fastcharge enabled >> $UBER_LOGFILE;
else
echo 0 > /sys/kernel/fast_charge/force_fast_charge
echo USB Fastcharge disabled >> $UBER_LOGFILE;
fi

##GPU SETTINGS
if $GPU; then
##GPU GOVERNOR SETTINGS
if $GPUPRE; then
echo performance >> /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor;
echo Performance GPU Governor >> $UBER_LOGFILE;
else
echo ondemand >> /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor;
echo Ondemand GPU Governor >> $UBER_LOGFILE;
fi

##GPU FREQUANCY
echo $GPU_FREQ > /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk
echo GPU $GPU_FREQ hz >> $UBER_LOGFILE;
else
echo GOV SETTINGS disabled >> $UBER_LOGFILE;
fi

##EXFAT
if $EXFAT; then
insmod /system/lib/modules/exfat.ko;
echo ExFAT Module Loaded >> $UBER_LOGFILE;
fi

##VIBRATOR SETTINGS
echo $VIB > /sys/class/timed_output/vibrator/amp
echo Vibration Strength\: $VIB >> $UBER_LOGFILE;

##ZRAM SETTINGS
if $ZRAM; then
echo "1" /sys/devices/virtual/block/zram0/initstate;
echo ZRAM ON >> $UBER_LOGFILE;
echo $ZRDK /sys/devices/virtual/block/zram0/size;
echo ZRAM Compression: $ZRDK >> $UBER_LOGFILE;
#ZRam compression changer
echo $ZCOM > /sys/block/zram0/comp_algorithm;
echo ZRAM Compression: $ZCOM >> $UBER_LOGFILE;
else
echo ZRAM OFF >> $UBER_LOGFILE;
fi

##HOTPLUG
if $MPD; then
echo 130 > /sys/kernel/msm_mpdecision/conf/delay
echo "1" > /sys/kernel/msm_mpdecision/conf/enabled
echo "0" > /sys/kernel/msm_mpdecision/conf/boost_enabled
echo $CPUMIN > /sys/kernel/msm_mpdecision/conf/idle_freq
echo "4" > /sys/kernel/msm_mpdecision/conf/max_cpus
echo "1" > /sys/kernel/msm_mpdecision/conf/min_cpus
echo "1" > /sys/kernel/msm_mpdecision/conf/scroff_single_core
echo "12" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_0
echo "0" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_1
echo "16" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_2
echo "34" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_3
echo "20" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_4
echo "39" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_5
echo "0" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_6
echo "46" > /sys/kernel/msm_mpdecision/conf/nwns_threshold_7
echo "140" > /sys/kernel/msm_mpdecision/conf/twts_threshold_0
echo "0" > /sys/kernel/msm_mpdecision/conf/twts_threshold_1
echo "140" > /sys/kernel/msm_mpdecision/conf/twts_threshold_2
echo "100" > /sys/kernel/msm_mpdecision/conf/twts_threshold_3
echo "140" > /sys/kernel/msm_mpdecision/conf/twts_threshold_4
echo "100" > /sys/kernel/msm_mpdecision/conf/twts_threshold_5
echo "0" > /sys/kernel/msm_mpdecision/conf/twts_threshold_6
echo "100" > /sys/kernel/msm_mpdecision/conf/twts_threshold_7
echo MPDECISION Preset Enabled >> $UBER_LOGFILE;
else
echo MPDECISION Preset Disabled >> $UBER_LOGFILE;
fi

##DIRTY RATIOS
echo $DIRTY > /proc/sys/vm/dirty_ratio
echo $DIRTYBACK > /proc/sys/vm/dirty_background_ratio

else
echo UBER PRESETS Disabled >> $UBER_LOGFILE;
fi

exit 0

UPDATE: If I remove all the rest of the script and just have the Sched stuff it still doesnt run correctly.

UPDATE 2: Doesnt work for cfq either

UPDATE 3: This runs fine

##SCHEDULER
if [ "$SCHED" == "bfq" ]; then
echo bfq > /sys/block/mmcblk0/queue/scheduler;
echo BFQ io scheduler >> $UBER_LOGFILE
else
echo row > /sys/block/mmcblk0/queue/scheduler;
echo ROW io scheduler >> $UBER_LOGFILE;
fi

So its somehing with those elifs

SOLUTION: add sleep 1; in so rom doesnt overwrite the setting!