6 [ "$DIST" ] && [ "$DIR" ] && [ "$MIRROR" ] || {
7 echo "Usage: $0 <dist> <directory> <mirror>" >&2
12 debootstrap "$DIST" "$DIR" "$MIRROR"
13 chroot $DIR apt-get install locales
16 echo $DIST > $DIR/etc/debian_chroot
19 echo "127.0.0.1 localhost.localdomain localhost" > $DIR/etc/hosts
22 perl -naF: -e 'print if $F[2] >= 1000 and $F[2] < 2000' /etc/passwd >> $DIR/etc/passwd
25 chroot $DIR locale-gen $LANG
28 if ! grep -q $DIR /etc/fstab; then
29 cat <<EOF >> /etc/fstab
32 /home $DIR/home none bind 0 0
33 /proc $DIR/proc none bind 0 0
34 /sys $DIR/sys none bind 0 0
35 /tmp $DIR/tmp none bind 0 0
44 cat <<EOF > $DIR/etc/apt/sources.list
45 deb $MIRROR $DIST main restricted universe multiverse
46 deb-src $MIRROR $DIST main restricted universe multiverse
47 deb $MIRROR $DIST-updates main restricted universe multiverse
48 deb-src $MIRROR $DIST-updates main restricted universe multiverse
49 deb $MIRROR $DIST-proposed main restricted universe multiverse
50 deb-src $MIRROR $DIST-proposed main restricted universe multiverse
51 deb $MIRROR $DIST-security main restricted universe multiverse
52 deb-src $MIRROR $DIST-security main restricted universe multiverse
55 chroot $DIR apt-get update
57 # common packages for development
58 chroot $DIR apt-get install -y build-essential devscripts fakeroot