remove old build scripts and clean for those that work
Change-Id: I5c156879f3c85f1555a1411695ac43cefbbf3b99
diff --git a/tools/build_pxe_env.sh b/tools/build_pxe_env.sh
index 1ab51f8..d01dad0 100755
--- a/tools/build_pxe_env.sh
+++ b/tools/build_pxe_env.sh
@@ -10,8 +10,7 @@
dpkg -l syslinux || apt-get install -y syslinux
DEST_DIR=${1:-/tmp}/tftpboot
-PXEDIR=${PXEDIR:-/var/cache/devstack/pxe}
-OPWD=`pwd`
+PXEDIR=${PXEDIR:-/opt/ramstack/pxe}
PROGDIR=`dirname $0`
# Clean up any resources that may be in use
@@ -28,7 +27,11 @@
trap 2; kill -2 $$
}
-trap cleanup SIGHUP SIGINT SIGTERM
+trap cleanup SIGHUP SIGINT SIGTERM SIGQUIT EXIT
+
+# Keep track of the current directory
+TOOLS_DIR=$(cd $(dirname "$0") && pwd)
+TOP_DIR=`cd $TOOLS_DIR/..; pwd`
mkdir -p $DEST_DIR/pxelinux.cfg
cd $DEST_DIR
@@ -42,7 +45,7 @@
prompt 0
timeout 0
-MENU TITLE PXE Boot Menu
+MENU TITLE devstack PXE Boot Menu
EOF
@@ -54,7 +57,7 @@
# Get image into place
if [ ! -r $PXEDIR/stack-initrd.img ]; then
- cd $OPWD
+ cd $TOP_DIR
$PROGDIR/build_ramdisk.sh $PXEDIR/stack-initrd.img
fi
if [ ! -r $PXEDIR/stack-initrd.gz ]; then
@@ -110,3 +113,5 @@
MENU LABEL ^Local disk
LOCALBOOT 0
EOF
+
+trap cleanup SIGHUP SIGINT SIGTERM SIGQUIT EXIT