source: trunk/scripts/install-invirt/install-invirt.sh @ 2286

Last change on this file since 2286 was 2051, checked in by price, 15 years ago

tweak install-invirt.sh

Don't try to install invirt-host-master, because we need most
of the script for sysvms too.

Also, minimal installs lack wget, so install that first.

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/sh
2# Invirt install script.
3# Cribbed from install-debathena.sh.
4set -e
5
6output() {
7    printf '\033[38m'; echo "$@"; printf '\033[0m'
8}
9
10error() {
11    ret=`shift`
12    printf '\033[31m'; echo "$@"; printf '\033[0m'
13    exit $ret
14}
15
16if [ `id -u` != "0" ]; then
17    error 1 "You must run the Invirt installer as root."
18fi
19
20output "Installing the dependencies for the Invirt installer..."
21aptitude install lsb-release wget
22DISTRO=`lsb_release -cs`
23case $DISTRO in
24    hardy)
25        ;;
26    *)
27        error 1 'Invirt only supports Ubuntu hardy right now, sorry.'
28        ;;
29esac
30
31output "Adding repositories to the apt sources..."
32(
33    echo debathena http://debathena.mit.edu/apt $DISTRO debathena debathena-config openafs
34    echo invirt http://xvm.mit.edu/invirt stable main
35) | while read name line; do
36    sourceslist="/etc/apt/sources.list.d/$name.list"
37    if [ -e $sourceslist ]; then
38        continue
39    fi
40    echo "deb     $line" >> "$sourceslist"
41    echo "deb-src $line" >> "$sourceslist"
42done
43
44# if [ "$UBUNTU" = "yes" ]; then
45#     output "Making sure the universe repository is enabled"
46#     sed -i 's,^# \(deb\(\-src\)* http://archive.ubuntu.com/ubuntu [[:alnum:]]* universe\)$,\1,' /etc/apt/sources.list
47# fi
48
49output "Downloading archive keys..."
50(
51  echo http://debathena.mit.edu/apt/debathena-archive.asc a96663dcee0f303afcadca3105eae6bf7c7e698a
52  echo http://xvm.mit.edu/invirt/invirt-archive.asc fc5d50e7507a871b45dde55a77448edb0e22c184
53) | while read uri sha1; do
54  f=$(mktemp archive.asc.XXXX)
55  wget -O $f $uri
56  echo "$sha1  $f" | sha1sum -c
57  apt-key add $f
58  rm $f
59done
60
61aptitude update
62
63#output "Installing Invirt..."
64#DEBIAN_FRONTEND=noninteractive aptitude install invirt-host-master
65
66output "Invirt installation done!"
67output ""
68output "You probably want to ask invirt@mit.edu what to do next, if you're"
69output "not yourself one of the people who would answer that question."
70output "We're still working on documentation."
Note: See TracBrowser for help on using the repository browser.