summaryrefslogtreecommitdiffstats
path: root/prebuilt/common/etc/init.d/10apps2sd
diff options
context:
space:
mode:
Diffstat (limited to 'prebuilt/common/etc/init.d/10apps2sd')
-rwxr-xr-xprebuilt/common/etc/init.d/10apps2sd24
1 files changed, 24 insertions, 0 deletions
diff --git a/prebuilt/common/etc/init.d/10apps2sd b/prebuilt/common/etc/init.d/10apps2sd
new file mode 100755
index 0000000..b4d0192
--- /dev/null
+++ b/prebuilt/common/etc/init.d/10apps2sd
@@ -0,0 +1,24 @@
+#!/system/bin/sh
+# Make sure the Apps2SD structure exists.
+
+if [ "$SD_EXT_DIRECTORY" = "" ];
+then
+ SD_EXT_DIRECTORY=/sd-ext;
+fi;
+
+if ! awk -vDIR="$SD_EXT_DIRECTORY" '$2 == DIR { exit 1; }' /proc/mounts ;
+then
+ # create directories if necessary.
+ for i in app app-private dalvik-cache;
+ do
+ if [ ! -d $SD_EXT_DIRECTORY/$i ];
+ then
+ mkdir $SD_EXT_DIRECTORY/$i;
+ busybox chown 1000:1000 $SD_EXT_DIRECTORY/$i;
+ busybox chmod 771 $SD_EXT_DIRECTORY/$i;
+ log -p i -t a2sd "$SD_EXT_DIRECTORY/$i created"
+ fi;
+ done
+ setprop cm.a2sd.active 1
+ log -p i -t a2sd "Apps2SD successfully activated";
+fi;