Debian with Popobox v1.0

Step 1: Make a Debian image

dd if=/dev/zero of=./debian1g.img count=1024 bs=1M
mkfs.ext4 ./debian1g.img 
tune2fs -O ^huge_file debian1g.img
mount -o loop ./debian1g.img /tmp/mnt/debian1g
cd /tmp/mnt/debian1g; 
sudo debootstrap --foreign --arch=armel squeeze debian

Step 2: Copy image to popobox

On host:

cat debian1g.img |pv - |nc -l 3333

On popobox:

mkdir /mnt/flash/sandbox/
nc host_ip 3333 > /mnt/flash/sandbox/debian1g.img

Step 3: Create follow two scripts

cat > /mnt/flash/sandbox/

mkdir -p $debian_root

mount -o loop -t ext4 $debian_img $debian_root
mount -o bind /proc $debian_root/proc 
mount -o bind /dev $debian_root/dev
mount -o bind /sys $debian_root/sys
mount -o bind /dev/pts $debian_root/dev/pts
EOF(Press ctrl+D)
cat > /mnt/flash/sandbox/
chroot /mnt/flash/sandbox/debian /bin/bash
EOF(Press ctrl+D)

Step 4: Run /mnt/flash/sandbox/, then run /mnt/flash/sandbox/

Step 5: Now you should in the debian root, there are some extra works to be done

export LD_LIBRARY_PATH=/lib/arm-linux-gnueabi
/debootstrap/debootstrap --second-stage

cat > /etc/apt/sources.list
deb squeeze main non-free contrib
deb-src squeeze main non-free contrib

deb squeeze-updates main non-free contrib
deb-src squeeze-updates main non-free contrib
EOF(Ctrl+D again)

apt-get update

dpkg-reconfigure tzdata

aptitude install locales
dpkg-reconfigure locales  (choose zh_CN.utf8 and en_US.utf8)

cat > /etc/mtab
/dev/loop0 / ext4 rw,relatime,barrier=1,data=ordered 0 0

Step 6: final step, add /mnt/flash/sandbox/ in /etc/rc.local, make it run at boot time

Or customize to make it run your own service in debian