X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build.sh;h=ee4bd32dbc6b63d6ecc192d19a92a1d8d1346bb1;hb=fc0046387e3d654a23097f50eb735e00ffda41a1;hp=6362ca67de756831f00b21cf52efa12ef89e7639;hpb=6255a47c3fe71a602fa7b8b8ec2ffb48d5c44172;p=bootmanager.git diff --git a/build.sh b/build.sh index 6362ca6..ee4bd32 100755 --- a/build.sh +++ b/build.sh @@ -10,9 +10,6 @@ # Marc E. Fiuczynski # Copyright (C) 2004-2007 The Trustees of Princeton University # -# $Id: build.sh,v 1.5 2006/04/03 19:40:55 mlhuang Exp $ -# $URL$ -# # Source PLC configuration . /etc/planetlab/plc_config @@ -28,19 +25,16 @@ BOOTSTRAPDIR="/boot" # Change to our source directory cd $(dirname $0) -# Translate configuration file -sed -i -e "s|SUPPORT_FILE_DIR=.*|SUPPORT_FILE_DIR=$BOOTSTRAPDIR|" source/configuration - # Source bootmanager configuration -. $srcdir/source/configuration +. source/configuration # Write boot script. nodeconfig/boot/index.php retrieves the contents of this script # after checking the node id -BMDIR=/var/www/html/bootmanager +BMDIR=/var/www/html/boot mkdir -p $BMDIR -DEST_SCRIPT="$BMDIR/${DEPLOYMENT}_bootmanager.sh" +DEST_SCRIPT="$BMDIR/bootmanager_${DEPLOYMENT}.sh" # Remove the old version or any sym links prior to re-writing rm -f ${DEST_SCRIPT} rm -f ${DEST_SCRIPT}.sgn @@ -58,8 +52,8 @@ fi sed -i -e "s@^MONITOR_SERVER.*@MONITOR_SERVER=$MONITOR_SERVER@" source/configuration install -D -m 644 $PLC_BOOT_CA_SSL_CRT source/cacert/$PLC_BOOT_HOST/cacert.pem -if [ -f $PLC_MONITOR_CA_SSL_CRT ] ; then - install -D -m 644 $PLC_MONITOR_CA_SSL_CRT source/cacert/$PLC_MONITOR_HOST/cacert.pem +if [ -f "$PLC_MONITOR_CA_SSL_CRT" ] ; then + install -D -m 644 "$PLC_MONITOR_CA_SSL_CRT" source/cacert/$PLC_MONITOR_HOST/cacert.pem fi # Replace the default debug SSH key @@ -69,7 +63,7 @@ fi # Add python code from the following packages # make sure they are in the 'Requires' header of the specfile -required_rpms="pypcilib pyplnet monitor-runlevelagent" +required_rpms="pypcilib pyplnet" extra_libs=`mktemp -d "/tmp/.bootmanager.XXXXXX"` mkdir $extra_libs/source cp -p $(rpm -ql $required_rpms | grep -v '\.py[co]$') $extra_libs/source @@ -88,14 +82,12 @@ cat < $DEST_SCRIPT # Do not tolerate errors set -e -UUDECODE=/usr/bin/uudecode - -($UUDECODE | /bin/tar -C /tmp -xj) << _EOF_ +(/usr/bin/uudecode | /bin/tar -C /tmp -xj) << _EOF_ EOF # Embed the uuencoded tarball in the script -tar -cj -C $srcdir source/ -C $extra_libs source/ | uuencode -m - >> $DEST_SCRIPT +tar -cj source/ -C $extra_libs source/ | uuencode -m - >> $DEST_SCRIPT # wrap up the script echo '_EOF_' >> $DEST_SCRIPT