source: trunk/debathena/scripts/installer/install-athena10.sh @ 23145

Revision 23145, 4.2 KB checked in by ghudson, 16 years ago (diff)
To avoid confusion, remove the word "locally" from the description of login in the install script. (The default security policy set up by debathena-login only allows local logins by unknown users, but the primary purpose of debathena-login is for Athena-ish remote access machines.)
Line 
1#!/bin/sh
2# Athena 10 placeholder install script.
3# Maintainer: Greg Hudson <ghudson@mit.edu>
4# Based on Debathena installer script by: Tim Abbott <tabbott@mit.edu>
5
6# Download this to an Ubuntu machine and run it as root.  It can
7# be downloaded with:
8#   wget http://athena10.mit.edu/install-athena10.sh
9
10set -e
11
12output() {
13  printf '\033[38m'; echo "$@"; printf '\033[0m'
14}
15
16error() {
17  printf '\033[31m'; echo "$@"; printf '\033[0m'
18  exit 1
19}
20
21ask() {
22  answer=''
23  while [ y != "$answer" -a n != "$answer" ]; do
24    printf '\033[38m'; echo -n "$1"; printf '\033[0m'
25    read answer
26    [ Y = answer ] && answer=y
27    [ N = answer ] && answer=n
28    [ -z "$answer" ] && answer=$2
29  done
30  output ""
31}
32
33if [ `id -u` != "0" ]; then
34  error "You must run the Athena 10 installer as root."
35fi
36
37echo "Welcome to the Athena 10 install script."
38echo ""
39echo "Please choose the category which bets suits your needs.  Each category"
40echo "in this list includes the functionality of the previous ones.  See the"
41echo "documentation at http://athena10.mit.edu for more information."
42echo ""
43echo "  standard:    Athena client software (e.g. discuss) and customizations"
44echo "  login:       Allow Athena users to log into your machine"
45echo "  workstation: Athena graphical login customizations"
46echo ""
47
48category=""
49while [ standard != "$category" -a login != "$category" -a \
50        workstation != "$category" ]; do
51  output -n "Please choose a category or press control-C to abort: "
52  read category
53done
54mainpackage=debathena-$category
55
56additional=
57
58echo
59ask "Will this machine be used for Athena 10 development [y/N]? " n
60if [ y = "$answer" ]; then
61  additional="$additional debathena-debian-dev"
62fi
63
64echo "The cluster-software package installs a standard set of software"
65echo "determined to be of interest to MIT users, such as LaTeX.  It is pretty"
66echo "big (several gigabytes, possibly more).  It does not turn your machine"
67echo "into a cluster machine; it is only a standard software set."
68echo ""
69ask "Do you want the cluster-software package [y/N]? " n
70if [ y = "$answer" ]; then
71  additional="$additional debathena-cluster-software"
72fi
73
74echo "A summary of your choices:"
75echo "  Main package: $mainpackage"
76echo "  Additional packages:$additional"
77echo ""
78output "Press return to begin or control-C to abort"
79read dummy
80
81output "Installing lsb-release to determine system type"
82aptitude -y install lsb-release
83distro=`lsb_release -cs`
84case $distro in
85etch|lenny)
86  ;;
87dapper|edgy|feisty|gutsy|hardy)
88  ubuntu=yes
89  ;;
90*)
91  error "Your machine seems to not be running a current Debian/Ubuntu release."
92  ;;
93esac
94
95output "Adding the Athena 10 repository to the apt sources"
96if [ -d /etc/apt/sources.list.d ]; then
97  sourceslist=/etc/apt/sources.list.d/debathena.list
98else
99  sourceslist=/etc/apt/sources.list
100fi
101
102if [ ! -e "$sourceslist" ] || ! grep -q debathena "$sourceslist"; then
103  if [ -e "$sourceslist" ]; then
104    echo "" >> $sourceslist
105  fi
106  echo "deb http://athena10.mit.edu/apt $distro debathena debathena-config debathena-system openafs" >> $sourceslist
107  echo "deb-src http://athena10.mit.edu/apt $distro debathena debathena-config debathena-system openafs" >> $sourceslist
108fi
109
110if [ "$ubuntu" = "yes" ]; then
111  output "Making sure the universe repository is enabled"
112  sed -i 's,^# \(deb\(\-src\)* http://archive.ubuntu.com/ubuntu [[:alnum:]]* universe\)$,\1,' /etc/apt/sources.list
113fi
114
115output "Downloading the Debathena archive key"
116if ! wget http://athena10.mit.edu/apt/athena10-archive.asc ; then
117  echo "Download failed; terminating."
118  exit 1
119fi
120echo "36e6d6a2c13443ec0e7361b742c7fa7843a56a0b  ./athena10-archive.asc" | \
121  sha1sum -c
122apt-key add athena10-archive.asc
123rm ./athena10-archive.asc
124
125apt-get update
126
127modules_want=$(dpkg-query -W -f '${Source}\t${Package}\n' 'linux-image-*' | \
128 sed -nre 's/^linux-(meta|latest[^\t]*)\tlinux-image-(.*)$/openafs-modules-\2/p')
129modules=
130for m in $modules_want; do
131  aptitude show $m > /dev/null && modules="$modules $m"
132done
133
134if [ -z "$modules" ]; then
135  error "An OpenAFS modules metapackage for your kernel is not available."
136fi
137
138output "Installing OpenAFS kernel metapackage"
139apt-get -y install $modules
140
141output "Installing Athena 10 packages"
142DEBIAN_FRONTEND=noninteractive aptitude -y install "$mainpackage" $additional
Note: See TracBrowser for help on using the repository browser.