aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-06-23 17:25:51 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-06-23 17:25:51 +0100
commita2b4af7d77d66eeb6f3a82f3056889ff1d453bd0 (patch)
tree7e378a41343f4ef79acdbd5ee9427bfe6e3616e1 /tools
parent2b8ba91b50c9536daac1ee64f4ef6737d03d349d (diff)
downloadxen-a2b4af7d77d66eeb6f3a82f3056889ff1d453bd0.tar.gz
xen-a2b4af7d77d66eeb6f3a82f3056889ff1d453bd0.tar.bz2
xen-a2b4af7d77d66eeb6f3a82f3056889ff1d453bd0.zip
Get rid of hardcoded pathes for stubdom and hotplug scripts
- Have the buid system generate a file which exports the install paths for the hotplug scripts and stubdom / stubdom-dm - Move file generation code from tools/python/Makefile into a gmake macro in Config.mk to avoid maintenance of three duplicates each with its own tweaks and bugs - Export gmake variables into ioemu as shell variables for upcoming ioemu patches - Do above as a gmake macro to avoid maintenance of several duplicates - Adjust hotplug scripts to find the right xen binaries from the install directory - Adjust stubdom-dm to use the install directories Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile6
-rw-r--r--tools/hotplug/Linux/block4
-rw-r--r--tools/hotplug/Linux/network-bridge2
-rw-r--r--tools/hotplug/Linux/network-nat3
-rw-r--r--tools/hotplug/Linux/network-route3
-rw-r--r--tools/hotplug/Linux/vif-bridge6
-rw-r--r--tools/hotplug/Linux/vif-nat6
-rw-r--r--tools/hotplug/Linux/vif-route6
-rw-r--r--tools/hotplug/Linux/xen-hotplug-cleanup2
-rw-r--r--tools/hotplug/Linux/xen-hotplug-common.sh3
-rw-r--r--tools/hotplug/NetBSD/block-nbsd5
-rw-r--r--tools/hotplug/NetBSD/vif-bridge-nbsd5
-rw-r--r--tools/hotplug/NetBSD/vif-ip-nbsd5
-rw-r--r--tools/hotplug/common/Makefile16
-rw-r--r--tools/python/Makefile17
15 files changed, 48 insertions, 41 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 0eebb00bd5..89ee9710de 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -97,10 +97,7 @@ ioemu-dir-find:
fi
set -e; \
$(absolutify_xen_root); \
- PREFIX=$(PREFIX); \
- XEN_SCRIPT_DIR=$(XEN_SCRIPT_DIR); \
- export PREFIX; \
- export XEN_SCRIPT_DIR; \
+ $(buildmakevars2shellvars); \
cd ioemu-dir; \
./xen-setup $(IOEMU_CONFIGURE_CROSS)
@@ -109,6 +106,7 @@ subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
subdir-clean-ioemu-dir:
set -e; if test -d ioemu-dir/.; then \
$(absolutify_xen_root); \
+ $(buildmakevars2shellvars); \
$(MAKE) -C ioemu-dir clean; \
fi
diff --git a/tools/hotplug/Linux/block b/tools/hotplug/Linux/block
index e042a7ef99..f50eeda563 100644
--- a/tools/hotplug/Linux/block
+++ b/tools/hotplug/Linux/block
@@ -377,5 +377,5 @@ mount it read-write in a guest domain."
esac
# If we've reached here, $t is neither phy nor file, so fire a helper script.
-[ -x /etc/xen/scripts/block-"$t" ] && \
- /etc/xen/scripts/block-"$t" "$command" $node
+[ -x ${XEN_SCRIPT_DIR}/block-"$t" ] && \
+ ${XEN_SCRIPT_DIR}/block-"$t" "$command" $node
diff --git a/tools/hotplug/Linux/network-bridge b/tools/hotplug/Linux/network-bridge
index 95aaba0c15..676b6a62fd 100644
--- a/tools/hotplug/Linux/network-bridge
+++ b/tools/hotplug/Linux/network-bridge
@@ -2,7 +2,7 @@
#============================================================================
# Default Xen network start/stop script.
# Xend calls a network script when it starts.
-# The script name to use is defined in /etc/xen/xend-config.sxp
+# The script name to use is defined in ${XEN_CONFIG_DIR}/xend-config.sxp
# in the network-script field.
#
# This script creates a bridge (default ${netdev}), adds a device
diff --git a/tools/hotplug/Linux/network-nat b/tools/hotplug/Linux/network-nat
index aab793d93f..10f8d28385 100644
--- a/tools/hotplug/Linux/network-nat
+++ b/tools/hotplug/Linux/network-nat
@@ -2,7 +2,7 @@
#============================================================================
# Default Xen network start/stop script when using NAT.
# Xend calls a network script when it starts.
-# The script name to use is defined in /etc/xen/xend-config.sxp
+# The script name to use is defined in ${XEN_CONFIG_DIR}/xend-config.sxp
# in the network-script field.
#
# Usage:
@@ -18,6 +18,7 @@
#============================================================================
dir=$(dirname "$0")
+. "$dir/hotplugpath.sh"
. "$dir/xen-script-common.sh"
. "$dir/xen-network-common.sh"
diff --git a/tools/hotplug/Linux/network-route b/tools/hotplug/Linux/network-route
index 574441e334..0cf85b526a 100644
--- a/tools/hotplug/Linux/network-route
+++ b/tools/hotplug/Linux/network-route
@@ -2,7 +2,7 @@
#============================================================================
# Default Xen network start/stop script.
# Xend calls a network script when it starts.
-# The script name to use is defined in /etc/xen/xend-config.sxp
+# The script name to use is defined in ${XEN_CONFIG_DIR}/xend-config.sxp
# in the network-script field.
#
# Usage:
@@ -17,6 +17,7 @@
#============================================================================
dir=$(dirname "$0")
+. "$dir/hotplugpath.sh"
. "$dir/xen-script-common.sh"
evalVariables "$@"
diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 1b698d703b..d35144e1e9 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -1,12 +1,12 @@
#!/bin/bash
#============================================================================
-# /etc/xen/vif-bridge
+# ${XEN_SCRIPT_DIR}/vif-bridge
#
# Script for configuring a vif in bridged mode.
# The hotplugging system will call this script if it is specified either in
# the device configuration given to Xend, or the default Xend configuration
-# in /etc/xen/xend-config.sxp. If the script is specified in neither of those
-# places, then this script is the default.
+# in ${XEN_CONFIG_DIR}/xend-config.sxp. If the script is specified in
+# neither of those places, then this script is the default.
#
# Usage:
# vif-bridge (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-nat b/tools/hotplug/Linux/vif-nat
index 75bdf5c444..74743ed761 100644
--- a/tools/hotplug/Linux/vif-nat
+++ b/tools/hotplug/Linux/vif-nat
@@ -1,12 +1,12 @@
#!/bin/bash
#============================================================================
-# /etc/xen/vif-nat
+# ${XEN_SCRIPT_DIR}/vif-nat
#
# Script for configuring a vif in routed-nat mode.
# The hotplugging system will call this script if it is specified either in
# the device configuration given to Xend, or the default Xend configuration
-# in /etc/xen/xend-config.sxp. If the script is specified in neither of those
-# places, then vif-bridge is the default.
+# in ${XEN_CONFIG_DIR}/xend-config.sxp. If the script is specified in
+# neither of those places, then vif-bridge is the default.
#
# Usage:
# vif-nat (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-route b/tools/hotplug/Linux/vif-route
index f5fd88ed5a..0cacfcb99e 100644
--- a/tools/hotplug/Linux/vif-route
+++ b/tools/hotplug/Linux/vif-route
@@ -1,12 +1,12 @@
#!/bin/bash
#============================================================================
-# /etc/xen/vif-route
+# ${XEN_SCRIPT_DIR}/vif-route
#
# Script for configuring a vif in routed mode.
# The hotplugging system will call this script if it is specified either in
# the device configuration given to Xend, or the default Xend configuration
-# in /etc/xen/xend-config.sxp. If the script is specified in neither of those
-# places, then vif-bridge is the default.
+# in ${XEN_CONFIG_DIR}/xend-config.sxp. If the script is specified in
+# neither of those places, then vif-bridge is the default.
#
# Usage:
# vif-route (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/xen-hotplug-cleanup b/tools/hotplug/Linux/xen-hotplug-cleanup
index 706359d03a..0cb86d27ec 100644
--- a/tools/hotplug/Linux/xen-hotplug-cleanup
+++ b/tools/hotplug/Linux/xen-hotplug-cleanup
@@ -3,7 +3,7 @@
dir=$(dirname "$0")
. "$dir/xen-hotplug-common.sh"
-# Claim the lock protecting /etc/xen/scripts/block. This stops a race whereby
+# Claim the lock protecting ${XEN_SCRIPT_DIR}/block. This stops a race whereby
# paths in the store would disappear underneath that script as it attempted to
# read from the store checking for device sharing.
# Any other scripts that do similar things will have to have their lock
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh b/tools/hotplug/Linux/xen-hotplug-common.sh
index 980a62704e..d63b7660c6 100644
--- a/tools/hotplug/Linux/xen-hotplug-common.sh
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh
@@ -17,13 +17,14 @@
dir=$(dirname "$0")
+. "$dir/hotplugpath.sh"
. "$dir/logging.sh"
. "$dir/xen-script-common.sh"
. "$dir/locking.sh"
exec 2>>/var/log/xen/xen-hotplug.log
-export PATH="/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
+export PATH="${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
export LANG="POSIX"
unset $(set | grep ^LC_ | cut -d= -f1)
diff --git a/tools/hotplug/NetBSD/block-nbsd b/tools/hotplug/NetBSD/block-nbsd
index 915ddb755a..d853e11584 100644
--- a/tools/hotplug/NetBSD/block-nbsd
+++ b/tools/hotplug/NetBSD/block-nbsd
@@ -4,7 +4,10 @@
# Called by xenbackendd
# Usage: block xsdir_backend_path state
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DIR=$(dirname "$0")
+. "${DIR}/hotplugpath.sh"
+
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
export PATH
error() {
diff --git a/tools/hotplug/NetBSD/vif-bridge-nbsd b/tools/hotplug/NetBSD/vif-bridge-nbsd
index bedb387953..ecfef15012 100644
--- a/tools/hotplug/NetBSD/vif-bridge-nbsd
+++ b/tools/hotplug/NetBSD/vif-bridge-nbsd
@@ -4,7 +4,10 @@
# Called by xenbackendd
# Usage: vif-bridge xsdir_backend_path state
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DIR=$(dirname "$0")
+. "${DIR}/hotplugpath.sh"
+
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
export PATH
xpath=$1
diff --git a/tools/hotplug/NetBSD/vif-ip-nbsd b/tools/hotplug/NetBSD/vif-ip-nbsd
index d8b5bb9759..ca4fd60580 100644
--- a/tools/hotplug/NetBSD/vif-ip-nbsd
+++ b/tools/hotplug/NetBSD/vif-ip-nbsd
@@ -4,7 +4,10 @@
# Called by xenbackendd
# Usage: vif-ip xsdir_backend_path state
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DIR=$(dirname "$0")
+. "${DIR}/hotplugpath.sh"
+
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
export PATH
xpath=$1
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index a6e731c1ca..b95bf4ee8b 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -1,17 +1,22 @@
-XEN_ROOT = ../../../
+XEN_ROOT = ../../..
include $(XEN_ROOT)/tools/Rules.mk
+HOTPLUGPATH="hotplugpath.sh"
+
# OS-independent hotplug scripts go in this directory
-# Xen script dir and scripts to go there.
-XEN_SCRIPTS =
+# Xen scripts to go there.
+XEN_SCRIPTS = $(HOTPLUGPATH)
XEN_SCRIPT_DATA =
+genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
+$(eval $(genpath-target))
+
.PHONY: all
-all:
+all: build
.PHONY: build
-build:
+build: genpath
.PHONY: install
install: all install-scripts
@@ -31,3 +36,4 @@ install-scripts:
.PHONY: clean
clean:
+ rm -f $(HOTPLUGPATH)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 67edb46306..6fa4d5b00e 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -14,20 +14,11 @@ I18NSRCFILES = $(shell find xen/xm/ -name '*.py')
CATALOGS = $(patsubst %,xen/xm/messages/%.mo,$(LINGUAS))
NLSDIR = $(SHAREDIR)/locale
XENPATH = "xen/util/path.py"
-
-.PHONY: build buildpy genpath
-genpath:
- rm -f $(XENPATH)
- echo "SBINDIR=\"$(SBINDIR)\"" >> $(XENPATH)
- echo "BINDIR=\"$(BINDIR)\"" >> $(XENPATH)
- echo "LIBEXEC=\"$(LIBEXEC)\"" >> $(XENPATH)
- echo "LIBDIR=\"$(LIBDIR)\"" >> $(XENPATH)
- echo "SHAREDIR=\"$(SHAREDIR)\"" >> $(XENPATH)
- echo "PRIVATE_BINDIR=\"$(PRIVATE_BINDIR)\"" >> $(XENPATH)
- echo "XENFIRMWAREDIR=\"$(XENFIRMWAREDIR)\"" >> $(XENPATH)
- echo "XEN_CONFIG_DIR=\"$(XEN_CONFIG_DIR)\"" >> $(XENPATH)
- echo "XEN_SCRIPT_DIR=\"$(XEN_SCRIPT_DIR)\"" >> $(XENPATH)
+genpath-target = $(call buildmakevars2file,$(XENPATH))
+$(eval $(genpath-target))
+
+.PHONY: build buildpy
buildpy: genpath
CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build