X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=blobdiff_plain;f=build.sh;h=2e8c4400a1080322ea527f8c54ac8ec5c299ea0c;hp=06e9f00a30bee5b71226d6aa562d0e24f6f0bf47;hb=HEAD;hpb=0f6d1a768aa03d38861c5011333135a8068eac2c diff --git a/build.sh b/build.sh index 06e9f00..2e8c440 100755 --- a/build.sh +++ b/build.sh @@ -10,12 +10,9 @@ # 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 +source /etc/planetlab/plc_config # Do not tolerate errors set -e @@ -28,11 +25,8 @@ 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 -. source/configuration +source source/configuration # Write boot script. nodeconfig/boot/index.php retrieves the contents of this script # after checking the node id @@ -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,10 +63,15 @@ 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" -extra_libs=`mktemp -d "/tmp/.bootmanager.XXXXXX"` +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 +for entry in $(rpm -ql $required_rpms | grep -v '\.py[co]$'); do + if [ -d $entry ]; then + continue + fi + cp -p $entry $extra_libs/source +done ########## create the bootmanager script @@ -82,7 +81,7 @@ cat < $DEST_SCRIPT # PlanetLab Boot Manager $VERSION # # DO NOT EDIT. Generated by $USER@$HOSTNAME at -# $(date) +# $(date) # # Do not tolerate errors @@ -114,4 +113,3 @@ if [ -f "$PLC_ROOT_GPG_KEY" -a -f "$PLC_ROOT_GPG_KEY_PUB" ] ; then else echo "Warning: Remember to sign $PWD/$DEST_SCRIPT!" >&2 fi -