Easiest way to oc without SetCPU? - Xoom General

I have only had my Xoom for a few days so its a new learning curve atm
I have the US MZ604 OTA ICS installed and Rogue 2.0.2 "Kuma" Kernel
After i have decided my stable clocks
whats the easiest way to add these and to undervolt
without any external apps
on my phone its a simple case of adding lines to
/etc/initqcom.post_boot.sh
like so
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential
echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 672000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

What's your aversion to SetCPU?
It makes it really easy to OC/UV.
Sent from my Xoom using xda premium

If you want to know what files to modify take a look through the EOS gerrit review site and look for what files they tweak for overclocking the xoom. If you're just trying to save a buck you can get setcpu for free on xda. There is no reason not to use an app to test frequencies before making changes to boot options that can boot loop your device.

I dont like having processes running that are un needed
if im going to be running at 1.5ghz 24/7
why not have it set from the get go to 1.5ghz
instead of having a background process do it post boot
d3athsd00r said:
What's your aversion to SetCPU?
It makes it really easy to OC/UV.
Sent from my Xoom using xda premium
Click to expand...
Click to collapse

ShonkUK said:
I dont like having processes running that are un needed
if im going to be running at 1.5ghz 24/7
why not have it set from the get go to 1.5ghz
instead of having a background process do it post boot
Click to expand...
Click to collapse
Unless you're using setcpu profiles (which I don't reccomend), there should be no constant process running.

It runs as a background process on every boot if oc on boot is enabled

I have been having a sniff around the firmware it seems to be
/init.stingray.rc
# Power Management Settings
#write /sys/devices/platform/ohci.0/usb2/2-3/power/level auto
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 216000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1000000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 216000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 1000000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
# timer 20ms, min sample 80ms, go max at 80%
write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 80000
write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 80
# Wakelock debug
write /sys/module/wakelock/parameters/debug_mask 7
# No need to continuously scan w1 bus
write /sys/devices/w1\ bus\ master/w1_master_search 1
# Disable charging LED
write /sys/class/gpio/gpio168/value 1

its in the boot.img..
i will setup something in init.d
echo 1504000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1504000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
is the command

umm init.d is broken on kuma 2.02 doh
here's how to fix it for anyone who wants to do this
To fix rogue_XM-kernel-2.0.2-kuma init.d support
extract sysinit from rogue_XM-kernel-2.0.2-kuma.zip to c:\
adb remount rw
adb push c:\sysinit /system/bin/
adb shell
chmod 755 /system/bin/sysinit
chgrp 2000 /system/bin/sysinit
any script you put in /system/etc/init.d/01oc for example
will run on boot
here's my 01oc file
#!/system/bin/sh
# overclock that *****
echo 1504000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1504000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
# enable charging light while device is on
chmod 777 /sys/devices/virtual/gpio/gpio168/value
echo 0 > /sys/devices/virtual/gpio/gpio168/value
# sd card write access
umount /mnt/external1
mount -t vfat -o fmask=0000,dmask=0000,rw /dev/block/platform/sdhci-tegra.2/mmcblk0p1 /mnt/external1
then
adb remount rw
adb push c:\01oc /system/etc/init.d/
adb shell
chmod 755 /system/etc/init.d/01oc

I thought when you said "easiest", you mean easy. Not how to do it by the hard way.
You should be asking how to do without third-party applications.

Hardcoding the OC is a bad idea. If something goes wrong, you can get locked out of your device, or have to fiddle through recovery to fix it. That's where a tool that runs at startup can save your bacon and also make thing "easiest" (which is what you are after), as it will automatically revert to default clock if the last shutdown wasn't done cleanly.

Well its not really hard is it
its a 3 line script for init.d
if it wasnt for the fact that init.d was broken on kuma
and i had to find out the method of oc
it would have been done in two mins
navossoc said:
I thought when you said "easiest", you mean easy. Not how to do it by the hard way.
You should be asking how to do without third-party applications.
Click to expand...
Click to collapse

Related

[Q] Understanding GladRoot Root script for 1.26-1.83

