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

Last change on this file since 494 was 494, checked in by price, 16 years ago

Eric's and my debootstrap work from the hackathon

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