[25786] in Source-Commits
/svn/athena r25229 - trunk/debathena/scripts/installer/pxe/natty/debathena
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Jul 12 16:51:58 2011
Date: Tue, 12 Jul 2011 16:51:52 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201107122051.p6CKpqQd023264@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2011-07-12 16:51:52 -0400 (Tue, 12 Jul 2011)
New Revision: 25229
Modified:
trunk/debathena/scripts/installer/pxe/natty/debathena/installer.sh
Log:
* Support old auto-upgrade (clusterforce=yes)
* Set some sane defaults for when installertype and mirrorsite aren't passed
* Handle pxetype being unset (error)
* Fix quoting in tests
Modified: trunk/debathena/scripts/installer/pxe/natty/debathena/installer.sh
===================================================================
--- trunk/debathena/scripts/installer/pxe/natty/debathena/installer.sh 2011-07-12 16:16:56 UTC (rev 25228)
+++ trunk/debathena/scripts/installer/pxe/natty/debathena/installer.sh 2011-07-12 20:51:52 UTC (rev 25229)
@@ -13,19 +13,37 @@
# new options:
# debathena/pxetype: could be cluster, but could be other things
-# Don't support this anymore
-#clusterforce=`sed -e 's/ /\n/g' < /proc/cmdline | grep debathena/clusterforce | sed -e 's/.*=//'`
+# Don't support this anymore.
+# Except yes, we do, for old auto-upgrade
+clusterforce=`sed -e 's/ /\n/g' < /proc/cmdline | grep debathena/clusterforce | sed -e 's/.*=//'`
clusteraddr=`sed -e 's/ /\n/g' < /proc/cmdline | grep debathena/clusteraddr | sed -e 's/.*=//'`
pxetype=`sed -e 's/ /\n/g' < /proc/cmdline | grep debathena/pxetype | sed -e 's/.*=//'`
installertype=`sed -e 's/ /\n/g' < /proc/cmdline | grep debathena/i= | sed -e 's/.*=//'`
mirrorsite=`sed -e 's/ /\n/g' < /proc/cmdline | grep debathena/m= | sed -e 's/.*=//'`
+if [ "$clusterforce" = "yes" ]; then
+ [ "$pxetype" != "cluster" ] && echo "WARNING: Replacing pxetype '$pxetype' with 'cluster' because clusterforce=yes"
+ pxetype=cluster
+fi
+
echo "Picked up values from command line:
clusteraddr=$clusteraddr
pxetype=$pxetype
installertype=$installertype
mirrorsite=$mirrorsite"
+# Apply some sane defaults
+if [ -z "$installertype" ]; then installertype=production ; fi
+if [ -z "$mirrorsite" ]; then mirrorsite="mirrors.mit.edu" ; fi
+
+# Sanity check
+if [ -z "$pxetype" ]; then
+ echo "ERROR: No clusterforce=yes and no pxetype on the command line."
+ echo "Cannot proceed. Reboot now, please."
+ read dummy
+fi
+
+
if [ "$clusteraddr" ] ; then IPADDR=$clusteraddr ; fi
netconfig () {
@@ -90,7 +108,7 @@
# Consider setting a static IP address, especially if we can't reach the mirror.
-if [ cluster != $pxetype ]; then
+if [ cluster != "$pxetype" ]; then
# We're at a point in the install process where we can be fairly sure
# that nothing else is happening, so "killall wget" should be safe.
(sleep 5; killall wget >/dev/null 2>&1) &
@@ -123,7 +141,7 @@
netconfig
fi
-if [ vanilla = $pxetype ] ; then
+if [ vanilla = "$pxetype" ] ; then
echo "Starting normal Ubuntu install in five seconds."
sleep 5
exit 0