cm: bind mount DOWNLOAD_CACHE to /data if /cache is less then 20MB

this is useful for all user which want to use cMTD or static
  partition size (like alpharev) to assign more space to /data
  reducing /cache size

Change-Id: Ib251c9bea1dea50b6c444df977aa605e58008c41
This commit is contained in:
Giulio Cervera 2011-01-29 19:04:11 +01:00
parent d651911c89
commit de7b80fdf1
3 changed files with 15 additions and 1 deletions

0
prebuilt/common/etc/init.d/05mountsd Normal file → Executable file
View File

View File

@ -0,0 +1,13 @@
#!/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)
if [ $CACHESIZE -lt 20000 ]
then
mount -o bind /data/local/download /cache/download
fi
exit 0

View File

@ -69,6 +69,8 @@ PRODUCT_COPY_FILES += \
vendor/cyanogen/prebuilt/common/etc/init.d/01sysctl:system/etc/init.d/01sysctl \
vendor/cyanogen/prebuilt/common/etc/init.d/03firstboot:system/etc/init.d/03firstboot \
vendor/cyanogen/prebuilt/common/etc/init.d/04modules:system/etc/init.d/04modules \
vendor/cyanogen/prebuilt/common/etc/init.d/05mountsd:system/etc/init.d/05mountsd \
vendor/cyanogen/prebuilt/common/etc/init.d/06mountdl:system/etc/init.d/06mountdl \
vendor/cyanogen/prebuilt/common/etc/init.d/20userinit:system/etc/init.d/20userinit \
vendor/cyanogen/prebuilt/common/bin/handle_compcache:system/bin/handle_compcache \
vendor/cyanogen/prebuilt/common/bin/compcache:system/bin/compcache \
@ -80,7 +82,6 @@ PRODUCT_COPY_FILES += \
vendor/cyanogen/prebuilt/common/xbin/openvpn-up.sh:system/xbin/openvpn-up.sh
PRODUCT_COPY_FILES += \
vendor/cyanogen/prebuilt/common/etc/init.d/05mountsd:system/etc/init.d/05mountsd
# vendor/cyanogen/prebuilt/common/etc/init.d/10apps2sd:system/etc/init.d/10apps2sd
PRODUCT_COPY_FILES += \