#!/mnt/busybox sh BUSYBOX=/mnt/busybox freeze() { echo "an error occurred while executing '''$@''', freezing..." >&2 while true; do true done } do_or_freeze() { if $@; then return fi freeze $@ } do_or_freeze $BUSYBOX mkdir -p /dev do_or_freeze $BUSYBOX mknod -m 666 /dev/console c 5 1 do_or_freeze $BUSYBOX mknod -m 666 /dev/null c 1 3 do_or_freeze $BUSYBOX mknod -m 666 /dev/zero c 1 5 do_or_freeze $BUSYBOX mknod -m 666 /dev/sda b 8 0 do_or_freeze $BUSYBOX mknod -m 666 /dev/sda1 b 8 1 do_or_freeze $BUSYBOX mknod -m 666 /dev/ttyS0 c 4 64 do_or_freeze $BUSYBOX mknod -m 666 /dev/ttyS1 c 4 65 echo -n -e "deploying busybox... " >&2 do_or_freeze $BUSYBOX mkdir -p /bin do_or_freeze $BUSYBOX --install -s /bin export PATH="/bin" echo ok >&2 do_or_freeze mkdir -p /etc /root /proc do_or_freeze mount -t procfs proc proc cat > /etc/passwd < /etc/group < /etc/profile < /root/.profile < /dev/ttyS0 2> /dev/ttyS0'