DIR="$2"
MIRROR="$3"
-debootstrap "$DIST" "$DIR" $MIRROR
+mkdir -p "$DIR"
+debootstrap "$DIST" "$DIR" "$MIRROR"
# debian_chroot
echo $DIST > $DIR/etc/debian_chroot
perl -naF: -e 'print if $F[2] >= 1000 and $F[2] < 2000' /etc/passwd >> $DIR/etc/passwd
# locale
-chroot $DIR locale-gen $LANG
+chroot $DIR locale-gen $LANG
# bind mounts
if ! grep -q $DIR /etc/fstab; then
chroot $DIR apt-get update
# common packages for development
-chroot $DIR apt-get install -y build-essential devscripts fakeroot
+chroot $DIR apt-get install -y build-essential devscripts fakeroot