Merge "cm: bind mount DOWNLOAD_CACHE to /data if /cache is less then 20MB" into gingerbread
diff --git a/prebuilt/common/etc/init.d/05mountsd b/prebuilt/common/etc/init.d/05mountsd
old mode 100644
new mode 100755
diff --git a/prebuilt/common/etc/init.d/06mountdl b/prebuilt/common/etc/init.d/06mountdl
new file mode 100755
index 0000000..bed7019
--- /dev/null
+++ b/prebuilt/common/etc/init.d/06mountdl
@@ -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
diff --git a/products/common.mk b/products/common.mk
index d34a4cf..89cd782 100644
--- a/products/common.mk
+++ b/products/common.mk
@@ -69,6 +69,8 @@
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 @@
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 += \