[Sony Ericsson XPERIA X10 Mini] li_boud:
This is the correct app2sd.sh, that worked for me.. There were few errors in the script, which I corrected -

For Mini Pro (U20i, U20a) And Mini (E10i, E10a)

#!/system/bin/sh
cd /sdcard

app2sd()
{
su <<fg
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
mkdir /system/sd
mkdir /data/appbak
mount -t ext2 /dev/block//vold/179:2 /system/sd
if type busybox
then
else
mkdir /system/xbin
cat /sdcard/busybox > /system/xbin/busybox
chmod 755 /system/xbin/busybox
/system/xbin/busybox --install -s /system/xbin/
fi
mv /data/app/* /data/appbak/
busybox cp -a /data/appbak /system/sd/app
rm -r /data/app
ln -s /data/appbak/ /data/app
rm /etc/mount_sd.sh
mv /system/bin/sh /system/bin/sh_bak
cat /sdcard/sh.sh > /system/bin/sh
chmod 755 /system/bin/sh
busybox cp /sdcard/mount_sd.sh /etc/mount_sd.sh
echo "
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+--------------------------------+
"
sleep 1
reboot
fg
menu
}

app2sdU()
{

if busybox [ -f /system/bin/sh_bak ] ;
then
echo "
+________________________________+
|********************************|
|* do you choose to *|
|* *|
|*[1] keep app files from sdcard*|
|*[2] from the backup *|
|********************************|
+--------------------------------+"
echo -n "[1]"
read ans

su <<df
echo $ans
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system

rm /data/app
mkdir /data/app
rm /etc/mount_sd.sh
rm /system/bin/sh
mv /system/bin/sh_bak /system/bin/sh

case $ans in

2)
busybox cp /data/appbak/* /data/app/
rm -f /data/appbak
echo "
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+--------------------------------+
"

reboot
exit;;
1)
busybox cp /system/sd/app/* /data/app
rm -f /data/appbak
echo "
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+--------------------------------+
"

reboot
exit;;
*)
busybox cp /system/sd/app/* /data/app
echo "
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+--------------------------------+
"

reboot

exit;;
esac

df
else
echo "App2sd is not installed sry :(, cant uinstalled it "
sleep 2
fi

menu
}

menu()
{
echo "
+________________________________+
|********************************|
|*Welcome To wolfilein's App2sd *|
|*installing script *|
|********************************|
+--------------------------------+

~this version should be go on any device ~

+___________________+
|********************|
|* Menu *|
|* *|
|*[0] install app2sd*|
|*[1] remove app2sd *|
|*[2] exit *|
|********************|
+--------------------+
"
echo -n "[0]"
read mm1
case $mm1 in
0)
echo ""
echo ""
sleep 1
app2sd;;
1)
echo ""
echo ""
sleep 1
app2sdU;;
2)
exit;;

*)
echo ""
echo ""
sleep 1
app2sd;;
esac

}

menu

Although I ran the script manually, so I can verify that everything was set and in place before I reboot the phone..

This is the list of commands I ran -

D:\Softwares\Android\android-sdk-windows\tools>adb shell
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
# cat /sdcard/app2sd/busybox > /system/xbin/busybox
cat /sdcard/app2sd/busybox > /system/xbin/busybox
# chmod 755 /system/xbin/busybox
chmod 755 /system/xbin/busybox
# /system/xbin/busybox --install -s /system/xbin/
/system/xbin/busybox --install -s /system/xbin/
# busybox
busybox
BusyBox v1.14.3 (2009-08-10 13:35:52 BST) multi-call binary
Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]...
or: function [arguments]...

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!

Currently defined functions:
[, [[, acpid, addgroup, adduser, adjtimex, ar, arp, arping,
ash, awk, basename, blkid, brctl, bunzip2, bzcat, bzip2,
cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd,
chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp,
cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc,
dd, deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay,
diff, dirname, dmesg, dnsd, dos2unix, du, dumpkmap, dumpleases,
echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake,
expand, expr, fakeidentd, false, fbset, fbsplash, fdflush,
fdformat, fdisk, fgrep, find, findfs, fold, free, freeramdisk,
fsck, fsck.minix, ftpd, ftpget, ftpput, fuser, getopt, getty,
grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid,
hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave,
ifup, inetd, init, insmod, install, ionice, ip, ipaddr,
ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel,
kbd_mode, kill, killall, killall5, klogd, last, length,
less, linux32, linux64, linuxrc, ln, loadfont, loadkmap,
logger, login, logname, logread, losetup, lpd, lpq, lpr,
ls, lsattr, lsmod, lzmacat, makedevs, makemime, man, md5sum,
mdev, mesg, microcom, mkdir, mkdosfs, mkfifo, mkfs.minix,
mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modprobe, more,
mount, mountpoint, msh, mt, mv, nameif, nc, netstat, nice,
nmeter, nohup, nslookup, od, openvt, passwd, patch, pgrep,
pidof, ping, ping6, pipe_progress, pivot_root, pkill, popmaildir,
poweroff, printenv, printf, ps, pscan, pwd, raidautorun,
rdate, rdev, readahead, readlink, readprofile, realpath,
reboot, reformime, renice, reset, resize, rm, rmdir, rmmod,
route, rtcwake, run-parts, runlevel, runsv, runsvdir, rx,
script, sed, sendmail, seq, setarch, setconsole, setfont,
setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum,
sha256sum, sha512sum, showkey, slattach, sleep, softlimit,
sort, split, start-stop-daemon, stat, strings, stty, su,
sulogin, sum, sv, svlogd, swapoff, swapon, switch_root,
sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet,
telnetd, test, tftp, tftpd, time, timeout, top, touch, tr,
traceroute, true, tty, ttysize, tunctl, udhcpc, udhcpd,
udpsvd, umount, uname, uncompress, unexpand, uniq, unix2dos,
unlzma, unzip, uptime, usleep, uudecode, uuencode, vconfig,
vi, vlock, watch, watchdog, wc, wget, which, who, whoami,
xargs, yes, zcat, zcip

# mkdir /system/sd
mkdir /system/sd
# mount -t ext2 /dev/block//vold/179:2 /system/sd
mount -t ext2 /dev/block//vold/179:2 /system/sd
# exit
exit

D:\Softwares\Android\android-sdk-windows\tools>adb push c:\users\chinmay\downloa
ds\app2sd /sdcard/app2sd/
push: c:\users\chinmay\downloads\app2sd/sh.sh -> /sdcard/app2sd/sh.sh
push: c:\users\chinmay\downloads\app2sd/mount_sd.sh -> /sdcard/app2sd/mount_sd.s
h
push: c:\users\chinmay\downloads\app2sd/busybox -> /sdcard/app2sd/busybox
push: c:\users\chinmay\downloads\app2sd/app2sd.sh -> /sdcard/app2sd/app2sd.sh
4 files pushed. 0 files skipped.
3130 KB/s (1850106 bytes in 0.577s)

D:\Softwares\Android\android-sdk-windows\tools>adb shell
# busybox cp -a /data/app/* /system/sd/app
busybox cp -a /data/app/* /system/sd/app
# mkdir /data/appbak
mkdir /data/appbak
# busybox cp -a /data/app/* /data/appbak
busybox cp -a /data/app/* /data/appbak
# busybox cp -a /data/app/* /data/appbak/
busybox cp -a /data/app/* /data/appbak/
# busybox cp -a /data/app/* /system/sd/app/
busybox cp -a /data/app/* /system/sd/app/
# rm -r /data/app
rm -r /data/app
# ln -s /data/appbak/ /data/app/
ln -s /data/appbak/ /data/app/
link failed No such file or directory
# ln -s /data/appbak/ /data/app
ln -s /data/appbak/ /data/app
# rm /etc/mount_sd.sh
rm /etc/mount_sd.sh
rm failed for /etc/mount_sd.sh, No such file or directory
# mv /system/bin/sh /system/bin/sh_bak
mv /system/bin/sh /system/bin/sh_bak
# cat /sdcard/app2sd/sh.sh > /system/bin/sh
cat /sdcard/app2sd/sh.sh > /system/bin/sh
# chmod 777 /system/bin/sh
chmod 777 /system/bin/sh
# busybox cp /sdcard/app2sd/mount_sd.sh /etc/mount_sd.sh
busybox cp /sdcard/app2sd/mount_sd.sh /etc/mount_sd.sh