From: Greg Price Date: Sun, 4 May 2008 00:53:31 +0000 (-0400) Subject: Eric's and my debootstrap work from the hackathon X-Git-Tag: sipb-xen-guest-installer/1.2~5 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/commitdiff_plain/e31b78fc20c5b45ce3deb6b2859e849845e95c74?hp=477aafca893d97664a0a6a13301f176f62bf7316 Eric's and my debootstrap work from the hackathon svn path=/trunk/packages/sipb-xen-guest-installer/; revision=494 --- diff --git a/partial/debootstrap-commands b/partial/debootstrap-commands new file mode 100644 index 0000000..9975e7b --- /dev/null +++ b/partial/debootstrap-commands @@ -0,0 +1,75 @@ +#http://www.debian.org/releases/stable/i386/apds03.html.en + +SRC=/root/debootstrap.d +SRCHOSTNAME=moo17 +#HOSTNAME=debootstrap-test +#pick a hostname! + +PARTITIONS=/root/price/partitions/testpart + +#losetup is crazy. pick a free loop device. see /usr/sbin/s-x-lvcopy for code. +LODEV=/dev/loopNN-this-is-not-valid + + + +VOLUME=/dev/xenvg/d_$HOSTNAME_hda +DEST=/srv/$HOSTNAME/ + +sfdisk -f $VOLUME <$PARTITIONS +losetup -o $(( 7903980 * 512 )) $LODEV $VOLUME +mkswap $LODEV +losetup -d $LODEV +losetup -o $(( 63 * 512 )) $LODEV $VOLUME +mkfs.ext3 -b 1024 $LODEV $(( 7903917 / 2 )) +mkdir -p $DEST +mount $LODEV $DEST + + +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 +proc /proc proc defaults 0 0 +/dev/hda1 / ext3 defaults,errors=remount-ro 0 1 +/dev/hda5 none swap sw 0 0 +/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0 diff --git a/partial/debootstrap.d/hosts b/partial/debootstrap.d/hosts new file mode 100644 index 0000000..da2afa1 --- /dev/null +++ b/partial/debootstrap.d/hosts @@ -0,0 +1,10 @@ +127.0.0.1 localhost +127.0.1.1 moo17.servers.csail.mit.edu moo17 + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +ff02::3 ip6-allhosts diff --git a/partial/debootstrap.d/inittab.diff b/partial/debootstrap.d/inittab.diff new file mode 100644 index 0000000..0745ff9 --- /dev/null +++ b/partial/debootstrap.d/inittab.diff @@ -0,0 +1,11 @@ +--- inittab.orig 2008-04-22 05:42:50.000000000 -0400 ++++ inittab 2008-04-22 05:43:04.000000000 -0400 +@@ -60,7 +60,7 @@ + + # Example how to put a getty on a serial line (for a terminal) + # +-#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 ++T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 + #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 + + # Example how to put a getty on a modem line. diff --git a/partial/debootstrap.d/interfaces b/partial/debootstrap.d/interfaces new file mode 100644 index 0000000..04ee0fe --- /dev/null +++ b/partial/debootstrap.d/interfaces @@ -0,0 +1,10 @@ +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +# The loopback network interface +auto lo +iface lo inet loopback + +# The primary network interface +allow-hotplug eth0 +iface eth0 inet dhcp diff --git a/partial/debootstrap.d/menu.lst.diff b/partial/debootstrap.d/menu.lst.diff new file mode 100644 index 0000000..da16aa0 --- /dev/null +++ b/partial/debootstrap.d/menu.lst.diff @@ -0,0 +1,11 @@ +--- menu.lst.orig 2008-04-22 05:41:32.000000000 -0400 ++++ menu.lst 2008-04-22 05:42:15.000000000 -0400 +@@ -59,7 +59,7 @@ + ## e.g. kopt=root=/dev/hda1 ro + ## kopt_2_6_8=root=/dev/hdc1 ro + ## kopt_2_6_8_2_686=root=/dev/hdc2 ro +-# kopt=root=/dev/hda1 ro ++# kopt=root=/dev/hda1 ro console=ttyS0,9600,8n1 + + ## default grub root device + ## e.g. groot=(hd0,0) diff --git a/partial/debootstrap.d/sources.list b/partial/debootstrap.d/sources.list new file mode 100644 index 0000000..e2b2d67 --- /dev/null +++ b/partial/debootstrap.d/sources.list @@ -0,0 +1,6 @@ + +deb http://debian.lcs.mit.edu/debian/ etch main +deb-src http://debian.lcs.mit.edu/debian/ etch main + +deb http://security.debian.org/ etch/updates main +deb-src http://security.debian.org/ etch/updates main diff --git a/partial/debootstrap.d/update-grub.diff b/partial/debootstrap.d/update-grub.diff new file mode 100644 index 0000000..c420c89 --- /dev/null +++ b/partial/debootstrap.d/update-grub.diff @@ -0,0 +1,15 @@ +--- update-grub.orig 2008-04-22 01:13:34.000000000 -0400 ++++ update-grub 2008-04-22 01:13:13.000000000 -0400 +@@ -1036,10 +1036,10 @@ + + if [ ! "$in_domU" ] && [ "$is_xen" ]; then + # skip xen kernels +- continue ++ : + elif [ "$in_domU" ] && ! [ "$is_xen" ]; then + # skip non-xen kernels +- continue ++ : + fi + kern="/boot/$kern" + newerKernels=""