1 #http://www.debian.org/releases/stable/i386/apds03.html.en
3 SRC=/root/debootstrap.d
5 #HOSTNAME=debootstrap-test
8 PARTITIONS=/root/price/partitions/testpart
10 #losetup is crazy. pick a free loop device. see /usr/sbin/s-x-lvcopy for code.
11 LODEV=/dev/loopNN-this-is-not-valid
15 VOLUME=/dev/xenvg/d_$HOSTNAME_hda
18 sfdisk -f $VOLUME <$PARTITIONS
19 losetup -o $(( 7903980 * 512 )) $LODEV $VOLUME
22 losetup -o $(( 63 * 512 )) $LODEV $VOLUME
23 mkfs.ext3 -b 1024 $LODEV $(( 7903917 / 2 ))
28 time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian
30 cp -a $SRC/fstab $DEST/etc/fstab
31 cp -a $SRC/interfaces $DEST/etc/network/interfaces
32 cp -a $SRC/sources.list $DEST/etc/apt/sources.list
33 cp -a $SRC/update-grub.diff $DEST/root/update-grub.diff
34 echo $HOSTNAME > $DEST/etc/hostname
35 sed s/$SRCHOSTNAME/$HOSTNAME/g $SRC/hosts > $DEST/etc/hosts
37 mount -t proc proc $DEST/proc
39 LANG=C chroot "$DEST" <<ENDCHROOT
41 export TERM=xterm-color
50 echo $'y\n3\nEastern' | tzconfig
51 export DEBIAN_FRONTEND=noninteractive
53 echo 'locales locales/locales_to_be_generated multiselect en_US ISO-8859-1' | debconf-set-selections
57 aptitude -y install locales linux-image-xen-amd64
58 aptitude --without-recommends -y install ~pstandard ~prequired ~pimportant
59 #strace tasksel install standard 2>&1 | less
64 patch /usr/sbin/update-grub </root/update-grub.diff
66 patch /boot/grub/menu.lst </root/menu.lst.diff
67 patch /etc/inittab </root/inittab.diff
69 rm /root/update-grub.diff
72 ## kill atd and rpc.statd that are using $DEST