1 #http://www.debian.org/releases/stable/i386/apds03.html.en
3 SRC=/root/debootstrap.d
5 #HOSTNAME=debootstrap-test
10 PARTITIONS=/root/price/partitions/testpart
12 #losetup is crazy. pick a free loop device. see /usr/sbin/s-x-lvcopy for code.
14 VOLUME=/dev/xenvg/d_$HOSTNAME_hda
18 ### Create the device for SIPB-Xen purposes
20 sfdisk -f $VOLUME <$PARTITIONS
21 SWAPDEV=$(sipb-xen-losetup $VOLUME $(( 7903980 * 512 )))
24 IMAGEDEV=$(sipb-xen-losetup $VOLUME $(( 63 * 512 )))
25 # mkfs.ext3 -b 1024 $IMAGEDEV $(( 7903917 / 2 ))
30 CREATE_IMAGE_CONFIG=./paravm-create.conf
32 xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --config $CREATE_IMAGE_CONFIG \
33 --dist $DIST --hostname $HOSTNAME
35 # xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --ide --arch amd64 --dist etch --hostname moo19 --mirror http://debian.lcs.mit.edu/debian --ip=18.181.0.186 --netmask=255.255.0.0 --gateway=18.181.0.1 --cache
40 time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian
42 cp -a $SRC/fstab $DEST/etc/fstab
43 cp -a $SRC/interfaces $DEST/etc/network/interfaces
44 cp -a $SRC/sources.list $DEST/etc/apt/sources.list
45 cp -a $SRC/update-grub.diff $DEST/root/update-grub.diff
46 echo $HOSTNAME > $DEST/etc/hostname
47 sed s/$SRCHOSTNAME/$HOSTNAME/g $SRC/hosts > $DEST/etc/hosts
49 mount -t proc proc $DEST/proc
51 LANG=C chroot "$DEST" <<ENDCHROOT
53 export TERM=xterm-color
62 echo $'y\n3\nEastern' | tzconfig
63 export DEBIAN_FRONTEND=noninteractive
65 echo 'locales locales/locales_to_be_generated multiselect en_US ISO-8859-1' | debconf-set-selections
69 aptitude -y install locales linux-image-xen-amd64
70 aptitude --without-recommends -y install ~pstandard ~prequired ~pimportant
71 #strace tasksel install standard 2>&1 | less
76 patch /usr/sbin/update-grub </root/update-grub.diff
78 patch /boot/grub/menu.lst </root/menu.lst.diff
79 patch /etc/inittab </root/inittab.diff
81 rm /root/update-grub.diff
84 ## kill atd and rpc.statd that are using $DEST