[Sony Ericsson XPERIA X10 Mini] owain94:
#!/system/bin/busybox sh
#
# Universal Chargemon By D4rKn3sSyS

V6=`cat /system/build.prop | grep 'ro.build.version.release=2.2.1'`
echo "$V6" > /system/romcm6.bin
V7=`cat /system/build.prop | grep 'ro.build.version.release=2.3.3'`
echo "$V7" > /system/romcm7.bin

if [ -e /data/local/tmp/sdcardOS1 ]
then

mount -o remount,rw rootfs /

chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R

cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/sdcardos1-ramdisk.tar

# unmounting
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1

# mount sd
dosfsck -y /dev/block/mmcblk0p1
sleep 5

mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sd
sleep5

# mount ext2 images
losetup /dev/block/loop1 /sd/dualboot/system1.img
sleep 5

losetup /dev/block/loop2 /sd/dualboot/data1.img
sleep 5

losetup /dev/block/loop3 /sd/dualboot/cache1.img
sleep 5

e2fsck -y /dev/block/loop1
e2fsck -y /dev/block/loop2
e2fsck -y /dev/block/loop3

mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
sleep 5

mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
sleep 5

mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache

exit

fi

# chroot
chroot / /init

# skip rest
exit

if [ -s /system/romcm6.bin ]; then

#for cyanogenmod

cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /

# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3

# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar

# Umount /system
umount -l /dev/block/mtdblock0

# chroot
chroot / /init

fi

/system/bin/charger

# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init

exit

if [ -s /system/romcm7.bin ]; then

cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /

# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3

# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar

# Umount /system
umount -l /dev/block/mtdblock0

# chroot
chroot / /init

fi

/system/bin/charger

# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init

exit

else

#for stock
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck ]
then

# remount rootfs rw
mount -o remount,rw rootfs /

# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3

# Mount recovery partition
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar

# Umount /system
umount -l /dev/block/mtdblock0

chroot / /init

fi

/system/bin/charger

# Continue booting
exit

fi

debug it first thisis from my mobile phone so im almost sure i did a couple things wrong :P