[Desire Android Development] mildwild:
Mildwild 5.0

#!/system/bin/sh
# Make sure the Apps2SD structure exists.

LOG="log -p i -t a2sd "

if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi

if [[ -e /data/property/persist.sys.magpie.data2sd ]]
then
data2sd=`cat /data/property/persist.sys.magpie.data2sd`
else
data2sd=0
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 "$SD_EXT_DIRECTORY/$i created"
fi
done
#clear any /data/cache directory that my have become
#orphaned
busybox rm -rf /data/cache
#indicate magpie is active
setprop magpie.a2sd.active 1
$LOG "Apps2SD successfully activated"

#see if we need to make a data bind
if [ "$data2sd" == "1" ]
then
if [ -e /data/data/.sdcard ]
then
$LOG "Data2SD already copied to SDCard"
else
$LOG "Copying data to SDCard"
if [ -d /sd-ext/app-data ]
then
logwrapper busybox cp -af /data/data/* /sd-ext/app-data/
else
logwrapper busybox cp -af /data/data /sd-ext/app-data
fi
fi
logwrapper busybox rm -rf /data/data
mkdir /data/data
logwrapper busybox chown system:system /data/data
logwrapper busybox chmod 771 /data/data
logwrapper busybox touch /data/data/.sdcard
if [ -d /sd-ext/app-data ]
then
$LOG "/sd-ext/app-data exists"
else
$LOG "creating /sd-ext/app-data"
mkdir /sd-ext/app-data
fi
logwrapper busybox chown system:system /sd-ext/app-data
logwrapper busybox chmod 771 /sd-ext/app-data

$LOG "make data bind mount"
logwrapper busybox mount -o bind /sd-ext/app-data /data/data
else
if [ -e /data/data/.sdcard ]
then
$LOG "Move back to data"
if [ -d /sd-ext/app-data ]
then
logwrapper busybox cp -af /sd-ext/app-data/* /data/data/
logwrapper busybox rm -rf /sd-ext/app-data
fi
rm /data/data/.sdcard
fi
fi
fi

MildWild MW-10 or other MildWild rom´s

#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# Original Apps2SD script by shade@chemlab.org (cyanogen)
# Fixed for slow detection of SD cards by _thalamus and output a bit more debugging info so we can see where problems are arising.

# execute any postinstall script then kill it

enablea2sd () {
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /sd-ext;
busybox chown 1000:1000 /sd-ext;
busybox chmod 771 /sd-ext;

# clean up any old symlinks, create data directories
for i in data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;

# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /sd-ext/data ];
then
busybox cp -a /sd-ext/data/* /data/data/;
busybox rm -rf /sd-ext/data;
fi;

# move apps from internal memory to sdcard
for i in app app-private dalvik-cache;
do
if [ ! -d /sd-ext/$i ];
then
mkdir /sd-ext/$i;
fi

busybox chown 1000:1000 /sd-ext/$i;
busybox chmod 771 /sd-ext/$i

if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /sd-ext/$i/;
busybox rm -f /data/$i/*;
fi;
done;

# symlink app dirs - they must be on the same filesystem
for i in app app-private dalvik-cache;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /sd-ext/$i /data/$i;
fi;
done;

# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /sd-ext/$i ]; then rm -f /sd-ext/$i; fi
done;

# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /sd-ext/app/*.odex

echo "+++ Apps-to-SD successfully enabled";

}

disablea2sd() { # replace symlinks with directories so we can boot without sd
for i in app app-private dalvik-cache;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
}

if [ -e /dev/block/mmcblk0p1 ]; # We check for the presence of the FAT partition first to see if the SD has initialised.
then
echo "SD Card has been initialised...checking for ext partition.";
if [ -e /dev/block/mmcblk0p2 ]; # If false, it isn't there so we don't have to sleep the script and delay the boot.
then
enablea2sd;
else
echo "No ext partition present, apps2sd disabled";
disablea2sd;
fi;

else
sleep 4; #Enables time for a slow SD to be detected and populate the device nodes.
if [ -e /dev/block/mmcblk0p2 ];
then
echo "enablea2sd for slow SD card";
enablea2sd;
else
echo "No ext partition present after sleep, apps2sd disabled";
disablea2sd;
fi;
fi;

sync;