#http://www.debian.org/releases/stable/i386/apds03.html.en SRC=/root/debootstrap.d SRCHOSTNAME=moo17 #HOSTNAME=debootstrap-test #pick a hostname! DIST=etch PARTITIONS=/root/price/partitions/testpart #losetup is crazy. pick a free loop device. see /usr/sbin/s-x-lvcopy for code. VOLUME=/dev/xenvg/d_$HOSTNAME_hda #DEST=/srv/$HOSTNAME/ ### ### Create the device for SIPB-Xen purposes ### sfdisk -f $VOLUME <$PARTITIONS SWAPDEV=$(sipb-xen-losetup $VOLUME $(( 7903980 * 512 ))) #mkswap $SWAPDEV #losetup -d $LODEV IMAGEDEV=$(sipb-xen-losetup $VOLUME $(( 63 * 512 ))) # mkfs.ext3 -b 1024 $IMAGEDEV $(( 7903917 / 2 )) # mkdir -p $DEST # mount $LODEV $DEST CREATE_IMAGE_CONFIG=./paravm-create.conf xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --config $CREATE_IMAGE_CONFIG \ --dist $DIST --hostname $HOSTNAME # 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 losetup -d $SWAPDEV losetup -d $IMAGEDEV 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" <&1 | less aptitude clean mkdir /boot/grub aptitude install grub patch /usr/sbin/update-grub