replicant-vendor_replicant/prebuilt/common/etc/init.d/06mountdl
Giulio Cervera 91d5b38230 cm: updated 'download space check' init script
increase required space needed for market downloads from ~20MB
to ~60MB (~105MB if system dalvik is on /cache)

Change-Id: I52fcd648374db4bf73ff478e9991a6a3162521d5
2011-11-02 15:53:15 +01:00

24 lines
443 B
Bash
Executable File

#!/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)
DATAONLY=$(getprop dalvik.vm.dexopt-data-only)
if [ $DATAONLY -eq 1 ]
then
NEEDED=60000
else
NEEDED=105000
fi
if [ $CACHESIZE -lt $NEEDED ]
then
mount -o bind /data/local/download /cache/download
fi
rm /cache/download/downloadfile*.apk >/dev/null 2>&1
exit 0