2011-01-29 18:04:11 +00:00
|
|
|
#!/system/bin/sh
|
|
|
|
#
|
|
|
|
# bind mount /data/local/download to /cache/download if cache
|
|
|
|
# partition is too small
|
|
|
|
#
|
|
|
|
|
|
|
|
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
|
2011-11-02 14:47:25 +00:00
|
|
|
DATAONLY=$(getprop dalvik.vm.dexopt-data-only)
|
|
|
|
if [ $DATAONLY -eq 1 ]
|
|
|
|
then
|
|
|
|
NEEDED=60000
|
|
|
|
else
|
|
|
|
NEEDED=105000
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $CACHESIZE -lt $NEEDED ]
|
2011-01-29 18:04:11 +00:00
|
|
|
then
|
|
|
|
mount -o bind /data/local/download /cache/download
|
|
|
|
fi
|
|
|
|
|
2011-06-18 16:42:06 +00:00
|
|
|
rm /cache/download/downloadfile*.apk >/dev/null 2>&1
|
2011-04-25 23:05:34 +00:00
|
|
|
|
2011-01-29 18:04:11 +00:00
|
|
|
exit 0
|