[23890] in Source-Commits
/svn/athena r23500 - in trunk/debathena/scripts/installer: . pxe/intrepid pxe/intrepid/athena10-intrepid
daemon@ATHENA.MIT.EDU (Timothy G Abbott)
Sat Feb 28 22:07:32 2009
Date: Sat, 28 Feb 2009 22:06:42 -0500
From: Timothy G Abbott <tabbott@MIT.EDU>
Message-Id: <200903010306.n2136gSa015905@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: tabbott
Date: 2009-02-28 22:06:41 -0500 (Sat, 28 Feb 2009)
New Revision: 23500
Added:
trunk/debathena/scripts/installer/install-debathena.sh
Removed:
trunk/debathena/scripts/installer/install-athena10.sh
Modified:
trunk/debathena/scripts/installer/pxe/intrepid/TODO
trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/installer.sh
trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/postinstall.sh
Log:
More installer merge changes:
* Rename install-athena10.sh to install-debathena.sh
* Use debathena-archive-keyring.asc, not athena10-archive.asc.
Deleted: trunk/debathena/scripts/installer/install-athena10.sh
Copied: trunk/debathena/scripts/installer/install-debathena.sh (from rev 23499, trunk/debathena/scripts/installer/install-athena10.sh)
===================================================================
--- trunk/debathena/scripts/installer/install-athena10.sh 2009-03-01 02:10:13 UTC (rev 23499)
+++ trunk/debathena/scripts/installer/install-debathena.sh 2009-03-01 03:06:41 UTC (rev 23500)
@@ -0,0 +1,268 @@
+#!/bin/sh
+# Athena 10 installer script.
+# Maintainer: debathena@mit.edu
+# Based on original Debathena installer script by: Tim Abbott <tabbott@mit.edu>
+
+# Download this to a Debian or Ubuntu machine and run it as root. It can
+# be downloaded with:
+# wget http://athena10.mit.edu/install-debathena.sh
+
+set -e
+
+output() {
+ printf '\033[38m'; echo "$@"; printf '\033[0m'
+}
+
+error() {
+ printf '\033[31m'; echo "$@"; printf '\033[0m'
+}
+
+ask() {
+ answer=''
+ while [ y != "$answer" -a n != "$answer" ]; do
+ printf '\033[38m'; echo -n "$1"; printf '\033[0m'
+ read answer
+ [ Y = answer ] && answer=y
+ [ N = answer ] && answer=n
+ [ -z "$answer" ] && answer=$2
+ done
+ output ""
+}
+
+if [ `id -u` != "0" ]; then
+ error "You must run the Debathena installer as root."
+ exit 1
+fi
+
+echo "Welcome to the Debathena installer."
+echo ""
+echo "Please choose the category which bets suits your needs. Each category"
+echo "in this list includes the functionality of the previous ones. See the"
+echo "documentation at http://debathena.mit.edu/beta for more information."
+echo ""
+echo " standard: Athena client software (e.g. discuss) and customizations"
+echo " login: Allow Athena users to log into your machine"
+echo " workstation: Athena graphical login customizations"
+echo ""
+
+# Hack to deal with the older PXE installer (which used a simple flag file to
+# indicate a PXE cluster install).
+if test -f /root/unattended-cluster-install ; then
+ echo cluster > /root/pxe-install-flag
+fi
+
+category=""
+if test -f /root/pxe-install-flag ; then
+ pxetype=`head -1 /root/pxe-install-flag`
+ if [ cluster = "$pxetype" ] ; then
+ category=cluster ;
+ echo "PXE cluster install detected, so installing \"cluster\"."
+ fi
+fi
+while [ standard != "$category" -a login != "$category" -a \
+ workstation != "$category" -a cluster != "$category" ]; do
+ output -n "Please choose a category or press control-C to abort: "
+ read category
+done
+mainpackage=debathena-$category
+
+dev=no
+echo
+if [ cluster != $category ] ; then
+ ask "Will this machine be used to build Debathena packages [y/N]? " n
+ if [ y = "$answer" ]; then
+ dev=yes
+ fi
+fi
+
+csoft=no
+tsoft=no
+echo "The extra-software package installs a standard set of software"
+echo "determined to be of interest to MIT users, such as LaTeX. It is pretty"
+echo "big (several gigabytes, possibly more)."
+echo ""
+if [ cluster = $category ] ; then
+ echo "Cluster install detected, so installing extras."
+ csoft=yes
+ # Not setting tsoft=yes here; -cluster will pull it in anyway.
+else
+ ask "Do you want the extra-software package [y/N]? " n
+ if [ y = "$answer" ]; then
+ csoft=yes
+ fi
+fi
+
+echo "A summary of your choices:"
+echo " Category: $category"
+echo " Debian development package: $dev"
+echo " Extra-software package: $csoft"
+echo " Third-party software package: $tsoft"
+echo ""
+if [ "$pxetype" ] ; then
+ # Setup for package installs in a chrooted immediately-postinstall environment.
+ echo "Setting locale."
+ export LANG
+ . /etc/default/locale
+ echo "LANG set to $LANG."
+ echo "Mounting /proc."
+ mount /proc 2> /dev/null || :
+ # Clear toxic environment settings inherited from the installer.
+ unset DEBCONF_REDIR
+ unset DEBIAN_HAS_FRONTEND
+ if [ cluster = "$pxetype" ] ; then
+ # Network, LVM, and display config that's specific to PXE cluster installs.
+ # If someone is installing -cluster on an already-installed machine, it's
+ # assumed that this config has already happened and shouldn't be stomped on.
+
+ # Preseed an answer to the java license query, which license was already accepted
+ # at install time:
+ echo "sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true" |debconf-set-selections
+
+ # Configure network based on the preseed file settings, if present.
+ if test -f /root/athena10.preseed ; then
+ # Switch to canonical hostname.
+ ohostname=`cat /etc/hostname`
+ # Hack to avoid installing debconf-get for just this.
+ ipaddr=`grep netcfg/get_ipaddress /root/athena10.preseed|sed -e 's/.* //'`
+ netmask=`grep netcfg/get_netmask /root/athena10.preseed|sed -e 's/.* //'`
+ gateway=`grep netcfg/get_gateway /root/athena10.preseed|sed -e 's/.* //'`
+
+ hostname=`host $ipaddr | \
+ sed 's#^.*domain name pointer \(.*\)$#\1#' | sed 's;\.*$;;' | \
+ tr '[A-Z]' '[a-z]'`
+ if echo $hostname|grep -q "not found" ; then
+ hostname=""
+ printf "\a"; sleep 1 ; printf "\a"; sleep 1 ;printf "\a"
+ echo "The IP address you selected, $ipaddr, does not have an associated"
+ echo "hostname. Please confirm that you're using the correct address."
+ while [ -z "$hostname" ] ; do
+ echo -n "Enter fully qualified hostname [no default]: "
+ read hostname
+ done
+ fi
+ echo ${hostname%%.*} > /etc/hostname
+ sed -e 's/\(127\.0\.1\.1[ ]*\).*/\1'"$hostname ${hostname%%.*}/" < /etc/hosts > /etc/hosts.new
+ mv -f /etc/hosts.new /etc/hosts
+ if grep -q dhcp /etc/network/interfaces ; then
+ sed -e s/dhcp/static/ < /etc/network/interfaces > /etc/network/interfaces.new
+ echo " address $ipaddr" >> /etc/network/interfaces.new
+ echo " netmask $netmask" >> /etc/network/interfaces.new
+ echo " gateway $gateway" >> /etc/network/interfaces.new
+ mv -f /etc/network/interfaces.new /etc/network/interfaces
+ fi
+ hostname ${hostname%%.*}
+ fi
+
+ # Free up designated LVM overhead.
+ lvremove -f /dev/athena10/keep_2 || :
+
+ # This makes gx755s suck less.
+ if lspci -n|grep -q 1002:94c1 && ! grep -q radeonhd /etc/X11/xorg.conf ; then
+ DEBIAN_FRONTEND=noninteractive aptitude -y install xserver-xorg-video-radeonhd
+ cat >> /etc/X11/xorg.conf <<EOF
+Section "Device"
+ Identifier "Configured Video Device"
+ Driver "radeonhd"
+EndSection
+EOF
+ fi
+ fi
+else
+ output "Press return to begin or control-C to abort"
+ read dummy
+fi
+
+output "Installing lsb-release to determine system type"
+aptitude -y install lsb-release
+distro=`lsb_release -cs`
+case $distro in
+etch|lenny)
+ ;;
+dapper|edgy|feisty|gutsy|hardy|intrepid)
+ ubuntu=yes
+ ;;
+*)
+ error "Your machine seems to not be running a current Debian/Ubuntu release."
+ error "If you believe you are running a current release, contact debathena@mit.edu"
+ exit 1
+ ;;
+esac
+
+output "Adding the Debathena repository to the apt sources"
+output "(This may cause the update manager to claim new upgrades are available."
+output "Ignore them until this script is complete.)"
+if [ -d /etc/apt/sources.list.d ]; then
+ sourceslist=/etc/apt/sources.list.d/debathena.list
+else
+ # dapper is the only "current" platform that doesn't support sources.list.d
+ sourceslist=/etc/apt/sources.list
+fi
+
+if [ ! -e "$sourceslist" ] || ! grep -q debathena "$sourceslist"; then
+ if [ -e "$sourceslist" ]; then
+ echo "" >> $sourceslist
+ fi
+ echo "deb http://athena10.mit.edu/apt $distro debathena debathena-config debathena-system openafs" >> $sourceslist
+ echo "deb-src http://athena10.mit.edu/apt $distro debathena debathena-config debathena-system openafs" >> $sourceslist
+fi
+
+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 the Debathena archive signing key"
+if ! wget http://athena10.mit.edu/apt/debathena-archive-keyring.asc ; then
+ error "Download failed; terminating."
+ exit 1
+fi
+echo "05c41a58b820b9aef198d8dad5a613c40cbd8b52 ./debathena-archive-keyring.asc" | \
+ sha1sum -c
+apt-key add debathena-archive-keyring.asc
+rm ./debathena-archive-keyring.asc
+
+apt-get update
+
+modules_want=$(dpkg-query -W -f '${Source}\t${Package}\n' 'linux-image-*' | \
+ sed -nre 's/^linux-(meta|latest[^\t]*)\tlinux-image-(.*)$/openafs-modules-\2/p')
+modules=
+for m in $modules_want; do
+ aptitude show $m > /dev/null && modules="$modules $m"
+done
+
+if [ -z "$modules" ]; then
+ error "An OpenAFS modules metapackage for your kernel is not available."
+ error "Please use the manual installation instructions at"
+ error "http://debathena.mit.edu/beta/install"
+ error "You will need to compile your own AFS modules as described at:"
+ error "http://debathena.mit.edu/beta/troubleshooting#openafs-custom"
+ exit 1
+fi
+
+output "Installing OpenAFS kernel metapackage"
+apt-get -y install $modules
+
+# Use the noninteractive frontend to install the main package. This
+# is so that AFS and Zephyr don't ask questions of the user which
+# debathena packages will later stomp on anyway.
+output "Installing main Debathena metapackage $mainpackage"
+
+DEBIAN_FRONTEND=noninteractive aptitude -y install "$mainpackage"
+
+# This package is relatively small so it's not as important, but allow
+# critical questions to be asked.
+if [ yes = "$dev" ]; then
+ output "Installing debathena-build-depends"
+ DEBIAN_PRIORITY=critical aptitude -y install debathena-build-depends
+fi
+
+# Use the default front end and allow questions to be asked; otherwise
+# Java will fail to install since it has to present its license.
+if [ yes = "$csoft" ]; then
+ output "Installing debathena-extra-software"
+ DEBIAN_PRIORITY=critical aptitude -y install debathena-extra-software
+fi
+if [ yes = "$tsoft" ]; then
+ output "Installing debathena-thirdparty"
+ DEBIAN_PRIORITY=critical aptitude -y install debathena-thirdparty
+fi
Property changes on: trunk/debathena/scripts/installer/install-debathena.sh
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/debathena/scripts/installer/pxe/intrepid/TODO
===================================================================
--- trunk/debathena/scripts/installer/pxe/intrepid/TODO 2009-03-01 02:10:13 UTC (rev 23499)
+++ trunk/debathena/scripts/installer/pxe/intrepid/TODO 2009-03-01 03:06:41 UTC (rev 23500)
@@ -1,6 +1,6 @@
high:
- Non-cluster PXE installs need post-install network munging
- by install-athena10.sh in order to have usable net, since
+ by install-debathena.sh in order to have usable net, since
the ubuntu installer forces a DHCP config if the installer
used DHCP. So sad.
- the entire install session *really* needs to be logged
@@ -19,6 +19,6 @@
- hack non-cluster preseed to not prompt for cd ejection.
some of what was done:
-- add hacks to install-athena10.sh for noninteractive use
+- add hacks to install-debathena.sh for noninteractive use
- push to MIT PXE servers
- have a "debathena but not cluster version" install option
Modified: trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/installer.sh
===================================================================
--- trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/installer.sh 2009-03-01 02:10:13 UTC (rev 23499)
+++ trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/installer.sh 2009-03-01 03:06:41 UTC (rev 23500)
@@ -149,7 +149,7 @@
echo "Fetching Athena 10 postinstaller."
# 18.92.2.195 = OLD athena10.mit.edu
# 18.9.60.73 = NEW athena10.mit.edu
-wget http://18.9.60.73/install-athena10.sh
+wget http://18.9.60.73/install-debathena.sh
# Let the postinstall know what we are up to.
echo "$pxetype" > $mp/pxe-install-flag
Modified: trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/postinstall.sh
===================================================================
--- trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/postinstall.sh 2009-03-01 02:10:13 UTC (rev 23499)
+++ trunk/debathena/scripts/installer/pxe/intrepid/athena10-intrepid/postinstall.sh 2009-03-01 03:06:41 UTC (rev 23500)
@@ -4,12 +4,12 @@
# during the preinstall questioning. (Thus, not for vanilla installs.)
cp /athena10-intrepid/preseed /target/root/athena10.preseed
-cp /athena10-intrepid/install-athena10.sh /target/root
+cp /athena10-intrepid/install-debathena.sh /target/root
if test -f /athena10-intrepid/pxe-install-flag ; then
cp /athena10-intrepid/pxe-install-flag /target/root/pxe-install-flag
fi
chvt 5
-chroot /target sh /root/install-athena10.sh < /dev/tty5 > /dev/tty5 2>&1
+chroot /target sh /root/install-debathena.sh < /dev/tty5 > /dev/tty5 2>&1
sleep 5
chvt 1