String[] cmd =
{
"mkdir /data/local/debian",
"mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system",
"export bin=/system/bin",
"export img=" + sdpath + "/debian/debian.img",
"export mnt=/data/local/debian",
"export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH",
"export TERM=linux",
"export HOME=/root",
//"busybox mknod /dev/block/loop5 b 7 0",
//"busybox losetup /dev/block/loop5 $img",
//"busybox mount -t ext3 -o noatime,nodiratime /dev/block/loop5 $mnt",
"mount -t ext3 -o loop,noatime,nodiratime $img $mnt",
"busybox mount -t devpts devpts $mnt/dev/pts",
"busybox mount -t proc proc $mnt/proc",
"busybox mount -t sysfs sysfs $mnt/sys",
"busybox mount --bind " + sdpath + " $mnt/sdcard",
"busybox sysctl -w net.ipv4.ip_forward=1",
"echo \"nameserver 8.8.8.8\" > $mnt/etc/resolv.conf",
"echo \"nameserver 8.8.4.4\" >> $mnt/etc/resolv.conf",
"echo \"127.0.0.1 localhost\" > $mnt/etc/hosts",
"busybox chroot $mnt /bin/bash",
"if ps -Al | grep vnc > /dev/null",
"then",
"echo \"vnc detected\"",
"else",
"export USER=root",
"rm -r /tmp",
"mkdir /tmp",
"vncserver -geometry 854x480",
"fi",
"exit",
"mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system",
};
These are executed by the program in order to boot the debian image in /sdcard/debian/ (or /mnt/sdcard/debian)