Permalink
Browse files

Use OPTDIR rather than BASE_PATH

  • Loading branch information...
1 parent 34d0ef0 commit d6a7d77494bfeef6c2dba05c970dab483362b10a @jonludlam jonludlam committed Nov 30, 2011
View
@@ -125,7 +125,7 @@ ocaml/fhs.ml :
.PHONY: xapi.spec
xapi.spec: xapi.spec.in
sed -e 's/@RPM_RELEASE@/$(shell git rev-list HEAD | wc -l)/g' < $< > $@
- sed -i "s!@BASE_PATH@!${BASE_PATH}!g" $@
+ sed -i "s!@OPTDIR@!${OPTDIR}!g" $@
.PHONY: srpm
srpm: xapi.spec
@@ -20,7 +20,7 @@ import os, sys, tempfile
import XenAPI, inventory
import XenAPIPlugin
-sm_dir = "@BASE_PATH@/sm"
+sm_dir = "@OPTDIR@/sm"
def dd(input, output):
os.system("dd if=%s of=%s bs=1M count=16" % (input, output))
@@ -16,8 +16,8 @@ dmsetup = "/sbin/dmsetup"
iptables = "/sbin/iptables"
dd = "/bin/dd"
scli = "/usr/local/bin/scli"
-list_domains = "@BASE_PATH@/bin/list_domains"
-xs = "@BASE_PATH@/debug/xs"
+list_domains = "@OPTDIR@/bin/list_domains"
+xs = "@OPTDIR@/debug/xs"
def doexec(args, inputtext=None):
"""Execute a subprocess, then return its return code, stdout and stderr"""
View
@@ -2,5 +2,5 @@
echo "#!/bin/bash" > xencaml
ROOT=`cd .. && pwd`
-echo "`pwd`/xencaml-bin.run -I @BASE_PATH@/lib/site-lib/stdext -I @BASE_PATH@/lib/site-lib/str -I @BASE_PATH@/lib/site-lib/xml-light2 -I @BASE_PATH@/lib/xmlm -I $ROOT/idl/ocaml_backend -I $ROOT/idl -I $ROOT/autogen/ -I $ROOT/http -I $ROOT/util \$@" >> xencaml
+echo "`pwd`/xencaml-bin.run -I @OPTDIR@/lib/site-lib/stdext -I @OPTDIR@/lib/site-lib/str -I @OPTDIR@/lib/site-lib/xml-light2 -I @OPTDIR@/lib/xmlm -I $ROOT/idl/ocaml_backend -I $ROOT/idl -I $ROOT/autogen/ -I $ROOT/http -I $ROOT/util \$@" >> xencaml
chmod 755 xencaml
View
@@ -283,7 +283,7 @@ OCamlProgram(at_least_once_more, at_least_once_more at_least_once_more_test)
generate_constants: config_constants.ml
config_constants.ml: config_constants.ml.in
- sed "s!@BASE_PATH@!\"$(OPTDIR)\"!" $< > $@
+ sed "s!@OPTDIR@!\"$(OPTDIR)\"!" $< > $@
.PHONY: install
install:
@@ -1 +1 @@
-let base_path = @BASE_PATH@
+let base_path = @OPTDIR@
View
@@ -1,4 +1,4 @@
#!/bin/bash
# Run quicktest with support for exception backtraces.
-OCAMLRUNPARAM=b "@BASE_PATH@/debug/quicktestbin" "$@"
+OCAMLRUNPARAM=b "@OPTDIR@/debug/quicktestbin" "$@"
@@ -49,7 +49,7 @@ VIF=`xe vif-create vm-uuid=${VM} network-uuid=${NETWORK} device=0`
VDI=`xe vbd-list vm-uuid=${VM} userdevice=0 params=vdi-uuid --minimal`
# Run the inner-script bit:
-"@BASE_PATH@/debug/with-vdi" ${VDI} "@BASE_PATH@/debug/install-debian-pv-inside.sh"
+"@OPTDIR@/debug/with-vdi" ${VDI} "@OPTDIR@/debug/install-debian-pv-inside.sh"
# Start it up
xe vm-start vm=${VM}
View
@@ -16,5 +16,5 @@ IFS=","
for i in `xe pbd-list host-uuid=$HOSTUUID --minimal`
do
SR=`xe pbd-param-get uuid=$i param-name=sr-uuid`
- "@BASE_PATH@/sm/resetvdis.py" $HOSTUUID $SR
+ "@OPTDIR@/sm/resetvdis.py" $HOSTUUID $SR
done
@@ -2,7 +2,7 @@
if [ -e /etc/xensource/pool.conf ]; then
if [ "$(cat /etc/xensource/pool.conf)" = "master" ]; then
- "@BASE_PATH@/bin/xe-backup-metadata" -c >/dev/null 2>&1
+ "@OPTDIR@/bin/xe-backup-metadata" -c >/dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t backup-metadata "ALERT exited abnormally with [$EXITVALUE]"
@@ -2,8 +2,8 @@
# Run by xen-bugtool
-export PATH=$PATH:@BASE_PATH@/xha
+export PATH=$PATH:@OPTDIR@/xha
echo Running ha_query_liveset $*:
-"@BASE_PATH@/xha/ha_query_liveset" $*
+"@OPTDIR@/xha/ha_query_liveset" $*
echo Output of command: $?
@@ -9,7 +9,7 @@
# Return a list of (domid, uuid) tuples, one per paused domain on this host
def list_paused_domains():
results = []
- all = subprocess.Popen(["@BASE_PATH@/bin/list_domains"], stdout=subprocess.PIPE).communicate()[0]
+ all = subprocess.Popen(["@OPTDIR@/bin/list_domains"], stdout=subprocess.PIPE).communicate()[0]
lines = all.split("\n")
for domain in lines[1:]:
bits = domain.split()
@@ -54,7 +54,7 @@ def log(str):
# Destroy the given domain
def destroy_domain((domid, uuid)):
log("destroying domid %s uuid %s" % (domid, uuid))
- all = subprocess.Popen(["@BASE_PATH@/debug/destroy_domain", "-domid", domid], stdout=subprocess.PIPE).communicate()[0]
+ all = subprocess.Popen(["@OPTDIR@/debug/destroy_domain", "-domid", domid], stdout=subprocess.PIPE).communicate()[0]
# Keep track of when a domain first looked like it should be here
domain_first_noticed = {}
View
@@ -3,4 +3,4 @@
# Do not use the ocaml XIU stuff for this -- we want the real
# hypervisor to fence this domain.
unset XIU
-@BASE_PATH@/libexec/fence.bin $*
+@OPTDIR@/libexec/fence.bin $*
View
@@ -10,7 +10,7 @@
start() {
if [ ! -f /etc/xensource/ptoken ]; then
echo -n $"Creating pool secret (this may take some time)"
- "@BASE_PATH@/libexec/genptoken" -f -o /etc/xensource/ptoken
+ "@OPTDIR@/libexec/genptoken" -f -o /etc/xensource/ptoken
[ $? -eq 0 ] && success $"Done" || failure
echo
fi
@@ -8,7 +8,7 @@
. /etc/init.d/functions
export XENSOURCE_INVENTORY=/etc/xensource-inventory
-export INTERFACE_RECONFIGURE="@BASE_PATH@/libexec/interface-reconfigure"
+export INTERFACE_RECONFIGURE="@OPTDIR@/libexec/interface-reconfigure"
[ -r ${XENSOURCE_INVENTORY} ] || exit 0
. ${XENSOURCE_INVENTORY}
View
@@ -11,7 +11,7 @@
# Source function library.
. /etc/init.d/functions
-PERFMON="@BASE_PATH@/bin/perfmon"
+PERFMON="@OPTDIR@/bin/perfmon"
PERFMON_FLAGS=
if [ -f /etc/sysconfig/perfmon ]; then
View
@@ -13,7 +13,7 @@
# Memory ballooning daemon
# location of the executable:
-SQUEEZED="@BASE_PATH@/libexec/squeezed"
+SQUEEZED="@OPTDIR@/libexec/squeezed"
# pidfile:
PID_FILE="/var/run/squeezed.pid"
@@ -25,7 +25,7 @@ SUBSYS_FILE="/var/lock/subsys/squeezed"
. /etc/init.d/functions
if [ -e /var/xapi/xiu-xc ]; then
- export XENCTRL_OSDEP="@BASE_PATH@/lib/libxenctrl_xiu.so"
+ export XENCTRL_OSDEP="@OPTDIR@/lib/libxenctrl_xiu.so"
export XIU=/var/xapi/xiu
fi
View
@@ -13,7 +13,7 @@
# v6 licensing daemon
# location of the executable:
-V6D="@BASE_PATH@/libexec/v6d"
+V6D="@OPTDIR@/libexec/v6d"
# pidfile:
PID_FILE="/var/run/v6d.pid"
View
@@ -16,7 +16,7 @@ if [ -f /etc/sysconfig/xapi ]; then
fi
if [ -e /var/xapi/xiu-xc ]; then
- export XENCTRL_OSDEP="@BASE_PATH@/lib/libxenctrl_xiu.so"
+ export XENCTRL_OSDEP="@OPTDIR@/lib/libxenctrl_xiu.so"
export XIU=/var/xapi/xiu
fi
@@ -52,7 +52,7 @@ start() {
# Enable backtraces
export OCAMLRUNPARAM="b"
# Add HA scripts to the path
- PATH=$PATH:@BASE_PATH@/xha
+ PATH=$PATH:@OPTDIR@/xha
# For debugging, prevent xapi startup
if [ -e ${XAPI_BLOCK_STARTUP_COOKIE} ]; then
@@ -68,12 +68,12 @@ start() {
if [ -e ${XAPI_BOOT_TIME_INFO_UPDATED} ]; then
# clear out qemu coredumps/chroot dirs on system boot:
rm -rf /var/xen/qemu/*
- "@BASE_PATH@/bin/xapi" -daemon ${xapiflags} \
+ "@OPTDIR@/bin/xapi" -daemon ${xapiflags} \
-writereadyfile ${XAPI_STARTUP_COOKIE} -writeinitcomplete ${XAPI_INIT_COMPLETE_COOKIE} -onsystemboot
RETVAL=$?
rm -f ${XAPI_BOOT_TIME_INFO_UPDATED}
else
- "@BASE_PATH@/bin/xapi" -daemon ${xapiflags} \
+ "@OPTDIR@/bin/xapi" -daemon ${xapiflags} \
-writereadyfile ${XAPI_STARTUP_COOKIE} -writeinitcomplete ${XAPI_INIT_COMPLETE_COOKIE}
RETVAL=$?
fi
@@ -6,7 +6,7 @@
# chkconfig: 345 99 00
# description: Start/stop XE VMs
-SHUTDOWN="@BASE_PATH@/libexec/shutdown"
+SHUTDOWN="@OPTDIR@/libexec/shutdown"
if [ ! -e /proc/xen/privcmd ] || \
[ ! -e /etc/xensource-inventory ] || \
View
@@ -100,7 +100,7 @@ start() {
*)
CN=`mgmt_ip`;;
esac
- "@BASE_PATH@/libexec/generate_ssl_cert" ${PEMFILE} ${CN}
+ "@OPTDIR@/libexec/generate_ssl_cert" ${PEMFILE} ${CN}
fi
writeconffile
start_daemon ${STUNNEL} ${SSLCONFFILE}
View
@@ -16,11 +16,11 @@
start() {
# If this domain hasn't got sufficient privileges then assume it is a domU
# and start the hypercall simulator
- "@BASE_PATH@/bin/list_domains" 2>/dev/null 1>/dev/null
+ "@OPTDIR@/bin/list_domains" 2>/dev/null 1>/dev/null
if [ $? -ne 0 ]; then
echo -n $"Starting simulator: "
rm -f /var/xapi/xiu-xc /var/xapi/xiu-xs
- "@BASE_PATH@/libexec/xiu" /var/xapi/xiu 2>/dev/null 1>/dev/null &
+ "@OPTDIR@/libexec/xiu" /var/xapi/xiu 2>/dev/null 1>/dev/null &
# wait for unix domain socket to appear
RETRIES=180
@@ -36,7 +36,7 @@ start() {
failure $"xiu"
exit 1
fi
- export XENCTRL_OSDEP="@BASE_PATH@/lib/libxenctrl_xiu.so"
+ export XENCTRL_OSDEP="@OPTDIR@/lib/libxenctrl_xiu.so"
export XIU=/var/xapi/xiu
fi
echo -n $"Starting xenstored: "
@@ -59,7 +59,7 @@ start() {
XENSTORED_ARG=""
[ ! -e /etc/xensource/xenstored-no-access-log ] || XENSTORED_ARG="--no-access-log"
[ -e /var/lib/xenstored/tdb ] && mv -f /var/lib/xenstored/tdb /var/lib/xenstored/tdb.bak
- "@BASE_PATH@/bin/xenstored" ${XENSTORED_ARG}
+ "@OPTDIR@/bin/xenstored" ${XENSTORED_ARG}
/usr/sbin/xenconsoled
[ -d /var/log/blktap ] || mkdir /var/log/blktap
@@ -72,7 +72,7 @@ start() {
xenstore-rm /vm
# start cdrommon on all physicals cdrom at startup
- for i in `find /dev/xapi/cd/ ! -type d`; do "@BASE_PATH@/libexec/cdrommon" $i; done
+ for i in `find /dev/xapi/cd/ ! -type d`; do "@OPTDIR@/libexec/cdrommon" $i; done
echo
touch /var/lock/subsys/xen;
View
@@ -4,8 +4,22 @@
#
# Usage: ./install.sh <mode> <file1> .. <filen> <dest>
#
-# Assumptions:
-# - The 'base-path' script is located in the same directory.
+# Replaces the following strings:
+#
+# @OPTDIR@ -> ${OPTDIR}
+# @ETCDIR@ -> ${ETCDIR}
+# @VARDIR@ -> ...etc...
+# @VARPATCHDIR@
+# @ETCDIR@
+# @OPTDIR@
+# @PLUGINDIR@
+# @HOOKSDIR@
+# @INVENTORY@
+# @XAPICONF@
+# @LIBEXECDIR@
+# @SCRIPTSDIR@
+
+set -x
MODE=${1}
NUM_FILES=$(($#-2))
@@ -27,6 +41,16 @@ for FILE in ${FILES}; do
NEWFILE=${DEST}
fi
if file ${NEWFILE} | grep -q "text"; then
- sed -i "s!@BASE_PATH@!${BASE_PATH}!g" ${NEWFILE}
+ sed -i -e "s!@OPTDIR@!${OPTDIR}!g" \
+ -e "s!@ETCDIR@!${ETCDIR}!g" \
+ -e "s!@VARDIR@!${VARDIR}!g" \
+ -e "s!@VARPATCHDIR@!${VARPATCHDIR}!g" \
+ -e "s!@PLUGINDIR@!${PLUGINDIR}!g" \
+ -e "s!@HOOKSDIR@!${HOOKSDIR}!g" \
+ -e "s!@INVENTORY@!${INVENTORY}!g" \
+ -e "s!@XAPICONF@!${XAPICONF}!g" \
+ -e "s!@LIBEXECDIR@!${LIBEXECDIR}!g" \
+ -e "s!@SCRIPTSDIR@!${SCRIPTSDIR}!g" \
+ ${NEWFILE}
fi
-done
+done
@@ -3,7 +3,7 @@
# Copyright (c) Citrix Systems 2008. All rights reserved.
#
-# Usage: ssh root@<host> @BASE_PATH@/libexec/interface-visualise > <host>-network.dot
+# Usage: ssh root@<host> @OPTDIR@/libexec/interface-visualise > <host>-network.dot
# dotty <host>-network.dot
echo "digraph G {"
View
@@ -7,7 +7,7 @@
from xml.dom import minidom
gpg_binary_path="/usr/bin/gpg"
-gpg_homedir="@BASE_PATH@/gpg"
+gpg_homedir="@OPTDIR@/gpg"
gpg_pub_keyring=gpg_homedir + "/pubring.gpg"
license_file="/etc/xensource/license"
expiry_message_name="LICENSE_EXPIRES_SOON"
@@ -3,7 +3,7 @@
# Multipath Alerting Daemon
# location of the executable:
-MPATHALERT="@BASE_PATH@/bin/mpathalert"
+MPATHALERT="@OPTDIR@/bin/mpathalert"
#delay in seconds between 2 consecutive alerts:
DELAY="120"
View
@@ -165,7 +165,7 @@ def _get_assignments(session):
return devices
def enable_iommu(session, args):
- rc = os.system("@BASE_PATH@/libexec/xen-cmdline --set-xen iommu=1")
+ rc = os.system("@OPTDIR@/libexec/xen-cmdline --set-xen iommu=1")
return str(rc == 0)
#def list_assigned_vfs(session, args):
@@ -17,4 +17,4 @@ cat ${INV} | grep -v ^MANAGEMENT_INTERFACE > ${TMP}
echo "MANAGEMENT_INTERFACE='$INTF'" >> ${TMP}
mv ${TMP} ${INV}
-"@BASE_PATH@/libexec/update-mh-info" $INTF
+"@OPTDIR@/libexec/update-mh-info" $INTF
View
@@ -12,7 +12,7 @@ fi
IF=$1
-export PATH=$PATH:@BASE_PATH@/bin
+export PATH=$PATH:@OPTDIR@/bin
# generic stuff, necessary for xenrt too
@@ -1,7 +1,7 @@
#####################################################################
# Example configuration file for perfmon. This file is read by
# /etc/init.d/perfmon and used to construct the command line
-# arguments to pass to @BASE_PATH@/bin/perfmon.
+# arguments to pass to @OPTDIR@/bin/perfmon.
# uncomment lines to enable options.
View
@@ -10,7 +10,7 @@ DOMID=$1
shift 1
#Getting the VM UUID
-export VMUUID=`"@BASE_PATH@/bin/list_domains" -domid $DOMID -minimal`
+export VMUUID=`"@OPTDIR@/bin/list_domains" -domid $DOMID -minimal`
#For security reasons, we only listen on locahost by default
export VNCTERM_LISTEN="-v 127.0.0.1:1"
@@ -8,7 +8,7 @@
set -e
. /etc/xensource-inventory
-XE="@BASE_PATH@/bin/xe"
+XE="@OPTDIR@/bin/xe"
# Clean all unreferenced patches out of the db now that the upgrade is complete.
# When upgrading to 5.0, this should clean out all 4.1 patches at the end.
Oops, something went wrong.

0 comments on commit d6a7d77

Please sign in to comment.