[Desire Android Development] jukyO:
Update on script to have more then 40 Mb cache

Hello,

This script should give ability to A2SD users to have more than 41 Mb of cache to be able to download large apks from the Market.

I've tried the script myself after installing A2SD ROM, but it does not work for me.

Attached is the script I used, so maybe someone can take a look why it does not work?

It is a flashable zip which places "08cacheresize" script in /system/etc/init.d

"08cacheresize" checks on boot if /cache directory has less then 45 Mb, and if yes, it mounts by binding /cache/download to /sd-ext, so it should have enough space to download apks larger then 40 Mb from the Market.

Output of /cache/download after flashing:

bash-3.2# df -k /cache/download

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p2 983716 216940 766776 22% /sd-ext

So it is obvious that /cache/download has more than enough space here, but Marked is reporting error and FCs.

Logcat:

D/Finsky ( 1700): [1] Installer.downloadAndInstallAsset: Downloading and installing Wind-up Knight.
D/Finsky ( 1700): [1] DownloadImpl.setState: com.robotinvader.knightmare from null to UNQUEUED.
D/Finsky ( 1700): [1] DownloadQueueImpl.add: Download com.robotinvader.knightmare added to DownloadQueue
D/Finsky ( 1700): [1] DownloadImpl.setState: com.robotinvader.knightmare from UNQUEUED to QUEUED.
I/installd( 119): free_cache(43623794) avail 38236160
E/installd( 119): cannot open /data/secure/data/: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
E/installd( 119): Couldn't openat cache: No such file or directory
W/PackageManager( 147): Couldn't clear application caches
W/Finsky ( 1700): [26] PurgeCacheCallback.onComplete: Could not free required amount of space for download
E/ ( 1700): statfs /cache/download failed, errno: 2
D/AndroidRuntime( 1700): Shutting down VM
W/dalvikvm( 1700): threadid=1: thread exiting with uncaught exception (group=0x4014b568)
E/AndroidRuntime( 1700): FATAL EXCEPTION: main
E/AndroidRuntime( 1700): java.lang.IllegalArgumentException
E/AndroidRuntime( 1700): at android.os.StatFs.native_setup(Native Method)
E/AndroidRuntime( 1700): at android.os.StatFs.<init>(StatFs.java:32)
E/AndroidRuntime( 1700): at com.google.android.finsky.download.Storage.cachePartitionAvailableSpace(Storage.java:
36)
E/AndroidRuntime( 1700): at com.google.android.finsky.download.DownloadQueueImpl$StartNextDownloadRunnable.run(Do
wnloadQueueImpl.java:388)
E/AndroidRuntime( 1700): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 1700): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 1700): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1700): at android.app.ActivityThread.main(ActivityThread.java:3703)
E/AndroidRuntime( 1700): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1700): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1700): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
E/AndroidRuntime( 1700): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/AndroidRuntime( 1700): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 147): Force finishing activity com.android.vending/.AssetBrowserActivity
W/ActivityManager( 147): Activity pause timeout for HistoryRecord{40a18650 com.android.vending/.AssetBrowserActivity}
I/ActivityManager( 147): No longer want com.android.fileexplorer (pid 939): hidden #16
D/AudioHardwareQSD( 117): AudioHardware pcm playback is going to standby.
D/dalvikvm( 147): GC_FOR_MALLOC freed 368K, 35% free 6506K/9863K, external 0K/0K, paused 68ms
I/Process ( 1700): Sending signal. PID: 1700 SIG: 9
I/ActivityManager( 147): Process com.android.vending (pid 1700) has died.
I/WindowManager( 147): WIN DEATH: Window{40855650 com.android.vending/com.android.vending.AssetBrowserActivity paused=f
alse}

Maybe I need to mount different partition. Hopefully someone more experienced can help.

Thanks,

jukyO