[Android Apps and Games] XDA-Dev-Knowledge:
Hello, my name is Knowledge.

What I am about to say will work for all phones that can run the first version of the OP's script, and are trying to run AT's modified version of the version 1 script but are having issues doing so.

I would like to say that your code

MAY

or

MAY NOT

, work for the init.d startup script. I am a script writer, upcoming app developer, and rom developer, and I'd like to say that your modified version of the earlier posted modified version of the OP script makes sense

IF AND ONLY IF

/dev/block/vold is where your system is mounted. But I have a solution for you if that doesn't work.

Read the blue and answer my questions and learn from what I am about to explain to you:

First, I'd like to say if you're putting this code onto your phone manually you need to run this code in adb shell after you put it on your phone manually (by whatever method, it could be root explorer, es file explorer, adb shell and you pushed the file, terminal emulator, however this code still needs to ran):

chmod 775 /system/etc/init.d/98sdfix

This is assuming that the directory your phone runs startup scripts from is /system/etc/init.d/. If not then change that as need be.

#!/system/bin/sh [COLOR=Red][COLOR=DeepSkyBlue]< this script will not run at all if /system/bin/sh isn't not where
your binaries sh file is located. The correct file path for the file, sh, for any script you
run, is needed here. Once this is done read on.[/COLOR]
[/COLOR]
mount -o remount,ro -t yaffs2 /dev/block/vold [COLOR=DeepSkyBlue]< What does this do? This just mounts
your phone's system as read/write but here the script still wouldn't run because you
have it set as mount....[U][B]ro[/B][/U]....../vold. The ro makes it mounted as read-only and the
script would never apply the values. Instead change it to[U][B] rw[/B][/U] and save the script. The
script mounts the system rw on start and remounts it as ro after it is finished. If it is
read-only, then the script can't write the values to the system. Thus, the reason why I
have told you to make that rw instead of ro. Now that I've made that clear, remove this
line and all other lines like it IF AND ONLY IF the script did not apply the new values
for you. How can you tell if it didn't run for you? Earlier I read that you said you want
to change the values for [B]179:8, and Default[/B] am I correct? If so then open adb shell
and type the following code after running the script:

[CODE]cat /sys/devices/virtual/bdi/179:8/read_ahead_kb

If that came out as

2048, you're good to go. But if not then, post the output and try this. Since you ran

your modified version of the script the first time and ran

cat /sys/...

in adb shell and it still

displayed as the default value. And then you ran the script by removing all

mount -o

remount...

lines from the script, saved it. and then rebooting the phone AND IT STILL

came out as the default value. Now with all the

mount -o remount...

lines removed, after

the first line in the script press the return/enter button twice and type "busybox mount

/system" (without the quotes). Then run the script once more. If none of the three

possible solutions I posted work for your phone then please logcat the boot process of

the phone for me. It should be noted that I hope you read this entire script before

running the script these past 3 times without reading all the comments on your modified

version of the modified version of the OP's script. I can't tell you how to specifically get

it running on your phone, so I'm trying to give you a little tip as to how to troubleshot the

script for your phone. [/COLOR]

# SD TWEAK

for sd in /sys/devices/virtual/bdi/*/

do if [ "$sd" = "/sys/devices/virtual/bdi/179:8/" ] && [ "$(cat ${sd}read_ahead_kb)" = 2048 ]

then

break

else

mount -t yaffs2 -o remount,rw /dev/block/vold /system

echo "2048" > "${sd}read_ahead_kb"

mount -t yaffs2 -o remount,ro /dev/block/vold /system

fi

done

mount -o remount,ro -t yaffs2 /dev/block/vold[/CODE]