I was looking at the code for GladRoot (http://forum.xda-developers.com/showthread.php?t=1016060) and I had a couple of questions I was hoping someone could answer.
First of all, does anyone have the code for psneuter?
Secondly, if the goal of rooting is to Superuser.apk, why is temporary root access necessary? I've never used adb before this, but isn't the point that developers can easily do things like install applications using it? The superuser apk might grant super user access after it's installed, but before that it's just like any other apk.
I'd appreciate it if someone could answer these questions. Thanks.
Anyone want to help me out? Doesn't seem like too hard of a question...
Id take a look at What is root access on google. It sounds like you have no idea about the basics. There is a ton of info for beginners even on this site. If I misunderstood you I apologize but your question would only leave me to believe you need to learn the basics. Good luck
Sent using the phone with the biggest balls....Atrix 4G
Gladroot doesn't give temporary root access either unless it changed.
Sent using the phone with the biggest balls....Atrix 4G
dupreeks said:
Id take a look at What is root access on google. It sounds like you have no idea about the basics. There is a ton of info for beginners even on this site. If I misunderstood you I apologize but your question would only leave me to believe you need to learn the basics. Good luck
Sent using the phone with the biggest balls....Atrix 4G
Click to expand...
Click to collapse
Well I'm definitely a beginner, but not that beginner. I'll show you what I'm talking about:
Code:
rem If we do, since we need to run several commands as root, use psneuter to
rem temporarily root the device.
echo.
echo Obtaining temporary root access...
%~dp0adb push %~dp0bin\psneuter /tmp/psneuter > NUL 2>&1
if not errorlevel 0 set message=Unable to send psneuter. && goto abort
set retval=
for /f "tokens=*" %%l in ('%~dp0adb.exe shell "/bin/chmod 6755 /tmp/psneuter > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod psneuter. && goto abort
set retval=
for /f "tokens=*" %%l in ('%~dp0adb.exe shell "/tmp/psneuter > /dev/null 2>&1"') do set retval=%%l
if "%retval%" neq "" set message=Unable to execute psneuter. && goto abort
echo.
echo Waiting for root access to kick in...
timeout /t 5 /nobreak > NUL 2>&1
So what I said was correct. GladRoot definitely get's temp root access. After it does that, it changes some settings and installs superuser.apk:
Code:
rem Remount the /system read/write.
echo.
echo Mounting /system as read/write...
%~dp0adb.exe shell mount -o rw,remount /dev/block/mmcblk0p12 /system > NUL 2>&1
rem Install sqlite3 for additional system changes required later in the script.
rem This is silent because it shouldn't interfere with anything even if it's
rem not used.
%~dp0adb.exe push %~dp0bin\sqlite3 /system/bin > NUL 2>&1
%~dp0adb.exe shell chmod 6755 /system/bin/sqlite3 > NUL 2>&1
echo.
echo Ready to root.
echo.
pause
rem Let's root!
rem Check for duplicate busybox installation and remove it.
echo.
echo Cleaning up SuperOneClick mess...
%~dp0adb.exe shell "find /system/xbin -type l | xargs rm" > NUL 2>&1
%~dp0adb.exe shell rm /system/xbin/busybox > NUL 2>&1
rem Copy su over and set permissions for use.
echo.
echo Rooting your device ...
%~dp0adb.exe push %~dp0bin\su /system/bin > NUL 2>&1
%~dp0adb.exe shell chmod 6755 /system/bin/su > NUL 2>&1
rem Install the Superuser app for allowing other apps root access.
echo.
echo Installing Superuser app...
%~dp0adb.exe install -r %~dp0bin\Superuser.apk > NUL 2>&1
echo.
echo Root complete.
echo.
So again my question is why do you need temp root access to install superuser.apk?
Temp root access is needed because superuser is installed in system/apps in the system partition. Without root a user does not have read write permissions in the system partition. This means a user cannot uninstall apps or install apps with out root permission. Temp access allows a script or person to modify the system partition, in this case it gives apps access to permanent root. The source code for psneuter is here.
on21st said:
Temp root access is needed because superuser is installed in system/apps in the system partition. Without root a user does not have read write permissions in the system partition. This means a user cannot uninstall apps or install apps with out root permission. Temp access allows a script or person to modify the system partition, in this case it gives apps access to permanent root. The source code for psneuter is here.
Click to expand...
Click to collapse
Yeah that pretty much sums it up. Gladroot was and still is my method of root. I wish I could unlock the boot loader with my current 1.8.3 setup I have and not lose anything. If anyone has a solution I would really appreciate it. I like my phone how it is but want to be able to make nand backups basically. I am not huge on CM7 and it doesn't seem like there are many stable roms for the Atrix right now.
You can there should be a pudding for 1.8.3. I remember using it. It wipes data and allows you to unlock the boot loader if you choose. HERE
Just choose the correct sbf to download and then follow instructions in thread.

Build.prop / scripts

Originally by knzo, I have tried many on my phone and thought I should share with my fellow streakers...
On my ROMs adventure I've been collecting some tweaks and scripts and seems to me it's now time to share it. While some values in terms of optimization might fluctuate from device to device, I've found these pretty consistent throughout many.
Build.prop
(edit your /system/build.prop with a file manager with root access)
Careful for already existing settings. In this case, just change the values.
1. Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
2. Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
3. VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=48m
4. Render UI with GPU
Code:
debug.sf.hw=1
5. Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6. Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
7. Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
8. Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
9. Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
11. Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
12. Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
13. Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
14. Fix some application issues
Code:
ro.kernel.android.checkjni=0
15. Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
16. Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
17. Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
18. Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
19. Specifics to some LG devices
Code:
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
user.feature.flex=true
user.feature.lgdrm=false
user.feature.lgresource=false
user.feature.lgpoweroff=false
user.feature.ls_event=false
user.feature.ls_normal=false
user.feature.sui=false
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
7. Flags blocks as non-rotational and increases cache size
Code:
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Auto-zipalign on boot
(needs zipalign bin)
Code:
[url]http://forum.xda-developers.com/showthread.php?t=860586[/url]
13. Loopy Smoothness tweak
Code:
[url]http://forum.xda-developers.com/showthread.php?t=1137554[/url]
[url]http://forum.xda-developers.com/showthread.php?t=1205744[/url]
14. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
15. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
16. OOM groupings and priorities tweaks - SuperCharger
Code:
[url]http://forum.xda-developers.com/showthread.php?t=991276[/url]
GPS.conf
(create or edit your /system/etc/gps.conf with a file manager with root access)
For improving GPS lock time and signal.
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Other tweaks or guidelines
1. Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
Code:
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
2. Use CyanogenMOD's APN list file - it's one of the most complete.
Code:
It's located in /system/etc/apns-conf.xml
3. Use UOT kitchen for basic theming on your device.
Code:
http://uot.dakra.lt/
4. Use Google's dns servers
Code:
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
5. Update Superuser and su binary to latest version (3.0 beta)
Code:
http://goo-inside.me/superuser/
6. Disable sync feature in sqlite
(author: ownhere - needs a source for your device so you can compile the /system/lib/libsqlite.so)
Code:
Patch file here: http://forum.xda-developers.com/showthread.php?t=903507
7. Do not use task killers.
Alright, I think this is it for now.
If you have any other tweaks or better values, you can PM me and I'll include them.
Edit: took out quote for easier copy-paste ability.
Sent from my Dell Streak using xda premium
nice awesome tweak values there
i'll try it soon
thanks for the tips my friend
WOW!!! Nice going! keep them coming.
scripts
do these only work on custom roms, or can they be used on stock? i think the files called system.prop or something instead of build.prop, hence why i ask before i start attempring to alter anything ?
gazza35 said:
do these only work on custom roms, or can they be used on stock? i think the files called system.prop or something instead of build.prop, hence why i ask before i start attempring to alter anything ?
Click to expand...
Click to collapse
System.prop is something completely differenr...the build.prop file is in the system folder.
Sent from my Dell Streak using xda premium
one of these scripts destroys wifi connection. it connects and shows the symbol but theres no internet. upon removing a few of them i now reboot to a black screen and have to restore my device.
chuuw33 said:
one of these scripts destroys wifi connection. it connects and shows the symbol but theres no internet. upon removing a few of them i now reboot to a black screen and have to restore my device.
Click to expand...
Click to collapse
Which rom are you using? I know many gb roms have had wifi reconnection problems...
Sent from my Dell Streak using xda premium
backcover sensor
Is there any way to stop dell streak to shut down when remove back cover?
Its a kernel hack, unfortunately. DJSteve's Streakdroid and DSC are the only ones I know of that have this.
beginner said:
Is there any way to stop dell streak to shut down when remove back cover?
Click to expand...
Click to collapse
Just answered in this thread..its a lever under the plate... http://forum.xda-developers.com/showthread.php?t=1393650
Sent from my Dell Streak using xda premium
/sys/devices/virtual/bdi/179:0/read_ahead_kb
is for the external SD/USB
What about the internal one?
Wow, blast from the past! You're
gianmaxfactor said:
/sys/devices/virtual/bdi/179:0/read_ahead_kb
is for the external SD/USB
What about the internal one?
Click to expand...
Click to collapse
Wow, what a blast from the past - you still have a Dell Streak 5 in 2023?
Sorry, I don't have anything useful to add I don't recall what the ID was for the internal storage on my Streak, I replaced it a decade ago.
smnc said:
Wow, blast from the past! You're
Wow, what a blast from the past - you still have a Dell Streak 5 in 2023?
Sorry, I don't have anything useful to add I don't recall what the ID was for the internal storage on my Streak, I replaced it a decade ago.
Click to expand...
Click to collapse
@smnc you seem to be a Senior Member. With any respect, is it that difficult for you to understand that was nothing about the Streak (I don't even know what you are talking about) but a "generic" android/linux setting?
gianmaxfactor said:
@smnc you seem to be a Senior Member. With any respect, is it that difficult for you to understand that was nothing about the Streak (I don't even know what you are talking about) but a "generic" android/linux setting?
Click to expand...
Click to collapse
I'll assume we have a language barrier here and that you weren't being intentionally disrespectful.
1) You posted in a thread that has been dead for 11 years+, for a specific device that has been out of production for just as long. Expecting any response should have been a long-shot, but expecting a non-device-specific response is just odd. The only reason I saw your post was because by sheer dumb luck, I happened to have notifications turned on for this thread from way back then.
2) While read_ahead_kb may be a "generic setting", storage device paths such as /sys/devices/virtual/bdi/179:0/ are not. Different Android/Linux/Unix devices, and even differnt builds for the same device may arrange storage devices in different configurations, so finding out the path for the internal storage on a Dell Streak 5 running Android Gingerbread will likely not apply to whatever device you're working on.
3) The actual read-ahead cache size from a 12-year-old device is not likely to be useful on a modern device as storage technology and speeds have changed dramatically since then.
Perhaps if you posted in a general channel, or one specific to your device, someone might be able to give you more useful information fort whatever your project is.
Hopefully that helps you.

[HOWTO] Add init.d to stock ROM + a few other goodies

I have been resisting the urge to flash a custom ROM for a bit, but I really miss having init.d support. So I read a few threads for other phones and rolled my own.
Warnings
I borrowed bits and pieces from various places. If you don't know what init.d is, you probably don't want to do this. If you aren't willing to take responsibility for bricking your tablet, don't do this. Seriously, the risk of bricking is very low, but if you aren't comfortable booting into an adb shell from recovery, maybe this is not for you. Strongly suggest a nandroid backup before you get started so if you totally bork things you can just hit rewind.
Note: The latest CWM may prompt you on a reboot that the ROM may overwrite the bootloader and offer to fix it for you. Don't do that. The init.d hack takes over the bootloader install script, but does not change your bootloader! If you accidentally do let it fix things for you, just rebuild the install-bootloader.sh file. The other steps should be fine.
Prerequisites
First, you need root, busybox, and some sort of terminal (either adb, or some terminal you like using on the tablet).
I have found that I like Busybox Installer (from the market; https://play.google.com/store/apps/details?id=com.jrummy.busybox.installer) but for some reason it doesn't create new symlinks unless you click advanced install.
Let's get to it!
In the shell (don't type # or anything after #):
Code:
su # get root
mount -o remount,rw /system # get access to /system (4.04 seems to mount ro as is usual; seems like the original mounted rw)
which run-parts # if you don't see /system/xbin/run-parts you need to install/reinstall busybox; if it is somewhere else, note it
mkdir /system/etc/init.d
Create a file called sysinit -- we are going to put it in /system/bin. You can edit it in place with vi, mount your tablet and edit it on your computer, or create it on the computer and push it via adb. Whatever.
Here's the file (you do need the # and the things after it in the file!):
Code:
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d
Note that if your run-parts is not in /system/xbin (from the which command) then fix the above to reflect your reality.
In the shell, make it executable
Code:
chmod 755 /system/bin/sysinit
Now go in the init.d directory and create some things you want to run at start up. For example:
Code:
cd /system/etc/init.d
echo '#!/system/bin/sh' >99test # note: you do need the first # in this line but not the 2nd!
echo 'date >>/data/tmp/init.d-log.txt' >>99test
chmod 755 99test
Here's a more practical one (yes, you need the # signs). Name it something like 10diskperf -- don't forget to chmod it.
Code:
#!/system/bin/sh
# Set disk read aheads to 1024
chmod 777 /sys/block/mmcblk0/queue/read_ahead_kb
echo "1024" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 777 /sys/block/mmcblk1/queue/read_ahead_kb
echo "1024" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 777 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "1024" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Or here is one to tweak some TCP parameters (25sysctl):
Code:
#!/system/bin/sh
sysctl -w net.core.rmem_max=524288
sysctl -w net.core.wmem_max=524288
sysctl -w net.ipv4.tcp_rmem=6144 87380 524288
sysctl -w net.ipv4.tcp_wmem=6144 87380 524288
Whatever files you put in, you need to remember to make them executable (chmod 755).
Finally, you need to kick it all off at start up. The hack for that is we are going to create /system/etc/install-recovery.sh which apparently runs on each boot.
Code:
cd /system/etc
echo '#!/system/bin/sh' >install-recovery.sh
echo '/system/bin/sysinit' >>install-recovery.sh
chmod 755 install-recovery.sh
Tips and troubleshooting
If you are too lazy to cut and paste I have the files here (View attachment init.d-support.zip) that you can just move to the right places and change permission. If you are really lazy there is lightly tested install script below.
I like to try running the whole thing before a reboot to see if I get any errors:
Code:
/system/etc/install-recovery.sh
I'd suggest putting the 99test file in first. Verify that you get the expected file in /data/tmp and then reboot and check again. Then you can remove 99test.
Same goes for adding new scripts. Try running them from the shell to see if they throw errors before you reboot!
If you have trouble, see if this looks right:
Code:
ls -ld /system/etc/install-recovery.sh /system/bin/sysinit /system/etc/init.d /system/xbin/run-parts
-rwxr-xr-x root root 39 2012-07-14 10:00 install-recovery.sh
-rwxr-xr-x root root 140 2012-07-14 10:01 sysinit
drwxrwxrwx root root 2012-07-14 10:10 init.d
lrwxrwxrwx root root 2012-07-14 09:55 run-parts -> /system/xbin/busybox
For the brave
The install-init.d zip file (View attachment install-init.d.zip) contains a lightly tested script that SHOULD do the install steps for you.
Send the file to your android to someplace that can execute code (e.g., /system/xbin; I had to use adb to put it on the sdcard and then move it to /systemxbin in the shell since I don't have the adb root kernel installed).
Code:
cd /system/xbin # or wherever you have it
chmod 755 install-init.d
./install-init.d
It performs rude checks to see if init.d exists, and tries to handle moving or missing busybox. It only installs 99test as a script.
Let me know if this works or doesn't work for you.
For the extra brave: There is no reason this should only work on the Samsung. This ought to work on pretty much most stock ROMs as long as they execute install-recovery.sh on start up.
Scripts
What do you put in your init.d? If you post anything cool I'll put it up here in the op.
One that gave me some real gains in I/O performance required a new version of the tune2fs executable. By default, it is part of busybox but the busybox one only has a few simple options. I've included a stand alone version and the script 10disktune here View attachment disktune.zip. Unpack the zip and put the 10disktune in /system/etc/init.d (don't forget to chmod) and put tune2fs in /system/bin (chmod that too). Note that busybox has one in /system/xbin but the script specifically calls out the one in /system/bin.
Here's one that will zipalign your apks on each boot
Code:
#!/system/bin/sh
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk
ZCHECK=$?
if [ $ZCHECK -eq 1 ]; then
zipalign -f 4 $apk /cache/$(basename $apk)
if [ -e /cache/$(basename $apk) ]; then
cp -p -f /cache/$(basename $apk) $apk
rm /cache/$(basename $apk)
fi;
fi;
done;
Fin
Corrections welcome. I considered using exec or . to load some of this into one shell but given that it runs once at startup, I figured it is fine as is.
All files for reference
View attachment init.d-support.zip
View attachment install-init.d.zip
View attachment disktune.zip
Great guide, gonna try it tonight.
Sent from a GNote, hell yeah!
SirRhor said:
Great guide, gonna try it tonight.
Sent from a GNote, hell yeah!
Click to expand...
Click to collapse
I'm curious how it went. If you ran into any issues, let me know so I can update the op. Thanks!
Hmm did anyone get this to work?
wd5gnr said:
Hmm did anyone get this to work?
Click to expand...
Click to collapse
I did it on my Galaxy Nexus.
It works great, I had a bit of problem with the sysinit file, but when I downloaded your zip file and used your sysinit, it worked, so it must be a problem from my side
Thanks for this, I can finally use "Odex Me"
aavan said:
I did it on my Galaxy Nexus.
It works great, I had a bit of problem with the sysinit file, but when I downloaded your zip file and used your sysinit, it worked, so it must be a problem from my side
Thanks for this, I can finally use "Odex Me"
Click to expand...
Click to collapse
Great, just wanted to be sure I hadn't made any typos/errors in the guide.
A lot of init.d files collected here: http://forum.xda-developers.com/showthread.php?t=1227269
Also build.prop things, etc.
Thanks, I use your guide and worksperfect for my RK3066 devices. Very simple to understand all steps and what we are doing to our system, perfect for me. Thanks again dude
Melch1zedeK said:
Thanks, I use your guide and worksperfect for my RK3066 devices. Very simple to understand all steps and what we are doing to our system, perfect for me. Thanks again dude
Click to expand...
Click to collapse
Glad to help!
What is thhe utility of this?
moliverac8 said:
What is thhe utility of this?
Click to expand...
Click to collapse
Init.d is how Linux and many Android (which is kind of Linux, after all) systems manage executing commands on boot up.
The /etc/init.d files run in numerical order as root and you can do things like change system settings, manipulate the file system, etc.
See the init.d section linked below for some ideas.
http://forum.xda-developers.com/showthread.php?t=1227269
Question? what is the difference in this method and running a script?
wd5gnr said:
Init.d is how Linux and many Android (which is kind of Linux, after all) systems manage executing commands on boot up.
The /etc/init.d files run in numerical order as root and you can do things like change system settings, manipulate the file system, etc.
See the init.d section linked below for some ideas.
http://forum.xda-developers.com/showthread.php?t=1227269
Click to expand...
Click to collapse
I use the "swap memory script" and was wondering if it would also work this way with the init.d If so would there be any benefit this way over the current way of running it one way or the other? One drawback I see running the script as is is that I have to wait once the system has fully booted until the script has run and I see the Smanager screen to let me know that my memory has been remounted.
Thanks for the info and the learning process.
Here is the script and the link.
http://forum.xda-developers.com/showthread.php?t=1961097
Code:
sleep 5
mount -o remount,rw /
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
sleep 5
mount -o bind /data/media /mnt/extSdCard
As long as the device is ready to mount at boot time and doesn't get remounted, ought to work. Backup and try it
External memory wasn't ready
wd5gnr said:
As long as the device is ready to mount at boot time and doesn't get remounted, ought to work. Backup and try it
Click to expand...
Click to collapse
Thanks for the guide, but I think that the external memory was not ready to be mounted at that time. it didn't see the card till after boot. It was worth a shot, Reverted back to the script in /data and all worked again,
Note: I didn't find /system/xbin/run-parts however, I did find /system/bin/run-parts and changed the path to reflect that, I don't think this was an issue but I'm not 100% sure.

Interactive – why is this the best governor? [INFO]

Technical thread I wrote up about the subject... noob or dev check it out. I hope you find something useful to further your knowledge of Android/Linux
Cheers
http://forum.xda-developers.com/showthread.php?t=2649820
cun7 said:
Technical thread I wrote up about the subject... noob or dev check it out. I hope you find something useful to further your knowledge of Android/Linux
Cheers
http://forum.xda-developers.com/showthread.php?t=2649820
Click to expand...
Click to collapse
Can you please post ALL of your kernel settings (Governor, Schedulers etc) ??
Currently our bootloader is locked so we can only change Default governor and that's it. But as soon as someone finds an exploit or something I'll be trying out your settings.
P.S. Default governor is interactive on AT&T N3
Walter.White said:
Can you please post ALL of your kernel settings (Governor, Schedulers etc) ??
Currently our bootloader is locked so we can only change Default governor and that's it. But as soon as someone finds an exploit or something I'll be trying out your settings.
P.S. Default governor is interactive on AT&T N3
Click to expand...
Click to collapse
First time I've ever seen default be interactive on a device that includes the governor. Interesting to know!
You can change specifics in your /etc/init.qcom.post_boot.sh file as well.... That is where lines are called out for ondemand settings... Switch them there
Sent from another galaxy
thanks for posting here! from what i saw, ondemand was the default governor on my Note 3, but i went ahead and changed it to intereactive, and I also changed the scheduler from row to deadline.... and i feel like i am already noticing a significant difference in battery life. previously my battery would fall from 100 almost instantly after taking it off the charger, but now it seems like more of a steady drip! gonna keep running this way and see how it goes but it does feel a lot better, with seemingly about the same performance.
cun7 said:
Technical thread I wrote up about the subject... noob or dev check it out. I hope you find something useful to further your knowledge of Android/Linux
Cheers
http://forum.xda-developers.com/showthread.php?t=2649820
Click to expand...
Click to collapse
This is my first android device so I'm still learning. But I'm a fast learner so just point me in the right direction.
Code:
product_name=`getprop ro.product.name`
case "$product_name" in
klte*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
esac
timer_rate: 15000
timer_slack: 60000
min_sampling_time: 60000
hispeed_freq: 1728000
go_hispeed_load: 65
Also how do I change my Scheduler to Deadline?? And are there any settings that I need to change for deadline scheduler too??
P.S. I have attached init.qcom.post_boot.sh (just change ending from .pdf to .sh) from ATT N3 Variant. Any help will be appreciated.
Walter.White said:
This is my first android device so I'm still learning. But I'm a fast learner so just point me in the right direction.
Code:
product_name=`getprop ro.product.name`
case "$product_name" in
klte*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
esac
timer_rate: 15000
timer_slack: 60000
min_sampling_time: 60000
hispeed_freq: 1728000
go_hispeed_load: 65
Also how do I change my Scheduler to Deadline?? And are there any settings that I need to change for deadline scheduler too??
P.S. I have attached init.qcom.post_boot.sh (just change ending from .pdf to .sh) from ATT N3 Variant. Any help will be appreciated.
Click to expand...
Click to collapse
I'll edit it for you tonight once I get home and send it back to you
Sent from another galaxy
cun7 said:
I'll edit it for you tonight once I get home and send it back to you
Sent from another galaxy
Click to expand...
Click to collapse
Thank you. Two more things.
1. How do I change my default scheduler from cfq to deadline ??
2. How do I change my cache size to 4096 ??
(Is there a way to do it besides using init.d script??)
Walter.White said:
Thank you. Two more things.
1. How do I change my default scheduler from cfq to deadline ??
2. How do I change my cache size to 4096 ??
(Is there a way to do it besides using init.d script??)
Click to expand...
Click to collapse
The only way to change it without using a script is to use an app. I prefer TricksterMod. I like tinkering with scripts every now and again, but it can be a pain to simply have to reboot your device after editing some stuff in init.d or post_boot.sh
Give trickster a shot. I just got home, I'll look at your post boot file and send it back to you. I'll go ahead and add lines in there for setting the read ahead size and scheduler.
cun7 said:
The only way to change it without using a script is to use an app. I prefer TricksterMod. I like tinkering with scripts every now and again, but it can be a pain to simply have to reboot your device after editing some stuff in init.d or post_boot.sh
Give trickster a shot. I just got home, I'll look at your post boot file and send it back to you. I'll go ahead and add lines in there for setting the read ahead size and scheduler.
Click to expand...
Click to collapse
Thanks man. I appreciate it.
cun7 said:
The only way to change it without using a script is to use an app. I prefer TricksterMod. I like tinkering with scripts every now and again, but it can be a pain to simply have to reboot your device after editing some stuff in init.d or post_boot.sh
Give trickster a shot. I just got home, I'll look at your post boot file and send it back to you. I'll go ahead and add lines in there for setting the read ahead size and scheduler.
Click to expand...
Click to collapse
Did you had chance to look at it?

GUIDE - Set cpu frequecies on MP-decision

I made a script to set frequencies on mp-decision frequency server.
Code:
#!/system/bin/sh
# available frequencies
# 300000
# 384000
# 600000
# 787200
# 998400
# 1094400
# 1190400
# mp-decision frequency setting
sleep 10
#min freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
#max freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1190400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Copy this script to a file called 98mp-decisionfreq
To set frequency on boot, copy the file 98mp-decisionfreq to /system/etc/init.d/ and set permission to rwxr-xr-x. I use es-explorer to do this.
You can run this any time in terminal to change settings.
This script wil set cpufreq and change file permissions to read only (444) so it wil no be automatically overwritten, 644 is to set write acces to the file so that you can run the script again.
to remove frequency settings, delete the file 98mp-decisionfreq from init.d folder and reboot.
I have tested this on omnirom and it works for me. you can make it flashable zip wit zipme.

Categories

Resources