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

Revision 23247, 4.9 KB checked in by price, 15 years ago (diff)
-cluster-software -> -extra-software{,-nox} Per discussion on athena10@, renamed debathena-cluster-software to debathena-extra-software and split out debathena-extra-software-nox as a subset metapackage.
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
56dev=no
57echo
58ask "Will this machine be used to build Debathena packages [y/N]? " n
59if [ y = "$answer" ]; then
60  dev=yes
61fi
62
63csoft=no
64echo "The extra-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)."
67echo ""
68ask "Do you want the extra-software package [y/N]? " n
69if [ y = "$answer" ]; then
70  csoft=yes
71fi
72
73echo "A summary of your choices:"
74echo "  Category: $category"
75echo "  Debian development package: $dev"
76echo "  Extra-software package: $csoft"
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"
96echo "(This may cause the update manager to claim new upgrades are available."
97echo "Ignore them until this script is complete.)"
98if [ -d /etc/apt/sources.list.d ]; then
99  sourceslist=/etc/apt/sources.list.d/debathena.list
100else
101  sourceslist=/etc/apt/sources.list
102fi
103
104if [ ! -e "$sourceslist" ] || ! grep -q debathena "$sourceslist"; then
105  if [ -e "$sourceslist" ]; then
106    echo "" >> $sourceslist
107  fi
108  echo "deb http://athena10.mit.edu/apt $distro debathena debathena-config debathena-system openafs" >> $sourceslist
109  echo "deb-src http://athena10.mit.edu/apt $distro debathena debathena-config debathena-system openafs" >> $sourceslist
110fi
111
112if [ "$ubuntu" = "yes" ]; then
113  output "Making sure the universe repository is enabled"
114  sed -i 's,^# \(deb\(\-src\)* http://archive.ubuntu.com/ubuntu [[:alnum:]]* universe\)$,\1,' /etc/apt/sources.list
115fi
116
117output "Downloading the Debathena archive key"
118if ! wget http://athena10.mit.edu/apt/athena10-archive.asc ; then
119  echo "Download failed; terminating."
120  exit 1
121fi
122echo "36e6d6a2c13443ec0e7361b742c7fa7843a56a0b  ./athena10-archive.asc" | \
123  sha1sum -c
124apt-key add athena10-archive.asc
125rm ./athena10-archive.asc
126
127apt-get update
128
129modules_want=$(dpkg-query -W -f '${Source}\t${Package}\n' 'linux-image-*' | \
130 sed -nre 's/^linux-(meta|latest[^\t]*)\tlinux-image-(.*)$/openafs-modules-\2/p')
131modules=
132for m in $modules_want; do
133  aptitude show $m > /dev/null && modules="$modules $m"
134done
135
136if [ -z "$modules" ]; then
137  error "An OpenAFS modules metapackage for your kernel is not available."
138fi
139
140output "Installing OpenAFS kernel metapackage"
141apt-get -y install $modules
142
143# Use the noninteractive frontend to install the main package.  This
144# is so that AFS and Zephyr don't ask questions of the user which
145# debathena packages will later stomp on anyway.
146output "Installing main Athena 10 metapackage $mainpackage"
147DEBIAN_FRONTEND=noninteractive aptitude -y install "$mainpackage"
148
149# This package is relatively small so it's not as important, but allow
150# critical questions to be asked.
151if [ yes = "$dev" ]; then
152  output "Installing debathena-build-depends"
153  DEBIAN_PRIORITY=critical aptitude -y install debathena-build-depends
154fi
155
156# Use the default front end and allow questions to be asked; otherwise
157# Java will fail to install since it has to present its license.
158if [ yes = "$csoft" ]; then
159  output "Installing debathena-extra-software"
160  DEBIAN_PRIORITY=critical aptitude -y install debathena-extra-software
161fi
Note: See TracBrowser for help on using the repository browser.