From: Greg Price Date: Fri, 30 Jan 2009 10:59:27 +0000 (-0500) Subject: install-invirt.sh X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/install-invirt.git/commitdiff_plain/324910d2dc75c603d20a24c75047bd0234012d34 install-invirt.sh svn path=/trunk/scripts/; revision=2026 --- 324910d2dc75c603d20a24c75047bd0234012d34 diff --git a/install-invirt.sh b/install-invirt.sh new file mode 100755 index 0000000..54f7268 --- /dev/null +++ b/install-invirt.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# Invirt install script. +# Cribbed from install-debathena.sh. +set -e + +output() { + printf '\033[38m'; echo "$@"; printf '\033[0m' +} + +error() { + ret=`shift` + printf '\033[31m'; echo "$@"; printf '\033[0m' + exit $ret +} + +if [ `id -u` != "0" ]; then + error 1 "You must run the Invirt installer as root." +fi + +output "Installing the dependency for the Invirt installer..." +aptitude install lsb-release +DISTRO=`lsb_release -cs` +case $DISTRO in + hardy) + ;; + *) + error 1 'Invirt only supports Ubuntu hardy right now, sorry.' + ;; +esac + +output "Adding repositories to the apt sources..." +( + echo debathena http://debathena.mit.edu/apt $DISTRO debathena debathena-config openafs + echo invirt http://xvm.mit.edu/invirt stable main +) | while read name line; do + sourceslist="/etc/apt/sources.list.d/$name.list" + if [ -e $sourceslist ]; then + continue + fi + echo "deb $line" >> "$sourceslist" + echo "deb-src $line" >> "$sourceslist" +done + +# if [ "$UBUNTU" = "yes" ]; then +# output "Making sure the universe repository is enabled" +# sed -i 's,^# \(deb\(\-src\)* http://archive.ubuntu.com/ubuntu [[:alnum:]]* universe\)$,\1,' /etc/apt/sources.list +# fi + +output "Downloading archive keys..." +( + echo http://debathena.mit.edu/apt/debathena-archive.asc a96663dcee0f303afcadca3105eae6bf7c7e698a + echo http://xvm.mit.edu/invirt/invirt-archive.asc fc5d50e7507a871b45dde55a77448edb0e22c184 +) | while read uri sha1; do + f=$(mktemp archive.asc.XXXX) + wget -O $f $uri + echo "$sha1 $f" | sha1sum -c + apt-key add $f + rm $f +done + +aptitude update + +output "Installing Invirt..." +DEBIAN_FRONTEND=noninteractive aptitude install invirt-host-master + +output "Invirt installation done!" +output "" +output "You probably want to ask invirt@mit.edu what to do next, if you're" +output "not yourself one of the people who would answer that question." +output "We're still working on documentation."