--- /dev/null
+#http://www.debian.org/releases/stable/i386/apds03.html.en
+
+SRC=/root/debootstrap.d
+SRCHOSTNAME=moo17
+#HOSTNAME=debootstrap-test
+#pick a hostname!
+
+PARTITIONS=/root/price/partitions/testpart
+
+#losetup is crazy. pick a free loop device. see /usr/sbin/s-x-lvcopy for code.
+LODEV=/dev/loopNN-this-is-not-valid
+
+
+
+VOLUME=/dev/xenvg/d_$HOSTNAME_hda
+DEST=/srv/$HOSTNAME/
+
+sfdisk -f $VOLUME <$PARTITIONS
+losetup -o $(( 7903980 * 512 )) $LODEV $VOLUME
+mkswap $LODEV
+losetup -d $LODEV
+losetup -o $(( 63 * 512 )) $LODEV $VOLUME
+mkfs.ext3 -b 1024 $LODEV $(( 7903917 / 2 ))
+mkdir -p $DEST
+mount $LODEV $DEST
+
+
+time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian
+
+cp -a $SRC/fstab $DEST/etc/fstab
+cp -a $SRC/interfaces $DEST/etc/network/interfaces
+cp -a $SRC/sources.list $DEST/etc/apt/sources.list
+cp -a $SRC/update-grub.diff $DEST/root/update-grub.diff
+echo $HOSTNAME > $DEST/etc/hostname
+sed s/$SRCHOSTNAME/$HOSTNAME/g $SRC/hosts > $DEST/etc/hosts
+
+mount -t proc proc $DEST/proc
+
+LANG=C chroot "$DEST" <<ENDCHROOT
+
+export TERM=xterm-color
+mount -a
+
+cd /media
+mkdir cdrom0
+ln -s cdrom0 cdrom
+cd /
+ln -s media/cdrom
+
+echo $'y\n3\nEastern' | tzconfig
+export DEBIAN_FRONTEND=noninteractive
+
+echo 'locales locales/locales_to_be_generated multiselect en_US ISO-8859-1' | debconf-set-selections
+
+
+aptitude update
+aptitude -y install locales linux-image-xen-amd64
+aptitude --without-recommends -y install ~pstandard ~prequired ~pimportant
+#strace tasksel install standard 2>&1 | less
+aptitude clean
+
+mkdir /boot/grub
+aptitude install grub
+patch /usr/sbin/update-grub </root/update-grub.diff
+update-grub
+patch /boot/grub/menu.lst </root/menu.lst.diff
+patch /etc/inittab </root/inittab.diff
+
+rm /root/update-grub.diff
+ENDCHROOT
+
+## kill atd and rpc.statd that are using $DEST
+umount $DEST/proc
+umount $DEST
+losetup -d $LODEV
--- /dev/null
+# /etc/fstab: static file system information.
+#
+# <file system> <mount point> <type> <options> <dump> <pass>
+proc /proc proc defaults 0 0
+/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
+/dev/hda5 none swap sw 0 0
+/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
--- /dev/null
+127.0.0.1 localhost
+127.0.1.1 moo17.servers.csail.mit.edu moo17
+
+# The following lines are desirable for IPv6 capable hosts
+::1 ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
--- /dev/null
+--- inittab.orig 2008-04-22 05:42:50.000000000 -0400
++++ inittab 2008-04-22 05:43:04.000000000 -0400
+@@ -60,7 +60,7 @@
+
+ # Example how to put a getty on a serial line (for a terminal)
+ #
+-#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
++T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
+ #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
+
+ # Example how to put a getty on a modem line.
--- /dev/null
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+allow-hotplug eth0
+iface eth0 inet dhcp
--- /dev/null
+--- menu.lst.orig 2008-04-22 05:41:32.000000000 -0400
++++ menu.lst 2008-04-22 05:42:15.000000000 -0400
+@@ -59,7 +59,7 @@
+ ## e.g. kopt=root=/dev/hda1 ro
+ ## kopt_2_6_8=root=/dev/hdc1 ro
+ ## kopt_2_6_8_2_686=root=/dev/hdc2 ro
+-# kopt=root=/dev/hda1 ro
++# kopt=root=/dev/hda1 ro console=ttyS0,9600,8n1
+
+ ## default grub root device
+ ## e.g. groot=(hd0,0)
--- /dev/null
+
+deb http://debian.lcs.mit.edu/debian/ etch main
+deb-src http://debian.lcs.mit.edu/debian/ etch main
+
+deb http://security.debian.org/ etch/updates main
+deb-src http://security.debian.org/ etch/updates main
--- /dev/null
+--- update-grub.orig 2008-04-22 01:13:34.000000000 -0400
++++ update-grub 2008-04-22 01:13:13.000000000 -0400
+@@ -1036,10 +1036,10 @@
+
+ if [ ! "$in_domU" ] && [ "$is_xen" ]; then
+ # skip xen kernels
+- continue
++ :
+ elif [ "$in_domU" ] && ! [ "$is_xen" ]; then
+ # skip non-xen kernels
+- continue
++ :
+ fi
+ kern="/boot/$kern"
+ newerKernels=""