Added a big list of disable/enable android.permissions
Cleaned up Op.
Made information more concise and easier on the eyes.
read_ahead_kb:
Code:
#
for i in /sys/devices/virtual/bdi/*/read_ahead_kb
do
echo "(AnyMultipleOf 128)" > $i
done
inode_readahead_blks
Code:
#
for i in /sys/fs/ext4/*/inode_*
do
echo "VAR" > $i
done
You won't find more simple scripting SETTING=VALUE...
Code:
write='busybox sysctl -w /sys/devices/system/cpu'
i=$write/cpufreq/conservative
j=$write/cpu0/cpufreq
$j/scaling_governor=conservative
$j/scaling_max_freq=1200000
$jscaling_min_freq=25000
$i/sampling_rate=25000
$i/up_threshold=40
$i/down_threshold=50
$i/freq_step=5
$i/sampling_down_factor=2
|
Code:
\( An Ondemand example \)
write='busybox sysctl -w /sys/devices/cpu'
i=$write/cpufreq/ondemand
j=$write/cpu0/cpufreq
$j/scaling_governor=ondemand
$j/scaling_min_freq=25000
$j/scaling_max_freq=1400000
$i/sampling_rate=50000
$i/up_threshold=65
$i/powersave_bias=10
$i/sampling_down_factor=3
$i/down_differential=30
$i/freq_step=65
|
Code:
\( Pegasus example \)
write='busybox sysctl -w /sys/devices/system/cpu'
i=$write/cpufreq/pegasusq
j=$write/cpu0/cpufreq
$j/scaling_governor=pegasusq
$j/scaling_min_freq=25000
$j/scaling_max_freq=1400000
$i/pegasusq/up_threshold=80
$i/pegasusq/up_threshold_at_min_freq=65
$i/pegasusq/sampling_down_factor=5
$i/pegasusq/down_differential=5
$i/pegasusq/freq_step=60
$i/freq_for_responsiveness=500000
$i/pegasusq/cpu_up_rate=10
$i/pegasusq/cpu_down_rate=20
$i/pegasusq/hotplug_freq_1_1=500000
$i/pegasusq/hotplug_freq_2_0=200000
$i/pegasusq/hotplug_rq_1_1=300
$i/pegasusq/hotplug_rq_2_0=350
$i/pegasusq/ignore_nice_load=0
$i/pegasusq/io_is_busy=1
$i/pegasusq/max_cpu_lock=0
$i/pegasusq/hotplug_lock=0
|
|
simple shell for speed and memory management
Code:
\( You can virtually write any setting \)\
ext4=`busybox sysctl -w /sys/fs/ext4/mmcblk0`
lmk=`busybox sysctl -w /sys/module/lowmemorykiller/parameters`
$ext4\p10/inode_readahead_blks=128
$ext4\p9/inode_readahead_blks=128
$ext4\p7/inode_readahead_blks=256
$ext4\p12/inode_readahead_blks=64
$ext4\p10/inode_goal=16
$ext4\p9/inode_goal=16
$ext4\p7/inode_goal=16
$ext4\p12/inode_goal=16
busybox sysctl -w /proc/1/oom_adj=-17
$lmk/adj=0,2,-4,8,12,15
$lmk/minfree=1024,3072,5120,12288,17408,24566
Screen state script that turns on and off both cpus
For now, this Post will be home to I/O tweaks
Queue settings unknown to most that
Code:
for i in /sys/block/*/*/force*
do
echo "0" > $i
echo 0 > /sys/block/mmcblk0/mmcblk0p1/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p10/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p11/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p12/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p2/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p3/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p4/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p5/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p6/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p7/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p8/ro
echo 0 > /sys/block/mmcblk0/mmcblk0p9/ro
Now you`re ready to adjust stuff...
Code:
for i in /sys/devices/virtual/block/*/queue
do
echo "sio" > $i/scheduler
echo "4096" > $i/minimum_io_size
echo "1" > $i/add_random
echo "4096" > $i/discard_granularity
echo "1" > /discard_zeroes_data
echo "1" > $i/discard_max_bytes
echo "1024" > $i/optimal_io_size
done
|or
for i in /sys/devices/virtual/block/*/queue
do
echo "deadline" > $i/scheduler
echo "2048" > $i/minimum_io_size
echo "1" > $i/add_random
echo "0" > $i/discard_max_bytes
echo "0" > $i/discard_granularity
echo "1" > /discard_zeroes_data
echo "128" > $i/optimal_io_size
done
I have so many variations and these ftmp dont have parameters so Ill let you get creative on those.
Sys Call
Valid keys for /etc/sysctl.conf
I meant for this list to be the OP.. but alas.. i was 11000 or so character to heavy.. lol
A gift ( not all sysctl calls are adjustable and this list is raw. there will be one or two no goes ..)
( wow, I hadn't realized there was near 800 settings in here.... )
ICS SYSCALL MASTER KEY
Alright, I know that most of you will already know how to use a sysctl.conf, but there are probably a couple
things that you didn't know about sysctl, so I may as well start with the obvious...
Code:
\\the following is the easiest way to use sysctl.conf, it is ideally done at init but is equally as easy to use from termemu\\
#/system/bin/sh \\ for init.d \\
sysctl -p \\ from terminal emulator you would have first signed it as usr \\
Now for one you may not now
I'm sure you've seen it used on each command.. (something like 'busybox sysctl -e -w vm.ridin_dirty=example)
*note in sysctl, -(e) is to skip displaying key (e)rrors and keep reading; -n is umber errors i believe; -w is (w)rite; the -p above is (p)rint sysclt.conf
Code:
\\ this is a nice little trick, there are over around 30 kb of keys,,what to do?? \\
su \\ or #/system/bin/sh if in a script \\
sysctl -p /etc/where/ever/your/2nd/sysctl/is
sysctl -p /or/your/5th
sysctl -p $0 <\\ or call your working script itself.\\>
<\\next is the command to create master list from your own device\\>
[B]sysctl -A > /data/log/MasterSysctl.txt[/B]
<\\and this next one,,, well this next is just priceless.. how's this for difficult syntax\\>
sysctl -w /proc/1/oom_adj=-17 <\\yes,, I mean..it...\\>
sysctl -w /sys/devices/virtual/block/loop1/queue/scheduler=easiest_way_to_apply_any_setting_you_arent_sure_of
Some working examples coming soon.
CpuFreq slash Governor settings
Similar but more refined and for a PEGASUS SETUP
Customize it all...
This is an advanced example made simple.. This one will set (between 6) governor and its settings, max and min freq, readahead kb in all of BDI, and inode readahead blks in each mmcblk.
And its 2.2* kb. And you only need to edit the subs if you wamt...
{no mem management or screenstate, but I just had a 4.5 hour screen on cycle at 1.4 max and scoring 4600+ on quadrants...}
Code:
#!/system/bin/sh
chmod 0644 /sys/block/*/queue/*
mount -o remount,rw / /
mount -o remount.rw /system /system
governor=pegasusq
max_freq=1400000
min_freq=50000
inode_readahead=128
read_ahead_kb=3840
cpu=/sys/devices/system/cpu/cpu0/cpufreq
echo "$min_freq" > $cpu/scaling_min_freq
echo "$max_freq" > $cpu/scaling_max_freq
for i in /sys/block/*/*/force_ro
do
echo "0" > $i
done
for i in /sys/class/bdi/*/read*
do
echo "$read_ahead_kb" > $i
done
for i in /sys/fs/ext4/*/inode_*
do
echo "$inode_readahead" > $i
done
for i in $cpu/scaling_governor
do
echo "$governor" > $i
done
for i in /sys/devices/system/cpu/cpufreq
do
active=`cat $cpu/scaling_governor`
Begin_ondemand
echo "40000" > $i/ondemand/sampling_rate
echo "70" > $i/ondemand/up_threshold
echo "15" > $i/ondemand/powersave_bias
echo "70" > $i/ondemand/freq_step
echo "3" > $i/ondemand/sampling_down_factor
Begin_smartassv2
echo "800000" > $i/smartass/awake_ideal_freq
echo "200000" > $i/smartass/sleep_ideal_freq
echo "800000" > $i/smartass/sleep_wakeup_freq
echo "75" > $i/smartass/max_cpu_load
echo "45" > $i/smartass/min_cpu_load
echo "0" > $i/smartass/ramp_up_step
echo "0" > $i/smartass/ramp_down_step
echo "24000" > $i/smartass/up_rate_us
echo "99000" > $i/smartass/down_rate_us
Begin_interactive
echo "80" > $i/interactive/go_hispeed_load
echo "40000" > $i/interactive/min_sample_time
echo "20000" > $i/interactive/timer_rate
#Begin_pegasusq
echo "80" > $i/pegasusq/up_threshold
echo "65" > $i/pegasusq/up_threshold_at_min_freq
echo "5" > $i/pegasusq/sampling_down_factor
echo "5" > $i/pegasusq/down_differential
echo "60" > $i/pegasusq/freq_step
echo "400000" > $i/freq_for_responsiveness
echo "10" > $i/pegasusq/cpu_up_rate
echo "20" > $i/pegasusq/cpu_down_rate
echo "400000" > $i/pegasusq/hotplug_freq_1_1
echo "300000" > $i/pegasusq/hotplug_freq_2_0
echo "300" > $i/pegasusq/hotplug_rq_1_1
echo "350" > $i/pegasusq/hotplug_rq_2_0
echo "0" > $i/pegasusq/ignore_nice_load
echo "1" > $i/pegasusq/io_is_busy
echo "0" > $i/pegasusq/max_cpu_lock
echo "0" > $i/pegasusq/hotplug_lock
#Begin_lulzactive
echo "60" > $i/lulzactive/inc_cpu_load
echo "4" > $i/lulzactive/pump_up_step
echo "1" > $i/lulzactive/pump_down_step
echo "10000" > $i/lulzactive/up_sample_time
echo "70000" > $i/lulzactive/down_sample_time
echo "5" > $i/lulzactive/screen_off_min_step
#Begin_conservative
echo "55" > $i/conservative/up_threshold
echo "25000" > $i/conservative/sampling_rate
echo "3" > $i/conservative/sampling_down_factor
echo "40" > $i/conservative/down_threshold
echo "5" > $i/conservative/freq_step
done
exit 0
Odex all data apps
http://forum.xda-developers.com/showthread.php?p=32305612
Here's a link to a post with a Flashable busybox (with extra-goodies)
PhAkEer said:
a place where one can come to copy/plaste sections
Click to expand...
Click to collapse
I know how to copy, but what is this plaste you speak of?
anyways, this looks promising for adding some more scripts in one spot for all.
Sent from my SPH-D710 using Tapatalk
Click here for custom mods for your E4GT
Prove it
PhAkEer said:
Prove it
Click to expand...
Click to collapse
Edited in a quote before you edited :screwy: haha
Sent from my SPH-D710 using Tapatalk
Click here for custom mods for your E4GT
What is a script? And what do all those fancy thingy things you posted do? Oh, and I spilled grape juice all over my phone. Its still dripping out of it. Why do you think it won't turn on? Also, can you come help me pick my nose?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
How did this thread sneak in on me bro? A little sly-of-hand action there huh.... hook 'em in placebo and create another thread... then mention nonchalantly in placebo thread to check your other thread for the latest.Lol
Looking forward to seeing where this one leads.. nice work man!
Sent from my SPH-D710 using Xparent Blue Tapatalk 2
blackcanopy said:
How did this thread sneak in on me bro? A little sly-of-hand action there huh.... hook 'em in placebo and create another thread... then mention nonchalantly in placebo thread to check your other thread for the latest.Lol
Looking forward to seeing where this one leads.. nice work man!
Sent from my SPH-D710 using Xparent Blue Tapatalk 2
Click to expand...
Click to collapse
Come one now, brah. You know exactly where this goes....
(this leads to me being in your backpack after a while.. and...
to my ultimate goal.... I sleep.. for at least 6 hours at once...)
Anybody want a script to odex data/apps??
Wrote it this morning.
Just need dexopt-wrapper and then execute this.. no reboot, apps keep their classes.dex for the future as well...
Code:
#!/system/bin/sh
J=/system/framework
A=/data/app
W=/system/xbin/dexopt-wrapper
mount -o remount,rw /system /system
mount -o remount,rw /data /data
rm -f $A/*.odex
for i in $A/*
do
name=`basename $i .apk`
$W $A/$name.apk $A/$name.odex $J/core.jar:$J/core-junit.jar:$J/bouncycastle.jar:$J/ext.jar:$J/framework.jar:$J/framework2.jar:$J/android.policy.jar:$J/services.jar:$J/apache-xml.jar
chmod 0644 $A/$name.odex
done
echo $i
sleep 2
exit 0
( and telling me if this stuff does or does not work is NOT off topic ftr )
Haven't even had time to look at this to see what it does...
Found it in an unnamed folder in a backup..
If anybodies knows who's work this is please say so..
I'm only posting it to get it off of my work pc.. I'll look into it later.
Code:
#!/system/bin/sh
#
#
readdebug() {
DUAL_CORE_DEBUG=`cat /system/etc/dual_core/debug`
DUAL_CORE_DEBUG=${DUAL_CORE_DEBUG:=0}
}
log() {
if [ "$DUAL_CORE_DEBUG" = "1" ] ; then
echo "$(date): [email protected]" >> /devlog/dual_core
fi
}
logcpu() {
if [ "$DUAL_CORE_DEBUG" = "1" ] ; then
local NOW_FREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
local NOW=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
log "CPU[0]: scaling_max_freq=$NOW"
local NOW_ONLINE=`cat /sys/devices/system/cpu/cpu1/online`
log "CPU[1]: online=$NOW_ONLINE"
if [ -f /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq ] ; then
local NOW=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq`
log "CPU[1]: scaling_max_freq=$NOW"
fi
fi
}
init_dc_fs() {
sysrw
touch /devlog/dual_core ; chmod 777 /devlog/dual_core
touch /system/etc/dual_core/debug ; chmod 777 /system/etc/dual_core/debug
touch /system/etc/dual_core/sleep_frequency ; chmod 777 /system/etc/dual_core/sleep_frequency
touch /system/etc/dual_core/disable_sleep_freq ; chmod 777 /system/etc/dual_core/disable_sleep_freq
sysro
}
waitforwakeup() {
log "waitforwakeup{" ; logcpu
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ "$AWAKE" = "awake" ] ; then
CPU0_FREQ_AWAKE=${CPU0_FREQ_AWAKE:="$CPU0_FREQ_BOOT"}
log "Awake triggered... old awake is: $CPU0_FREQ_AWAKE"
log "CPU[1] try set online"
chmod 644 /sys/devices/system/cpu/cpu1/online
echo "1" > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online
log "CPU[1] online"
if [ "$DISABLE_SLEEP" = "1" ] || [ "$OC_DAEMON" = "1" ] ; then
log "sleep cpu0 frequency mod disabled"
else
log "waking up from earlier sleep.. set to old awake frequency = $CPU0_FREQ_AWAKE"
echo "$CPU0_FREQ_AWAKE" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
fi
sleep 1
echo "$CPU0_FREQ_AWAKE" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
log "}wakeup" ; logcpu
fi
}
waitforsleep() {
log "waitforsleep{" ; logcpu
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ "$SLEEPING" = "sleeping" ] ; then
log "Sleep triggered..."
sleep_cpu0
log "CPU[1]: try set offline"
chmod 644 /sys/devices/system/cpu/cpu1/online
echo "0" > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online
log "CPU[1]: offline"
fi
log "}waitforsleep" ; logcpu
}
sleep_cpu0() {
CPU0_FREQ_AWAKE=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
log "Sleeping, remember awake frequency: $CPU0_FREQ_AWAKE"
DISABLE_SLEEP=`cat /system/etc/dual_core/disable_sleep_freq`
if [ "$DISABLE_SLEEP" = "1" ] || [ "$OC_DAEMON" = "1" ] ; then
log "DISABLE_SLEEP=1 or OCD detected"
else
if [ -e /system/etc/dual_core/sleep_frequency ] ; then
SLEEP_FREQUENCY=`cat /system/etc/dual_core/sleep_frequency`
log "sleep_frequency setting found, using $SLEEP_FREQUENCY instead of $CPU0_FREQ_AWAKE"
fi
SLEEP_FREQUENCY=${SLEEP_FREQUENCY:=DEFAULT_SLEEP_FREQUENCY}
echo "$SLEEP_FREQUENCY" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
log "Set cpu0 frequency to $SLEEP_FREQUENCY"
fi
}
DEFAULT_SLEEP_FREQUENCY=192000
init_dc_fs
DUAL_CORE_DEBUG="1"
log "Starting..."; logcpu
if [ -f /system/etc/virtuous_oc/wake_max_freq ] ; then
OC_DAEMON=1
log "OC Daemon found."
fi
DISABLE_SLEEP=`cat /system/etc/dual_core/disable_sleep_freq`
CPU0_FREQ_BOOT=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
STATE=`cat /sys/power/state_onchg`
if [ "$STATE" = "chgoff" ] ; then
log "device is asleep, scaling down"
sleep_cpu0
fi
DUAL_CORE_DEBUG="0"
(while : ; do
waitforwakeup
readdebug
waitforsleep
readdebug
done &)
at a glance it looks like an extremely over complicated screenstate script....
PhAkEer said:
Haven't even had time to look at this to see what it does...
Found it in an unnamed folder in a backup..
If anybodies knows who's work this is please say so..
I'm only posting it to get it off of my work pc.. I'll look into it later.
Code:
#!/system/bin/sh
#
#
readdebug() {
DUAL_CORE_DEBUG=`cat /system/etc/dual_core/debug`
DUAL_CORE_DEBUG=${DUAL_CORE_DEBUG:=0}
}
log() {
if [ "$DUAL_CORE_DEBUG" = "1" ] ; then
echo "$(date): [email protected]" >> /devlog/dual_core
fi
}
logcpu() {
if [ "$DUAL_CORE_DEBUG" = "1" ] ; then
local NOW_FREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
local NOW=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
log "CPU[0]: scaling_max_freq=$NOW"
local NOW_ONLINE=`cat /sys/devices/system/cpu/cpu1/online`
log "CPU[1]: online=$NOW_ONLINE"
if [ -f /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq ] ; then
local NOW=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq`
log "CPU[1]: scaling_max_freq=$NOW"
fi
fi
}
init_dc_fs() {
sysrw
touch /devlog/dual_core ; chmod 777 /devlog/dual_core
touch /system/etc/dual_core/debug ; chmod 777 /system/etc/dual_core/debug
touch /system/etc/dual_core/sleep_frequency ; chmod 777 /system/etc/dual_core/sleep_frequency
touch /system/etc/dual_core/disable_sleep_freq ; chmod 777 /system/etc/dual_core/disable_sleep_freq
sysro
}
waitforwakeup() {
log "waitforwakeup{" ; logcpu
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ "$AWAKE" = "awake" ] ; then
CPU0_FREQ_AWAKE=${CPU0_FREQ_AWAKE:="$CPU0_FREQ_BOOT"}
log "Awake triggered... old awake is: $CPU0_FREQ_AWAKE"
log "CPU[1] try set online"
chmod 644 /sys/devices/system/cpu/cpu1/online
echo "1" > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online
log "CPU[1] online"
if [ "$DISABLE_SLEEP" = "1" ] || [ "$OC_DAEMON" = "1" ] ; then
log "sleep cpu0 frequency mod disabled"
else
log "waking up from earlier sleep.. set to old awake frequency = $CPU0_FREQ_AWAKE"
echo "$CPU0_FREQ_AWAKE" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
fi
sleep 1
echo "$CPU0_FREQ_AWAKE" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
log "}wakeup" ; logcpu
fi
}
waitforsleep() {
log "waitforsleep{" ; logcpu
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ "$SLEEPING" = "sleeping" ] ; then
log "Sleep triggered..."
sleep_cpu0
log "CPU[1]: try set offline"
chmod 644 /sys/devices/system/cpu/cpu1/online
echo "0" > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online
log "CPU[1]: offline"
fi
log "}waitforsleep" ; logcpu
}
sleep_cpu0() {
CPU0_FREQ_AWAKE=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
log "Sleeping, remember awake frequency: $CPU0_FREQ_AWAKE"
DISABLE_SLEEP=`cat /system/etc/dual_core/disable_sleep_freq`
if [ "$DISABLE_SLEEP" = "1" ] || [ "$OC_DAEMON" = "1" ] ; then
log "DISABLE_SLEEP=1 or OCD detected"
else
if [ -e /system/etc/dual_core/sleep_frequency ] ; then
SLEEP_FREQUENCY=`cat /system/etc/dual_core/sleep_frequency`
log "sleep_frequency setting found, using $SLEEP_FREQUENCY instead of $CPU0_FREQ_AWAKE"
fi
SLEEP_FREQUENCY=${SLEEP_FREQUENCY:=DEFAULT_SLEEP_FREQUENCY}
echo "$SLEEP_FREQUENCY" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
log "Set cpu0 frequency to $SLEEP_FREQUENCY"
fi
}
DEFAULT_SLEEP_FREQUENCY=192000
init_dc_fs
DUAL_CORE_DEBUG="1"
log "Starting..."; logcpu
if [ -f /system/etc/virtuous_oc/wake_max_freq ] ; then
OC_DAEMON=1
log "OC Daemon found."
fi
DISABLE_SLEEP=`cat /system/etc/dual_core/disable_sleep_freq`
CPU0_FREQ_BOOT=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
STATE=`cat /sys/power/state_onchg`
if [ "$STATE" = "chgoff" ] ; then
log "device is asleep, scaling down"
sleep_cpu0
fi
DUAL_CORE_DEBUG="0"
(while : ; do
waitforwakeup
readdebug
waitforsleep
readdebug
done &)
at a glance it looks like an extremely over complicated screenstate script....
Click to expand...
Click to collapse
You might be right! It kinda looks like the script from the CPU sleep thread from here http://forum.xda-developers.com/showthread.php?t=1739457
Sent from my SPH-D710 using Tapatalk 2
Customizable Pegasus.
As is I'm getting something I'd recognize as a score in quad on jb... I thought the day would never come....
Code:
#!/system/bin/sh
# SETUP FOR PEGASUS
# I/O Settings
scheduler=deadline
read_ahead=3072
inode_blks=64
inode_goal=8
# CPU Freq Settings
min_freq=200
max_freq=1200
up_thresh=80
sampling=40000
sampling_factor=3
down_diff=5
freq_step=60
response_freq=500000
up_rate=20
down_rate=30
freq_1_1=400000
freq_2_0=300000
rq_1_1=400
rq_2_0=350
ignore_nice=0
io_is_busy=0
cpu_lock=0
lockR=0
# Stream settings
max_mb_scan=0
min_mb_scan=0
mb_stream_req=0
max_writeback_bump=32
req_order2=0
prealloc_mb=768
# Here we go again...lol
set -x
exec > /data/log/Pegasus.log 2>&1
/system/bin/sh
for j in $(/system/xbin/busybox mount | /system/xbin/busybox grep ext4 | /system/xbin/busybox cut -d " " -f3)
do
sync
/system/xbin/busybox mount -o remount,noatime,barrier=0,commit=5 $j
done
mount -o remount,noatime,nobh,nodiratime,nodelalloc,noauto_da_alloc,barrier=0 /system /system
mount -o remount,noatime,nobh,nodiratime,nodelalloc,noauto_da_alloc,barrier=0,commit=0 /cache /cache
mount -o remount,noatime,nodiratime,delalloc,noauto_da_alloc,barrier=0,commit=0 /data /data
for i in /sys/fs/ext4/*
do
echo "$max_mb_scan" > $i/mb_max_to_scan
echo "$min_mb_scan" > $i/mb_min_to_scan
echo "$inode_blks" > $i/inode_readahead_blks
echo "$inode_goal" > $i/inode_goal
echo "$mb_stream_req" > $i/mb_stream_req
echo "$max_writeback_bump" > $i/max_writeback_mb_bump
echo "$preaoc_mb" > $i/mb_group_prealloc
echo "$req_order2" > $i/mb_order2_req
done
echo "pegasusq" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
for i in /sys/devices/system/cpu/cpufreq/pegasusq
do
echo "$up_thresh" > $i/up_threshold
echo "$sampling" > $i/sampling_rate
echo "$sampling_factor" > $i/sampling_down_factor
echo "$down_diff" > $i/down_differential
echo "$freq_step" > $i/freq_step
echo "$up_rate" > $i/cpu_up_rate
echo "$down_rate" > $i/cpu_down_rate
echo "$freq_1_1" > $i/hotplug_freq_1_1
echo "$freq_2_0" > $i/hotplug_freq_2_0
echo "$rq_1_1" > $i/hotplug_rq_1_1
echo "$rq_2_0" > $i/hotplug_rq_2_0
echo "$ignore_nice" > $i/ignore_nice_load
echo "$io_is_busy" > $i/io_is_busy
echo "$cpu_lock" > $i/max_cpu_lock
done
for i in /sys/devices/virtual/bdi/*/read_ahead_kb
do
echo "$read_ahead" > $i
done
for i in /sys/class/block/*/queue
do
echo "$scheduler" > $i/scheduler
echo "$read_ahead" > $i/read_ahead_kb
done
case "$min_freq" in
*)
i=/sys/devices/system/cpu/cpu0/cpufreq
;;
25)
echo "25000" > $i/scaling_min_freq
;;
50)
echo "50000" > $i/scaling_min_freq
;;
100)
echo "100000" > $i/scaling_min_freq
;;
200)
echo "200000" > $i/scaling_min_freq
;;
300)
echo "300000" > $i/scaling_min_freq
;;
400)
echo "400000" > $i/scaling_min_freq
;;
500)
echo "500000" > $i/scaling_min_freq
;;
esac;
case "$max_freq" in
800)
echo "800000" > $cpu/scaling_max_freq
;;
900)
echo "900000" > $cpu/scaling_max_freq
;;
1000)
echo "1000000" > $cpu/scaling_max_freq
;;
1100)
echo "1100000" > $cpu/scaling_max_freq
;;
1200)
echo "1200000" > $cpu/scaling_max_freq
;;
1300)
echo "1300000" > $cpu/scaling_max_freq
;;
1400)
echo "1400000" > $cpu/scaling_max_freq
;;
1600)
echo "1600000" > $cpu/scaling_max_freq
;;
esac;
Nice to see this in the development section :thumbup:
-TeaM VeNuM Like A Boss
MiguelHogue said:
Nice to see this in the development section :thumbup:
-TeaM VeNuM Like A Boss
Click to expand...
Click to collapse
It isn't so such much for something to develop, I mainly just wanted the resources available the Tw themers and the like.
The parameters for the section said dev/mod/hack so I'm sure it fits in there somewhere.. I need to start getting some material in here though. . ... watch this...
EEECCCCCCHOOOO
khoeoeoeoe
ohohohohhh
See...
This one is a WIP so pay attention
Dual cpu screenstate script.. simple stuff
the way I have this setup it setup it will call powersave when screen is off. This is only practical if it calls another governor when the screen comes back on, so change it from "sh /data/local/pegasus" to "sh wherever you have a gov script" or to
"echo govofchoice > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
Code:
#!/system/bin/sh
#
#
sleep 1m
while [[ "awake" = $AWAKE ]]
do
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ "awake" = $AWAKE ]
then
echo "1" > /sys/devices/system/cpu/cpu1/online
echo "1" > /sys/devices/system/cpu/cpu0/online
sh /data/local/Pegasus
fi
sleep 2
ASLEEP=`cat /sys/power/wait_for_fb_sleep`
if [ "sleeping" = $ASLEEP ]
then
echo "0" > /sys/devices/system/cpu/cpu1/online
echo "0" > /sys/devices/system/cpu/cpu0/online
echo "powersave" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
fi
sleep 2
done
exit 0
PhAkEer said:
Anybody want a script to odex data/apps??
Wrote it this morning.
Just need dexopt-wrapper and then execute this.. no reboot, apps keep their classes.dex for the future as well...
Code:
#!/system/bin/sh
J=/system/framework
A=/data/app
W=/system/xbin/dexopt-wrapper
mount -o remount,rw /system /system
mount -o remount,rw /data /data
rm -f $A/*.odex
for i in $A/*
do
name=`basename $i .apk`
$W $A/$name.apk $A/$name.odex $J/core.jar:$J/core-junit.jar:$J/bouncycastle.jar:$J/ext.jar:$J/framework.jar:$J/framework2.jar:$J/android.policy.jar:$J/services.jar:$J/apache-xml.jar
chmod 0644 $A/$name.odex
done
echo $i
sleep 2
exit 0
( and telling me if this stuff does or does not work is NOT off topic ftr )
Click to expand...
Click to collapse
Where do we get a copy of dexopt-wrapper? I downloaded the odex station that has it in the zip you had somewhere, but I get status7 error when flashing it.
Sent from my SPH-D710 using Xparent Blue Tapatalk 2
Just extract the wrapper to xbin and youre gtg
Warning: hideous sig acomin..
Need a change of pace?
Odexing Data with a simple script
or
Change your boot splash-screen in two steps
Hi Everyone,
I am writing an app which needs to send sms using a cell phone as GSM modem, using AT commands.
I am using windows 7.
I connected my wife's Samsung S3770 Champ, windows automatically installed the drivers etc and it worked like a charm.
I used putty to connect (MS has removed hyperterminal for some reason) and it worked like a charm.
When I tried with my G2, its simply not working.
I tried installing HTC sync, installed the driver and cancelled the HTC sync installation.
I can connect to my phone using adb.
but somehow the G2 is not detected as a modem.
I have set the USB debug as on when I connect.
Looks like an HTC issue.
Has anyone done this with an HTC andriod phone?
I am using CM 7.1
Thanks and Regards,
Amogh
Have you tried stopping the ril-daemon? I know that's one way of getting AT commands to work (like verifying whether gfree worked)
This might help a bit, http://forum.xda-developers.com/wiki/index.php?title=HTC_Vision#3._.28OPTIONAL.29_Verify_you_did_it_right
-Nipqer
Nipqer said:
Have you tried stopping the ril-daemon? I know that's one way of getting AT commands to work (like verifying whether gfree worked)
This might help a bit, http://forum.xda-developers.com/wiki/index.php?title=HTC_Vision#3._.28OPTIONAL.29_Verify_you_did_it_right
-Nipqer
Click to expand...
Click to collapse
Thanks for the reply, i tried it, but didn't work.
Still the phone is missing from the modems.
I think that it needs some config change in the phone, I am missing something...
C:\Program Files\Android\android-sdk\platform-tools>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
# su
su
# stop ril-daemon
stop ril-daemon
#
# cat /dev/smd0 &
cat /dev/smd0 &
# +CREG: 1,"6E12","00004FB3"
+CGREG: 1
+HTCUCSQ: 12
+HTCUCSQ: 11
+HTCUCSQ: 12
#
#
# echo -e 'ATE1\r' > /dev/smd0
echo -e 'ATE1\r' > /dev/smd0
# 0
# echo -e 'ATV1\r' > /dev/smd0
echo -e 'ATV1\r' > /dev/smd0
# ATV1
OK
#
+HTCUCSQ: 10
+HTCUCSQ: 5
+HTCUCSQ: 4
+HTCUCSQ: 13
#
#
#
# AT
AT
AT: not found
#
try redirecting the output of the commands to /dev/smd0 so you can see what it's replying?
-Nipqer
I did:
echo -e 'ATV1\r' > /dev/smd0
do you want me to give the output for all commands?
Here it is
# su
su
# stop ril-daemon
stop ril-daemon
# cat /dev/smd0 &
cat /dev/smd0 &
# +HTCUCSQ: 7
+HTCUCSQ: 6
# +HTCUCSQ: 7
# +HTCUCSQ: 6
# echo -e 'ATE1\r' > /dev/smd0
echo -e 'ATE1\r' > /dev/smd0
# 0
# echo -e 'ATV1\r' > /dev/smd0
echo -e 'ATV1\r' > /dev/smd0
# ATV1
OK
echo -e '[email protected]?\r' > /dev/smd0
echo -e '[email protected]?\r' > /dev/smd0
# [email protected]?
@CID: 11111111
OK
#
+HTCUCSQ: 99
+CREG: 0
+CGREG: 0
+CREG: 1,"6E12","000066DB"
+CGREG: 1
#
+HTCUCSQ: 7
+HTCUCSQ: 6
# echo -e '[email protected]?40\r' > /dev/smd0
echo -e '[email protected]?40\r' > /dev/smd0
# [email protected]?40
@SIMLOCK= 00
OK
#
+HTCUCSQ: 7
# echo -e '[email protected]?AA\r' > /dev/smd0
echo -e '[email protected]?AA\r' > /dev/smd0
# [email protected]?AA
@secu_flag: 0
OK
#
Hi,
i flash many roms and sometimes after new rom flashed , i see dpi preserved my change before flash, even some rom preserve xposed framework still activated...maybe you have experience with some other backup/restore /system files during flash, maybe have you another idea to preserve some stuff.
For my part, i make a new backuptool.sh and backuptool.functions scripts compiled with some i find over roms i tried....
We have:
save dpi
save xposed framework
save addond
i think in red are the line you can personalize, i hope you know what to do with.
backuptool.sh
Code:
#!/sbin/sh
#
# Backup and restore addon /system files
#
export C=/tmp/backup
export S=/system
[COLOR="Red"]export V=what you want[/COLOR]
persist_props="ro.sf.lcd_density"
sysroot="/system"
saveroot="/tmp/save"
# Preserve DPI
save_props()
{
rm -f "$saveroot/prop"
for prop in $persist_props; do
echo "save_props: $prop"
grep "^$prop=" "$sysroot/build.prop" >> "$saveroot/prop"
done
}
# Restore DPI
restore_props()
{
local sedargs
sedargs="-i"
for prop in $(cat $saveroot/prop); do
echo "restore_props: $prop"
k=$(echo $prop | cut -d'=' -f1)
sedargs="$sedargs s/^$k=.*/$prop/"
done
sed $sedargs "$sysroot/build.prop"
}
# Backup Xposed Framework (bin/app_process)
xposed_backup()
{
if [ -f /system/bin/app_process.orig ]
then
cp /system/bin/app_process /tmp/backup/
fi
}
# Restore Xposed Framework (bin/app_process)
xposed_restore()
{
if [ -f /tmp/backup/app_process ]
then
mv /system/bin/app_process /system/bin/app_process.orig
cp /tmp/backup/app_process /system/bin/
fi
}
# Preserve /system/addon.d in /tmp/addon.d
preserve_addon_d() {
mkdir -p /tmp/addon.d/
cp -a /system/addon.d/* /tmp/addon.d/
chmod 755 /tmp/addon.d/*.sh
}
# Restore /system/addon.d in /tmp/addon.d
restore_addon_d() {
cp -a /tmp/addon.d/* /system/addon.d/
rm -rf /tmp/addon.d/
}
[COLOR="Red"]# Proceed only if /system is the expected major and minor version
check_prereq() {
if ( ! grep -q "^ro.cm.version=$V.*" /system/build.prop ); then
echo "Not backing up files from incompatible version: $V"
return 0
fi
return 1
}[/COLOR]
check_blacklist() {
if [ -f /system/addon.d/blacklist ];then
## Discard any known bad backup scripts
cd /$1/addon.d/
for f in *sh; do
s=$(md5sum $f | awk {'print $1'})
grep -q $s /system/addon.d/blacklist && rm -f $f
done
fi
}
check_whitelist() {
found=0
if [ -f /system/addon.d/whitelist ];then
## forcefully keep any version-independent stuff
cd /$1/addon.d/
for f in *sh; do
s=$(md5sum $f | awk {'print $1'})
grep -q $s /system/addon.d/whitelist
if [ $? -eq 0 ]; then
found=1
else
rm -f $f
fi
done
fi
return $found
}
mkdir -p $saveroot
# Execute /system/addon.d/*.sh scripts with $1 parameter
run_stage() {
for script in $(find /tmp/addon.d/ -name '*.sh' |sort -n); do
$script $1
done
}
case "$1" in
backup)
save_props
mkdir -p $C
[COLOR="Red"]# if check_prereq; then[/COLOR]
if check_whitelist system; then
exit 127
fi
[COLOR="Red"]# fi[/COLOR]
check_blacklist system
xposed_backup
preserve_addon_d
run_stage pre-backup
run_stage backup
run_stage post-backup
;;
restore)
restore_props
[COLOR="Red"]# if check_prereq; then[/COLOR]
if check_whitelist tmp; then
exit 127
fi
[COLOR="Red"]# fi[/COLOR]
check_blacklist tmp
xposed_restore
run_stage pre-restore
run_stage restore
run_stage post-restore
restore_addon_d
rm -rf $C
rm -rf /data/data/android.pacstats
sync
;;
*)
echo "Usage: $0 {backup|restore}"
exit 1
esac
exit 0
backuptool.functions
Code:
#!/sbin/sh
#
# Functions for backuptool.sh
#
export C=/tmp/backup
export S=/system
export V=what you want
backup_file() {
if [ -e "$1" ]; then
local F=`basename "$1"`
local D=`dirname "$1"`
# dont backup any apps that have odex files, they are useless
if ( echo "$F" | grep -q "\.apk$" ) && [ -e `echo "$1" | sed -e 's/\.apk$/\.odex/'` ]; then
echo "Skipping odexed apk $1";
else
mkdir -p "$C/$D"
cp -p $1 "$C/$D/$F"
fi
fi
}
restore_file() {
local FILE=`basename "$1"`
local DIR=`dirname "$1"`
if [ -e "$C/$DIR/$FILE" ]; then
if [ ! -d "$DIR" ]; then
mkdir -p "$DIR";
fi
cp -p "$C/$DIR/$FILE" "$1";
if [ -n "$2" ]; then
echo "Deleting obsolete file $2"
rm "$2";
fi
fi
}
the files in attachments. just remove ".txt' at end to use them as well.
thanks.
ilast 5 dayes i contenue hard working on asus zenfone max enable to daig port this qualcom based cpu phone phone have problem imei crouppeted i install 6.01 marsmallow and root
use these command to enable daig but not done so plz requst to all member plz help
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Program Files\Minimal ADB and Fastboot>adb shell
[email protected]_Z010:/ $ su
[email protected]_Z010:/ # insmod /system/lib/modules/diagchar.ko
insmod: /system/lib/modules/diagchar.ko: No such file or directory
1|[email protected]_Z010:/ # setprop sys.usb.config diag,adb
[email protected]_Z010:/ #
[email protected]_Z010:/ #
Click to expand...
Click to collapse
setprop sys.usb.diag 0
insmod /system/lib/modules/diagchar.ko /Only for Android 5! Skip this line for Android 6/7!
echo 1 > /sys/class/android_usb/android0/diag
echo 0 > /sys/class/android_usb/android0/enable
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo smd > /sys/class/android_usb/android0/f_serial/transports
echo diag,adb,serial > /sys/class/android_usb/android0/functions
echo "C4ATAS000000" > /sys/class/android_usb/android0/iSerial
echo 1 > /sys/class/android_usb/android0/enable
alex7212 said:
setprop sys.usb.diag 0
insmod /system/lib/modules/diagchar.ko /Only for Android 5! Skip this line for Android 6/7!
echo 1 > /sys/class/android_usb/android0/diag
echo 0 > /sys/class/android_usb/android0/enable
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo smd > /sys/class/android_usb/android0/f_serial/transports
echo diag,adb,serial > /sys/class/android_usb/android0/functions
echo "C4ATAS000000" > /sys/class/android_usb/android0/iSerial
echo 1 > /sys/class/android_usb/android0/enable
Click to expand...
Click to collapse
On my X00TD (ZB602KL) with Android 8.1 I do not see the any of the above files under /sys/class/android_usb/android0. Am I missing something? Thanks