source: trunk/packages/sipb-xen-guest-installer/partial/debootstrap-commands @ 498

Last change on this file since 498 was 495, checked in by neboat, 17 years ago

Started modifying deboostrap-commands to use xen-create-image

File size: 2.3 KB
Line 
1#http://www.debian.org/releases/stable/i386/apds03.html.en
2
3SRC=/root/debootstrap.d
4SRCHOSTNAME=moo17
5#HOSTNAME=debootstrap-test
6#pick a hostname!
7
8DIST=etch
9
10PARTITIONS=/root/price/partitions/testpart
11
12#losetup is crazy.  pick a free loop device.  see /usr/sbin/s-x-lvcopy for code.
13
14VOLUME=/dev/xenvg/d_$HOSTNAME_hda
15#DEST=/srv/$HOSTNAME/
16
17###
18###  Create the device for SIPB-Xen purposes
19###
20sfdisk -f $VOLUME <$PARTITIONS
21SWAPDEV=$(sipb-xen-losetup $VOLUME $(( 7903980 * 512 )))
22#mkswap $SWAPDEV
23#losetup -d $LODEV
24IMAGEDEV=$(sipb-xen-losetup $VOLUME $(( 63 * 512 )))
25# mkfs.ext3 -b 1024 $IMAGEDEV $(( 7903917 / 2 ))
26
27# mkdir -p $DEST
28# mount $LODEV $DEST
29
30CREATE_IMAGE_CONFIG=./paravm-create.conf
31
32xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --config $CREATE_IMAGE_CONFIG \
33        --dist $DIST --hostname $HOSTNAME
34
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
36
37losetup -d $SWAPDEV
38losetup -d $IMAGEDEV
39
40time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian
41
42cp -a $SRC/fstab $DEST/etc/fstab
43cp -a $SRC/interfaces $DEST/etc/network/interfaces
44cp -a $SRC/sources.list $DEST/etc/apt/sources.list
45cp -a $SRC/update-grub.diff $DEST/root/update-grub.diff
46echo $HOSTNAME > $DEST/etc/hostname
47sed s/$SRCHOSTNAME/$HOSTNAME/g $SRC/hosts > $DEST/etc/hosts
48
49mount -t proc proc $DEST/proc
50
51LANG=C chroot "$DEST" <<ENDCHROOT
52
53export TERM=xterm-color
54mount -a
55
56cd /media
57mkdir cdrom0
58ln -s cdrom0 cdrom
59cd /
60ln -s media/cdrom
61
62echo $'y\n3\nEastern' | tzconfig
63export DEBIAN_FRONTEND=noninteractive
64
65echo 'locales locales/locales_to_be_generated multiselect     en_US ISO-8859-1' | debconf-set-selections
66
67
68aptitude update
69aptitude -y install locales linux-image-xen-amd64
70aptitude --without-recommends -y install ~pstandard ~prequired ~pimportant
71#strace tasksel install standard 2>&1 | less
72aptitude clean
73
74mkdir /boot/grub
75aptitude install grub
76patch /usr/sbin/update-grub </root/update-grub.diff
77update-grub
78patch /boot/grub/menu.lst </root/menu.lst.diff
79patch /etc/inittab </root/inittab.diff
80
81rm /root/update-grub.diff
82ENDCHROOT
83
84## kill atd and rpc.statd that are using $DEST
85umount $DEST/proc
86umount $DEST
87losetup -d $LODEV
Note: See TracBrowser for help on using the repository browser.