tool changes to honor configure --prefix=DIR
v5 cover tool changes to honor configure --prefix=DIR
Konrad, you are in CC because I would like to see this in 4.5-rc1.
In my attempt to get a xen.rpm from 'make rpmball' which operates entirely below the configured --prefix= I came up with these changes.
This is a resend of the remaining parts of this series with the comments incorporated:
http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03003.html
http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03981.html
In v5 of this series the --libexec patch was updated to also remove PRIVATE_PREFIX and PRIVATE_BINDIR from paths.m4, and it does not remove $(LIBDIR)/xen/ anymore - just $(LIBEXEC). The patch to "separate runtime debug info" is the simplified version.
With this series its now possible to run everything except pygrub below the configured --prefix=.
NOTE: the renaming of tools/hotplug/Linux/init.d/xencommons.in may cause trouble in configured working copies. Use 'git clean -dfx' to wipe all and everything before git pull.
One outstanding bug is pygrub, which does not know about $prefix/$lib/python/site-packages. This is still on my todo list.
Please rerun autogen.sh after applying this series.
Olaf
Olaf Hering (28):
tools: fix make uninstall
tools/hotplug: fix race during xen.conf creation tools/python: use also LDFLAGS for build
Add configure --with-initddir=DIR
tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path tools/configure.ac: sort AC_CONFIG_FILES
tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
remove duplicate variables from config
Substitue configure variables in Paths.mk.in
tools: substitute bindir instead of BINDIR
Use configure --mandir=DIR to set MANDIR
Use configure --docdir=DIR to set DOCDIR
Use configure --includedir=DIR to set INCLUDEDIR
Use configure --libexecdir=BASEDIR to set LIBEXEC
Use configure --prefix=DIR to set PREFIX
Use configure --localstatedir=BASEDIR to set path to /var Add configure --enable-rpath
Add configure --with-linux-backend-modules="mod1 mod2" Move variable to set bash_completion.d to Paths.mk
Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Make XENFIRMWAREDIR a subdir of libexecdir
tools: remove private copies of includedir and libdir from libxenstat Use Paths.mk for docs, stubdom and tools build
tools: use XEN_LIB_STORED instead of /var/lib/xenstored tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen move vtpmmgr helpers from tools to stubdom
Separate runtime debug output from debug symbols
.gitignore | 7 ++
Config.mk | 14 +--
Makefile | 12 ---
README | 12 ---
config/Docs.mk.in | 7 +-
config/Linux.mk | 2 +
config/Linux.modules | 20 ----
config/NetBSD.mk | 5 -
config/NetBSDRump.mk | 2 -
config/Paths.mk.in | 44 +++++++--
config/StdGNU.mk | 23 -----
config/Stubdom.mk.in | 7 --
config/SunOS.mk | 15 ---
config/Tools.mk.in | 13 +--
docs/misc/distro_mapping.txt | 5 +-
m4/paths.m4 | 101 ++++++++++++++-------
m4/xenstored.m4 | 8 +-
stubdom/Makefile | 9 +-
stubdom/vtpmmgr/Makefile | 5 +
{tools => stubdom}/vtpmmgr/calc.pl | 0
{tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl | 0
tools/Makefile | 46 ++++++++--
tools/Rules.mk | 1 -
tools/configure.ac | 53 +++++++++--
tools/console/Makefile | 4 +-
tools/hotplug/FreeBSD/Makefile | 5 +-
.../FreeBSD/rc.d/{xencommons => xencommons.in} | 6 +-
tools/hotplug/FreeBSD/vif-bridge | 2 +-
tools/hotplug/Linux/Makefile | 18 ++--
tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 10 +-
.../Linux/init.d/{xen-watchdog => xen-watchdog.in} | 2 +-
.../init.d/{xencommons.in.in => xencommons.in} | 13 ++-
.../Linux/init.d/{xendomains => xendomains.in} | 14 +--
tools/hotplug/Linux/systemd/Makefile | 37 ++------
.../systemd/xen-qemu-dom0-disk-backend.service.in | 4 +-
.../hotplug/Linux/systemd/xen-watchdog.service.in | 2 +-
tools/hotplug/Linux/systemd/xenconsoled.service.in | 2 +-
tools/hotplug/Linux/systemd/xendomains.service.in | 6 +-
tools/hotplug/Linux/systemd/xenstored.service.in | 4 +-
tools/hotplug/Linux/update-modules.sh | 36 --------
tools/hotplug/Linux/{vif-setup => vif-setup.in} | 2 +-
.../{xen-backend.rules => xen-backend.rules.in} | 16 ++--
...-hotplug-common.sh => xen-hotplug-common.sh.in} | 4 +-
tools/hotplug/Linux/{xendomains => xendomains.in} | 2 +-
tools/hotplug/NetBSD/Makefile | 6 +-
tools/hotplug/NetBSD/block | 2 +-
.../NetBSD/rc.d/{xencommons => xencommons.in} | 4 +-
tools/hotplug/NetBSD/vif-bridge | 2 +-
tools/hotplug/NetBSD/vif-ip | 2 +-
tools/libxl/Makefile | 6 +-
tools/libxl/libxl_dm.c | 4 +-
tools/libxl/libxl_internal.h | 1 -
tools/libxl/libxl_paths.c | 7 +-
tools/libxl/libxl_save_callout.c | 2 +-
tools/misc/Makefile | 4 +-
tools/ocaml/common.make | 5 +-
tools/pygrub/Makefile | 8 +-
tools/python/Makefile | 4 +-
tools/vtpmmgr/Makefile | 15 ---
tools/xcutils/Makefile | 4 +-
tools/xenpaging/Makefile | 4 +-
tools/xenstat/libxenstat/Makefile | 4 -
tools/xenstore/Makefile | 3 +-
tools/xenstore/xs_lib.c | 2 +-
tools/xentrace/Makefile | 4 +-
xen/Rules.mk | 3 +-
66 files changed, 322 insertions(+), 374 deletions(-)
delete mode 100644 config/Linux.modules
rename {tools => stubdom}/vtpmmgr/calc.pl (100%)
rename {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl (100%)
rename tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} (96%)
rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%)
rename tools/hotplug/Linux/init.d/{xencommons.in.in => xencommons.in} (91%)
rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (79%)
delete mode 100755 tools/hotplug/Linux/update-modules.sh
rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (61%)
rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (62%)
rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (94%)
rename tools/hotplug/Linux/{xendomains => xendomains.in} (99%)
rename tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} (97%)
delete mode 100644 tools/vtpmmgr/MakefilePATCH v5 1/28 tools: fix make uninstall
The uninstall target does not know about the paths it removes because the toplevel Makefile does not include the required files.
Move the commands to tools/Makefile because all files come from subdirs in tools/ anyway. Drop the removal of $(XEN_RUN_DIR) because it gets created at runtime. Drop the removal of systemd related files because the wildcard matches everything.
The proper fix is to remove the files and directories in the Makefiles which install them. But this version is the least intrusive change at this point.
--- Makefile | 12 ------------ tools/Makefile | 9 +++++++++ 2 files changed, 9 insertions(+), 12 deletions(-)
Makefile +0 -12
@@ -232,19 +232,7 @@ help: .PHONY: uninstall uninstall: D=$(DESTDIR) uninstall: - [ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true $(MAKE) -C xen uninstall - rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend - rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog - rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules - rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules - rm -f $(D)$(SYSCONFIG_DIR)/xendomains - rm -f $(D)$(SBINDIR)/xendomains - rm -f $(D)$(SYSCONFIG_DIR)/xencommons - rm -f $(D)$(XEN_SYSTEMD_DIR)/*.service - rm -f $(D)$(XEN_SYSTEMD_DIR)/*.mount - rm -f $(D)$(XEN_SYSTEMD_MODULES_LOAD)/*.conf - rm -rf $(D)$(XEN_RUN_DIR)* $(D)/var/lib/xen* make -C tools uninstall rm -rf $(D)/boot/tboot*
tools/Makefile +9 -0
@@ -67,6 +67,15 @@ install: subdirs-install .PHONY: uninstall uninstall: D=$(DESTDIR) uninstall: + [ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true + rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend + rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog + rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules + rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules + rm -f $(D)$(SYSCONFIG_DIR)/xendomains + rm -f $(D)$(SBINDIR)/xendomains + rm -f $(D)$(SYSCONFIG_DIR)/xencommons + rm -rf $(D)/var/lib/xen* rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen rm -rf $(D)$(BINDIR)/xc_shadow rm -rf $(D)$(BINDIR)/pygrub
Re: [PATCH 01/28] tools: fix make uninstall
Quoted 8 lines · Olaf Hering
The uninstall target does not know about the paths it removes because the toplevel
Makefiledoes not include the required files.Move the commands to
tools/Makefilebecause all files come from subdirs intools/anyway. Drop the removal of $(XEN_RUN_DIR) because it gets created at runtime. Drop the removal of systemd related files because the wildcard matches everything.
Quoted 7 lines
The proper fix is to remove the files and directories in the Makefiles which install them. But this version is the least intrusive change at this point.
Signed-off-by Olaf Hering <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>
PATCH v5 2/28 tools/hotplug: fix race during xen.conf creation
In reply to Olaf HeringA make -j8 will call the xen.conf rule twice. The move-if-changed macro may fail of the tmp file was already removed by the other make process. Fix this by let the all target depend on install. Also remove the generated file with make clean.
--- tools/hotplug/Linux/systemd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/hotplug/Linux/systemd/Makefile +2 -1
@@ -21,10 +21,11 @@ ALL_XEN_SYSTEMD = $(XEN_SYSTEMD_MODULES) \ $(XEN_SYSTEMD_SERVICE) .PHONY: all -all: $(ALL_XEN_SYSTEMD) +all: install .PHONY: clean clean: + rm -f $(ALL_XEN_SYSTEMD) .PHONY: install install: $(ALL_XEN_SYSTEMD)
Re: [PATCH 02/28] tools/hotplug: fix race during xen.conf creation
Quoted 2 lines · Olaf Hering
A make -j8 will call the xen.conf rule twice. The move-if-changed macro may fail of the tmp file was already removed by the other make
s/of/if/
Quoted 30 lines
process. Fix this by let the all target depend on install. Also remove the generated file with make clean.
Signed-off-by Olaf Hering <[email protected]>Acked-by Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Ian Campbell <[email protected]>Cc Wei Liu <[email protected]>--- tools/hotplug/Linux/systemd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/hotplug/Linux/systemd/Makefile +2
-1@@ -21,10 +21,11 @@ ALL_XEN_SYSTEMD = $(XEN_SYSTEMD_MODULES) \ $(XEN_SYSTEMD_SERVICE) .PHONY: all -all: $(ALL_XEN_SYSTEMD) +all: install .PHONY: clean clean: + rm -f $(ALL_XEN_SYSTEMD) .PHONY: install install: $(ALL_XEN_SYSTEMD)
PATCH v5 3/28 tools/python: use also LDFLAGS for build
In reply to Olaf HeringAn upcoming change will pass -Wl,-rpath to xc.so. Make sure such LDFLAGS will be used for python libs.
--- tools/python/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/python/Makefile +2 -2
@@ -11,11 +11,11 @@ build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \ $(XEN_ROOT)/tools/libxl/libxl_types.idl \ xen/lowlevel/xl/_pyxl_types.h \ xen/lowlevel/xl/_pyxl_types.c - CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build + CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build .PHONY: install install: - CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \ + CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \ $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force .PHONY: test
PATCH v5 4/28 Add configure --with-initddir=DIR
In reply to Olaf HeringPreserve existing behaviour: Fedora gets rc.d/init.d, BSD gets rc.d, everyone else gets init.d.
Please rerun autogen.sh after applying this patch.
--- Config.mk | 1 - config/Paths.mk.in | 1 + docs/misc/distro_mapping.txt | 5 +++-- m4/paths.m4 | 20 ++++++++++++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-)
Config.mk +0 -1
@@ -76,7 +76,6 @@ endef # See distro_mapping.txt for other options $(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default)) -$(eval $(call setvar_dir,INITD_DIR,/etc,/rc.d/init.d,/rc.d/init.d,/init.d)) ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
config/Paths.mk.in +1 -0
@@ -24,6 +24,7 @@ XEN_LOG_DIR := @XEN_LOG_DIR@ XEN_LIB_STORED := @XEN_LIB_STORED@ CONFIG_DIR := @CONFIG_DIR@ +INITD_DIR := @INITD_DIR@ XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@
docs/misc/distro_mapping.txt +3 -2
@@ -13,8 +13,9 @@ build host, via the "setvar_dir" macro in Config.mk) and for some scripts at run-time. If the Red Hat directory exists, it is used; otherwise the Debian one is used. -You can override this by setting the variables in the environment or -your ".config" (which is included by .config). +The INITD_DIR path can be changed with configure --with-initddir=DIR. +The CONFIG_LEAF_DIR path can be changed by setting the variables in +the environment or your ".config" (which is included by Config.mk). To add support for new distributions that don't use the above locations, one must grep for the above elements and add appropriate checks.
m4/paths.m4 +20 -0
@@ -22,6 +22,23 @@ if test "x$sysconfdir" = 'x${prefix}/etc' ; then esac fi +AC_ARG_WITH([initddir], + AS_HELP_STRING([--with-initddir=DIR], + [Path to directory with sysv runlevel scripts. [SYSCONFDIR/init.d]]), + [initddir_path=$withval], + [case "$host_os" in + *linux*) + if test -d $sysconfdir/rc.d/init.d ; then + initddir_path=$sysconfdir/rc.d/init.d + else + initddir_path=$sysconfdir/init.d + fi + ;; + *) + initddir_path=$sysconfdir/rc.d + ;; + esac]) + BINDIR=$prefix/bin AC_SUBST(BINDIR)
@@ -63,6 +80,9 @@ AC_SUBST(XENFIRMWAREDIR) CONFIG_DIR=$sysconfdir AC_SUBST(CONFIG_DIR) +INITD_DIR=$initddir_path +AC_SUBST(INITD_DIR) + XEN_CONFIG_DIR=$CONFIG_DIR/xen AC_SUBST(XEN_CONFIG_DIR)
PATCH v5 5/28 tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
In reply to Olaf HeringHelper scripts get installed into XEN_SCRIPT_DIR, but initscripts, helper scripts and udev rules still refer to the hardcoded location /etc/xen/scripts/. Update scripts, rules and Makefile to refer to @XEN_SCRIPT_DIR@ instead.
Update configure.ac to substitute the path in files using XEN_SCRIPT_DIR. Remove XEN_SCRIPT_DIR from StdGNU.mk and SunOS.mk, its already in Paths.mk.
Note: In SunOS.mk it refered to PRIVATE_PREFIX, which was introduced by 9f6d07bac9f14aaa8bafe38b4a217e61a3a57842 ("tools: get rid of hardcoded config dirs").
Please rerun autogen.sh after applying this patch.
---
.gitignore | 6 ++++++
config/StdGNU.mk | 1 -
config/SunOS.mk | 1 -
tools/configure.ac | 6 ++++++
.../Linux/init.d/{xen-watchdog => xen-watchdog.in} | 2 +-
tools/hotplug/Linux/init.d/xencommons.in.in | 2 +-
tools/hotplug/Linux/init.d/{xendomains => xendomains.in} | 2 +-
tools/hotplug/Linux/{vif-setup => vif-setup.in} | 2 +-
.../Linux/{xen-backend.rules => xen-backend.rules.in} | 16 ++++++++--------
.../{xen-hotplug-common.sh => xen-hotplug-common.sh.in} | 2 +-
tools/hotplug/Linux/{xendomains => xendomains.in} | 2 +-
11 files changed, 26 insertions(+), 16 deletions(-).gitignore +6 -0
@@ -160,6 +160,12 @@ tools/flask/utils/flask-set-bool tools/flask/utils/flask-label-pci tools/fs-back/fs-backend tools/hotplug/common/hotplugpath.sh +tools/hotplug/Linux/init.d/xen-watchdog +tools/hotplug/Linux/init.d/xendomains +tools/hotplug/Linux/vif-setup +tools/hotplug/Linux/xen-backend.rules +tools/hotplug/Linux/xen-hotplug-common.sh +tools/hotplug/Linux/xendomains tools/include/xen/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker
config/StdGNU.mk +0 -1
@@ -48,7 +48,6 @@ XEN_PAGING_DIR = /var/lib/xen/xenpaging SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) XEN_CONFIG_DIR = $(CONFIG_DIR)/xen -XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts BOOT_DIR ?= /boot
config/SunOS.mk +0 -1
@@ -32,7 +32,6 @@ PRIVATE_PREFIX = $(LIBDIR)/xen PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin XEN_CONFIG_DIR = $(CONFIG_DIR)/xen -XEN_SCRIPT_DIR = $(PRIVATE_PREFIX)/scripts BOOT_DIR ?= /boot
tools/configure.ac +6 -0
@@ -9,6 +9,8 @@ AC_CONFIG_FILES([ ../config/Tools.mk hotplug/Linux/init.d/xencommons.in hotplug/Linux/init.d/sysconfig.xencommons +hotplug/Linux/init.d/xen-watchdog +hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xenstored.socket
@@ -18,6 +20,10 @@ hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xen-watchdog.service +hotplug/Linux/vif-setup +hotplug/Linux/xen-backend.rules +hotplug/Linux/xen-hotplug-common.sh +hotplug/Linux/xendomains ]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([../])
tools/hotplug/Linux/init.d/xen-watchdog.in renamed from tools/hotplug/Linux/init.d/xen-watchdog +1 -1
@@ -17,7 +17,7 @@ ### END INIT INFO # -. /etc/xen/scripts/hotplugpath.sh +. @XEN_SCRIPT_DIR@/hotplugpath.sh DAEMON=${SBINDIR}/xenwatchdogd base=$(basename $DAEMON)
tools/hotplug/Linux/init.d/xencommons.in.in +1 -1
@@ -20,7 +20,7 @@ XENSTORED=@XENSTORED@ -. /etc/xen/scripts/hotplugpath.sh +. @XEN_SCRIPT_DIR@/hotplugpath.sh if [ -d /etc/sysconfig ]; then xencommons_config=/etc/sysconfig
tools/hotplug/Linux/init.d/xendomains.in renamed from tools/hotplug/Linux/init.d/xendomains +1 -1
@@ -24,7 +24,7 @@ # systemd systems. ### END INIT INFO -. /etc/xen/scripts/hotplugpath.sh +. @XEN_SCRIPT_DIR@/hotplugpath.sh case "$1" in start)
tools/hotplug/Linux/vif-setup.in renamed from tools/hotplug/Linux/vif-setup +1 -1
@@ -4,6 +4,6 @@ if test "$script" then exec $script $* else - exec /etc/xen/scripts/vif-bridge $* + exec @XEN_SCRIPT_DIR@/vif-bridge $* fi
tools/hotplug/Linux/xen-backend.rules.in renamed from tools/hotplug/Linux/xen-backend.rules +8 -8
@@ -1,10 +1,10 @@ -SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}" -SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}" -SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}" -SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif" -SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" -SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", RUN+="/etc/xen/scripts/vscsi $env{ACTION}" -SUBSYSTEM=="xen-backend", ACTION=="remove", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/xen-hotplug-cleanup" +SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/blktap $env{ACTION}" +SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/block $env{ACTION}" +SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="@XEN_SCRIPT_DIR@/vif2 $env{ACTION}" +SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="@XEN_SCRIPT_DIR@/vif-setup online type_if=vif" +SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="@XEN_SCRIPT_DIR@/vif-setup offline type_if=vif" +SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", RUN+="@XEN_SCRIPT_DIR@/vscsi $env{ACTION}" +SUBSYSTEM=="xen-backend", ACTION=="remove", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/xen-hotplug-cleanup" KERNEL=="evtchn", NAME="xen/%k" SUBSYSTEM=="xen", KERNEL=="blktap[0-9]*", NAME="xen/%k", MODE="0600" SUBSYSTEM=="blktap2", KERNEL=="blktap[0-9]*", NAME="xen/blktap-2/%k", MODE="0600"
@@ -12,4 +12,4 @@ KERNEL=="blktap-control", NAME="xen/blktap-2/control", MODE="0600" KERNEL=="gntdev", NAME="xen/%k", MODE="0600" KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600" KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600" -SUBSYSTEM=="net", KERNEL=="vif*-emu", ACTION=="add", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap" +SUBSYSTEM=="net", KERNEL=="vif*-emu", ACTION=="add", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/vif-setup $env{ACTION} type_if=tap"
tools/hotplug/Linux/xen-hotplug-common.sh.in renamed from tools/hotplug/Linux/xen-hotplug-common.sh +1 -1
@@ -112,7 +112,7 @@ xenstore_write() { # Execute each hook in the <hook> directory. # call_hooks() { - for f in /etc/xen/scripts/${1}-${2}.d/*.hook; do + for f in @XEN_SCRIPT_DIR@/${1}-${2}.d/*.hook; do if [ -x "$f" ]; then . "$f"; fi done }
tools/hotplug/Linux/xendomains.in renamed from tools/hotplug/Linux/xendomains +1 -1
@@ -27,7 +27,7 @@ # boots / shuts down. ### END INIT INFO -. /etc/xen/scripts/hotplugpath.sh +. @XEN_SCRIPT_DIR@/hotplugpath.sh CMD=${SBINDIR}/xl HEADCOMP="Xen saved domain"
PATCH v5 6/28 tools/configure.ac: sort AC_CONFIG_FILES
In reply to Olaf HeringPlease rerun autogen.sh after applying this patch.
--- tools/configure.ac | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
tools/configure.ac +6 -6
@@ -7,19 +7,19 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]), AC_CONFIG_SRCDIR([libxl/libxl.c]) AC_CONFIG_FILES([ ../config/Tools.mk -hotplug/Linux/init.d/xencommons.in hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog +hotplug/Linux/init.d/xencommons.in hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount -hotplug/Linux/systemd/xenstored.socket -hotplug/Linux/systemd/xenstored_ro.socket -hotplug/Linux/systemd/xenstored.service -hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service -hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xen-watchdog.service +hotplug/Linux/systemd/xenconsoled.service +hotplug/Linux/systemd/xendomains.service +hotplug/Linux/systemd/xenstored.service +hotplug/Linux/systemd/xenstored.socket +hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh
PATCH v5 7/28 tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
In reply to Olaf Hering--- tools/hotplug/FreeBSD/Makefile | 4 ++-- tools/hotplug/NetBSD/Makefile | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
tools/hotplug/FreeBSD/Makefile +2 -2
@@ -31,10 +31,10 @@ install-scripts: .PHONY: install-rcd install-rcd: - $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d + $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR) set -e; for i in $(XEN_RCD_PROG); \ do \ - $(INSTALL_PROG) $$i $(DESTDIR)$(CONFIG_DIR)/rc.d; \ + $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \ sed -i '' 's,@xen_script_dir@,$(DESTDIR)$(XEN_SCRIPT_DIR),g' $(DESTDIR)$(CONFIG_DIR)/$$i; \ done $(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
tools/hotplug/NetBSD/Makefile +3 -3
@@ -33,12 +33,12 @@ install-scripts: .PHONY: install-rcd install-rcd: - $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d + $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR) set -e; for i in $(XEN_RCD_PROG); \ do \ - $(INSTALL_PROG) $$i $(DESTDIR)$(CONFIG_DIR)/rc.d; \ + $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \ done - $(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(CONFIG_DIR)/rc.d/xen-hotplugpath.sh + $(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(INITD_DIR)/xen-hotplugpath.sh .PHONY: clean clean:
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH v5 8/28 tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
In reply to Olaf HeringAlso remove DESTDIR from the path, this was most likely not intended.
Please rerun autogen.sh after applying this patch.
---
.gitignore | 1 +
tools/configure.ac | 1 +
tools/hotplug/FreeBSD/Makefile | 1 -
tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} | 2 +-
4 files changed, 3 insertions(+), 2 deletions(-).gitignore +1 -0
@@ -160,6 +160,7 @@ tools/flask/utils/flask-set-bool tools/flask/utils/flask-label-pci tools/fs-back/fs-backend tools/hotplug/common/hotplugpath.sh +tools/hotplug/FreeBSD/rc.d/xencommons tools/hotplug/Linux/init.d/xen-watchdog tools/hotplug/Linux/init.d/xendomains tools/hotplug/Linux/vif-setup
tools/configure.ac +1 -0
@@ -7,6 +7,7 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]), AC_CONFIG_SRCDIR([libxl/libxl.c]) AC_CONFIG_FILES([ ../config/Tools.mk +hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons.in
tools/hotplug/FreeBSD/Makefile +0 -1
@@ -35,7 +35,6 @@ install-rcd: set -e; for i in $(XEN_RCD_PROG); \ do \ $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \ - sed -i '' 's,@xen_script_dir@,$(DESTDIR)$(XEN_SCRIPT_DIR),g' $(DESTDIR)$(CONFIG_DIR)/$$i; \ done $(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
tools/hotplug/FreeBSD/rc.d/xencommons.in renamed from tools/hotplug/FreeBSD/rc.d/xencommons +1 -1
@@ -5,7 +5,7 @@ . /etc/rc.subr -. @xen_script_dir@/hotplugpath.sh +. @XEN_SCRIPT_DIR@/hotplugpath.sh LD_LIBRARY_PATH="${LIBDIR}" export LD_LIBRARY_PATH
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH v5 9/28 remove duplicate variables from config
In reply to Olaf Hering... because they are already in Paths.mk:
BINDIR, LIBEXEC, PRIVATE_BINDIR, PRIVATE_PREFIX, SBINDIR, SHAREDIR, XEN_CONFIG_DIR, XENFIRMWAREDIR, XEN_LOCK_DIR, XEN_PAGING_DIR, XEN_RUN_DIR. Remove unused PKG_XEN_PREFIX, which was also incorrectly assigned to PRIVATE_PREFIX.
Please rerun autogen.sh after applying this patch.
--- Config.mk | 1 - config/NetBSD.mk | 5 ----- config/NetBSDRump.mk | 2 -- config/Paths.mk.in | 1 - config/StdGNU.mk | 14 -------------- config/SunOS.mk | 8 -------- m4/paths.m4 | 20 ++++++++++++++------ 7 files changed, 14 insertions(+), 37 deletions(-)
Config.mk +0 -1
@@ -58,7 +58,6 @@ endif include $(XEN_ROOT)/config/$(XEN_OS).mk include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk -SHAREDIR ?= $(PREFIX)/share DOCDIR ?= $(SHAREDIR)/doc/xen MANDIR ?= $(SHAREDIR)/man BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
config/NetBSD.mk +0 -5
@@ -1,11 +1,6 @@ include $(XEN_ROOT)/config/StdGNU.mk # Override settings for this OS -LIBEXEC = $(PREFIX)/libexec -PRIVATE_BINDIR = $(BINDIR) - DLOPEN_LIBS = -XEN_LOCK_DIR = /var/lib - WGET = ftp
config/NetBSDRump.mk +0 -2
@@ -3,8 +3,6 @@ include $(XEN_ROOT)/config/StdGNU.mk DLOPEN_LIBS = PTHREAD_LIBS = -XEN_LOCK_DIR = /var/lib - WGET = ftp XENSTORE_XENSTORED=n
config/Paths.mk.in +0 -1
@@ -29,7 +29,6 @@ XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@ PRIVATE_PREFIX := @PRIVATE_PREFIX@ -PRIVATE_PREFIX := @PKG_XEN_PREFIX@ PRIVATE_BINDIR := @PRIVATE_BINDIR@ XENFIRMWAREDIR := @XENFIRMWAREDIR@
config/StdGNU.mk +0 -14
@@ -28,27 +28,13 @@ INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p PREFIX ?= /usr -BINDIR = $(PREFIX)/bin INCLUDEDIR = $(PREFIX)/include -LIBEXEC = $(PREFIX)/lib/xen/bin -SHAREDIR = $(PREFIX)/share MANDIR = $(SHAREDIR)/man MAN1DIR = $(MANDIR)/man1 MAN8DIR = $(MANDIR)/man8 -SBINDIR = $(PREFIX)/sbin -XENFIRMWAREDIR = $(PREFIX)/lib/xen/boot - -PRIVATE_PREFIX = $(LIBDIR)/xen -PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin - -XEN_LOCK_DIR = /var/lock -XEN_RUN_DIR = /var/run/xen -XEN_PAGING_DIR = /var/lib/xen/xenpaging SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) -XEN_CONFIG_DIR = $(CONFIG_DIR)/xen - BOOT_DIR ?= /boot SOCKET_LIBS =
config/SunOS.mk +0 -8
@@ -20,18 +20,10 @@ INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p PREFIX ?= /usr -BINDIR = $(PREFIX)/bin INCLUDEDIR = $(PREFIX)/include MANDIR = $(PREFIX)/share/man MAN1DIR = $(MANDIR)/man1 MAN8DIR = $(MANDIR)/man8 -SBINDIR = $(PREFIX)/sbin -XENFIRMWAREDIR = $(LIBDIR)/xen/boot - -PRIVATE_PREFIX = $(LIBDIR)/xen -PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin - -XEN_CONFIG_DIR = $(CONFIG_DIR)/xen BOOT_DIR ?= /boot
m4/paths.m4 +14 -6
@@ -47,7 +47,10 @@ AC_SUBST(SBINDIR) dnl XXX: this should be changed to use the passed $libexec dnl but can be done as a second step -LIBEXEC=$prefix/lib/xen/bin +case "$host_os" in +*netbsd*) LIBEXEC=$prefix/libexec ;; +*) LIBEXEC=$prefix/lib/xen/bin ;; +esac AC_SUBST(LIBEXEC) LIBDIR=`eval echo $libdir`
@@ -68,10 +71,11 @@ AC_SUBST(SHAREDIR) PRIVATE_PREFIX=$LIBDIR/xen AC_SUBST(PRIVATE_PREFIX) -PKG_XEN_PREFIX=$LIBDIR/xen -AC_SUBST(PKG_XEN_PREFIX) - -PRIVATE_BINDIR=$PRIVATE_PREFIX/bin +case "$host_os" in +*freebsd*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;; +*netbsd*) PRIVATE_BINDIR=$BINDIR ;; +*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;; +esac AC_SUBST(PRIVATE_BINDIR) XENFIRMWAREDIR=$prefix/lib/xen/boot
@@ -89,7 +93,11 @@ AC_SUBST(XEN_CONFIG_DIR) XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts AC_SUBST(XEN_SCRIPT_DIR) -XEN_LOCK_DIR=/var/lock +case "$host_os" in +*freebsd*) XEN_LOCK_DIR=/var/lib ;; +*netbsd*) XEN_LOCK_DIR=/var/lib ;; +*) XEN_LOCK_DIR=/var/lock ;; +esac AC_SUBST(XEN_LOCK_DIR) XEN_RUN_DIR=/var/run/xen
PATCH v5 10/28 Substitue configure variables in Paths.mk.in
In reply to Olaf HeringThis patch lays the groundwork to convert variables used in Makefiles to the common automake style, i.e. PREFIX becomes prefix, MANDIR becomes mandir and so on.
The reason is that configure variables such as mandir expand to ${datarootdir}/man, and datarootdir expands to ${prefix}/share. This requires extra expansion in configure.ac before assigning to MANDIR.
Special care must be taken when variable substition is done in other files, such as xencommons.in. All @VARIABLES@ used in these files have to be the expanded version, or all other variables must be available at runtime.
This patch by itself changes nothing, but upcoming changes will make use of the lowercase variables.
--- config/Paths.mk.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
config/Paths.mk.in +17 -0
@@ -12,6 +12,23 @@ # # http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration +PACKAGE_TARNAME := @PACKAGE_TARNAME@ +prefix := @prefix@ +bindir := @bindir@ +sbindir := @sbindir@ +libdir := @libdir@ +libexecdir := @libexecdir@ +datarootdir := @datarootdir@ +mandir := @mandir@ +docdir := @docdir@ +dvidir := @dvidir@ +htmldir := @htmldir@ +pdfdir := @pdfdir@ +psdir := @psdir@ +includedir := @includedir@ +localstatedir := @localstatedir@ +sysconfdir := @sysconfdir@ + SBINDIR := @SBINDIR@ BINDIR := @BINDIR@ LIBEXEC := @LIBEXEC@
PATCH v5 11/28 tools: substitute bindir instead of BINDIR
In reply to Olaf Hering... and same for sbindir and libdir.
Expand usage of exec_prefix so that it does not appear in substituted variables in systemd files.
Please rerun autogen.sh after applying this patch.
--- config/Paths.mk.in | 6 +++--- m4/paths.m4 | 15 +++++---------- m4/xenstored.m4 | 8 ++++---- tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 4 ++-- tools/hotplug/Linux/systemd/xen-watchdog.service.in | 2 +- tools/hotplug/Linux/systemd/xenconsoled.service.in | 2 +- tools/hotplug/Linux/systemd/xenstored.service.in | 4 ++-- 7 files changed, 18 insertions(+), 23 deletions(-)
config/Paths.mk.in +3 -3
@@ -29,12 +29,12 @@ includedir := @includedir@ localstatedir := @localstatedir@ sysconfdir := @sysconfdir@ -SBINDIR := @SBINDIR@ -BINDIR := @BINDIR@ +SBINDIR := $(sbindir) +BINDIR := $(bindir) LIBEXEC := @LIBEXEC@ SHAREDIR := @SHAREDIR@ -LIBDIR := @LIBDIR@ +LIBDIR := $(libdir) XEN_RUN_DIR := @XEN_RUN_DIR@ XEN_LOG_DIR := @XEN_LOG_DIR@
m4/paths.m4 +5 -10
@@ -2,6 +2,10 @@ AC_DEFUN([AX_XEN_EXPAND_CONFIG], [ dnl expand these early so we can use this for substitutions test "x$prefix" = "xNONE" && prefix=$ac_default_prefix test "x$exec_prefix" = "xNONE" && exec_prefix=${prefix} +dnl expand exec_prefix or it will endup in substituted variables +bindir=`eval echo $bindir` +sbindir=`eval echo $sbindir` +libdir=`eval echo $libdir` dnl if test "x$sysconfdir" = 'x${prefix}/etc' ; then
@@ -39,12 +43,6 @@ AC_ARG_WITH([initddir], ;; esac]) -BINDIR=$prefix/bin -AC_SUBST(BINDIR) - -SBINDIR=$prefix/sbin -AC_SUBST(SBINDIR) - dnl XXX: this should be changed to use the passed $libexec dnl but can be done as a second step case "$host_os" in
@@ -53,9 +51,6 @@ case "$host_os" in esac AC_SUBST(LIBEXEC) -LIBDIR=`eval echo $libdir` -AC_SUBST(LIBDIR) - XEN_RUN_DIR=/var/run/xen AC_SUBST(XEN_RUN_DIR)
@@ -68,7 +63,7 @@ AC_SUBST(XEN_LIB_STORED) SHAREDIR=$prefix/share AC_SUBST(SHAREDIR) -PRIVATE_PREFIX=$LIBDIR/xen +PRIVATE_PREFIX=`eval echo $libdir` AC_SUBST(PRIVATE_PREFIX) case "$host_os" in
m4/xenstored.m4 +4 -4
@@ -6,10 +6,10 @@ AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [ AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [ xenstore="oxenstored" - xenstored=$SBINDIR/oxenstored + xenstored=$sbindir/oxenstored AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [ xenstore="xenstored" - xenstored=$SBINDIR/xenstored + xenstored=$sbindir/xenstored ]) ])
@@ -29,11 +29,11 @@ AC_ARG_WITH([xenstored], [ AS_IF([test "x$withval" = "xxenstored"], [ xenstore=$withval - xenstored=$SBINDIR/xenstored + xenstored=$sbindir/xenstored ]) AS_IF([test "x$withval" = "xoxenstored"], [ xenstore=$withval - xenstored=$SBINDIR/oxenstored + xenstored=$sbindir/oxenstored AX_XEN_OCAML_XENSTORE_CHECK() ]) AS_IF([test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"], [
tools/hotplug/Linux/init.d/sysconfig.xencommons.in +2 -2
@@ -14,8 +14,8 @@ # the XENSTORED variable there. # # This can be either of: -# * @SBINDIR@/oxenstored -# * @SBINDIR@/xenstored +# * @sbindir@/oxenstored +# * @sbindir@/xenstored # # Changing this requires a reboot to take effect. #XENSTORED=@XENSTORED@
tools/hotplug/Linux/systemd/xen-watchdog.service.in +1 -1
@@ -6,7 +6,7 @@ ConditionVirtualization=xen [Service] Type=forking -ExecStart=@SBINDIR@/xenwatchdogd 30 15 +ExecStart=@sbindir@/xenwatchdogd 30 15 KillSignal=USR1 [Install]
tools/hotplug/Linux/systemd/xenconsoled.service.in +1 -1
@@ -14,7 +14,7 @@ EnvironmentFile=-/etc/sysconfig/xenconsoled PIDFile=@XEN_RUN_DIR@/xenconsoled.pid ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR} -ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS +ExecStart=@sbindir@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS [Install] WantedBy=multi-user.target
tools/hotplug/Linux/systemd/xenstored.service.in +2 -2
@@ -17,8 +17,8 @@ ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb* ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@ ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS" -ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/name" "Domain-0" -ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/domid" 0 +ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/name" "Domain-0" +ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/domid" 0 [Install] WantedBy=multi-user.target
PATCH v5 12/28 Use configure --mandir=DIR to set MANDIR
In reply to Olaf HeringAlso move common MAN8DIR and MAN1DIR to Paths.mk.in
--- Config.mk | 1 - config/Paths.mk.in | 3 +++ config/StdGNU.mk | 3 --- config/SunOS.mk | 3 --- 4 files changed, 3 insertions(+), 7 deletions(-)
Config.mk +0 -1
@@ -59,7 +59,6 @@ include $(XEN_ROOT)/config/$(XEN_OS).mk include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk DOCDIR ?= $(SHAREDIR)/doc/xen -MANDIR ?= $(SHAREDIR)/man BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d # arguments: variable, common path part, path to test, if yes, if no
config/Paths.mk.in +3 -0
@@ -34,6 +34,9 @@ BINDIR := $(bindir) LIBEXEC := @LIBEXEC@ SHAREDIR := @SHAREDIR@ +MANDIR := $(mandir) +MAN1DIR := $(MANDIR)/man1 +MAN8DIR := $(MANDIR)/man8 LIBDIR := $(libdir) XEN_RUN_DIR := @XEN_RUN_DIR@
config/StdGNU.mk +0 -3
@@ -29,9 +29,6 @@ INSTALL_PROG = $(INSTALL) -m0755 -p PREFIX ?= /usr INCLUDEDIR = $(PREFIX)/include -MANDIR = $(SHAREDIR)/man -MAN1DIR = $(MANDIR)/man1 -MAN8DIR = $(MANDIR)/man8 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
config/SunOS.mk +0 -3
@@ -21,9 +21,6 @@ INSTALL_PROG = $(INSTALL) -m0755 -p PREFIX ?= /usr INCLUDEDIR = $(PREFIX)/include -MANDIR = $(PREFIX)/share/man -MAN1DIR = $(MANDIR)/man1 -MAN8DIR = $(MANDIR)/man8 BOOT_DIR ?= /boot
PATCH v5 13/28 Use configure --docdir=DIR to set DOCDIR
In reply to Olaf Hering--- Config.mk | 1 - config/Paths.mk.in | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
Config.mk +0 -1
@@ -58,7 +58,6 @@ endif include $(XEN_ROOT)/config/$(XEN_OS).mk include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk -DOCDIR ?= $(SHAREDIR)/doc/xen BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d # arguments: variable, common path part, path to test, if yes, if no
config/Paths.mk.in +1 -0
@@ -38,6 +38,7 @@ MANDIR := $(mandir) MAN1DIR := $(MANDIR)/man1 MAN8DIR := $(MANDIR)/man8 LIBDIR := $(libdir) +DOCDIR := $(docdir) XEN_RUN_DIR := @XEN_RUN_DIR@ XEN_LOG_DIR := @XEN_LOG_DIR@
PATCH v5 14/28 Use configure --includedir=DIR to set INCLUDEDIR
In reply to Olaf Hering--- config/Paths.mk.in | 1 + config/StdGNU.mk | 1 - config/SunOS.mk | 1 - 3 files changed, 1 insertion(+), 2 deletions(-)
config/Paths.mk.in +1 -0
@@ -33,6 +33,7 @@ SBINDIR := $(sbindir) BINDIR := $(bindir) LIBEXEC := @LIBEXEC@ +INCLUDEDIR := $(includedir) SHAREDIR := @SHAREDIR@ MANDIR := $(mandir) MAN1DIR := $(MANDIR)/man1
config/StdGNU.mk +0 -1
@@ -28,7 +28,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p PREFIX ?= /usr -INCLUDEDIR = $(PREFIX)/include SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
config/SunOS.mk +0 -1
@@ -20,7 +20,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p PREFIX ?= /usr -INCLUDEDIR = $(PREFIX)/include BOOT_DIR ?= /boot
PATCH v5 15/28 Use configure --libexecdir=BASEDIR to set LIBEXEC
In reply to Olaf HeringThe current usage of LIBEXEC is bogus. It describes the directory for private xen executables. Other places create their own, similar libexecdir path as $prefix/lib/xen/*.
Additional two other variables are used to describe similar paths:PRIVATE_BINDIR and PRIVATE_PREFIX
The autoconf documentation refers to libexec as a directory for executables and stuff which is called by other programs, not by the user.
Adjust all places that want libexecdir as a target path. LIBEXEC refers now to the base directory. Three convenience variables are used to refer to paths to private binaries, libs and include files.
In the systemd files LIBEXEC_BIN is substituted, so this variable has to be present in autoconf. All other variables are expanded in Paths.mk because they are only used in Makefiles.
Most users of LIBEXEC are updated to use LIBEXEC_BIN because that is what they want.
Users of PRIVATE_BINDIR are updated to use LIBEXEC_BIN because that is what they want. PRIVATE_BINDIR and PRIVATE_PREFIX usage is removed by this patch, in favour of LIBXEC_BIN and LIBEXEC
An internal libxl function was removed. A single helper to retrieve LIBEXEC_BIN remains.
As suggested by the autoconf documentation, configure appends the package name to LIBEXEC to make sure the provided directory really refers to xen. This makes sure "make uninstall" preserves the real libexecdir.
Please rerun autogen.sh after applying this patch.
--- Config.mk | 2 +- config/Paths.mk.in | 8 +++--- m4/paths.m4 | 31 ++++++++++------------ stubdom/Makefile | 6 ++--- tools/Makefile | 11 ++++---- tools/console/Makefile | 4 +-- tools/hotplug/FreeBSD/rc.d/xencommons.in | 2 +- tools/hotplug/FreeBSD/vif-bridge | 2 +- tools/hotplug/Linux/Makefile | 4 +-- tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 2 +- tools/hotplug/Linux/init.d/xencommons.in.in | 4 +-- tools/hotplug/Linux/init.d/xendomains.in | 12 ++++----- .../systemd/xen-qemu-dom0-disk-backend.service.in | 2 +- tools/hotplug/Linux/systemd/xendomains.service.in | 6 ++--- tools/hotplug/Linux/xen-hotplug-common.sh.in | 2 +- tools/hotplug/NetBSD/block | 2 +- tools/hotplug/NetBSD/rc.d/xencommons | 2 +- tools/hotplug/NetBSD/vif-bridge | 2 +- tools/hotplug/NetBSD/vif-ip | 2 +- tools/libxl/Makefile | 6 ++--- tools/libxl/libxl_dm.c | 4 +-- tools/libxl/libxl_internal.h | 1 - tools/libxl/libxl_paths.c | 7 +---- tools/libxl/libxl_save_callout.c | 2 +- tools/misc/Makefile | 4 +-- tools/pygrub/Makefile | 8 +++--- tools/vtpmmgr/Makefile | 6 ++--- tools/xcutils/Makefile | 4 +-- tools/xenpaging/Makefile | 4 +-- tools/xentrace/Makefile | 4 +-- 30 files changed, 73 insertions(+), 83 deletions(-)
Config.mk +1 -1
@@ -162,7 +162,7 @@ define move-if-changed if ! cmp -s $(1) $(2); then mv -f $(1) $(2); else rm -f $(1); fi endef -BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR \ +BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBEXEC_BIN LIBDIR SHAREDIR \ XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \ XEN_RUN_DIR XEN_PAGING_DIR
config/Paths.mk.in +4 -4
@@ -31,7 +31,10 @@ sysconfdir := @sysconfdir@ SBINDIR := $(sbindir) BINDIR := $(bindir) -LIBEXEC := @LIBEXEC@ +LIBEXEC := $(libexecdir)/$(PACKAGE_TARNAME) +LIBEXEC_BIN := @LIBEXEC_BIN@ +LIBEXEC_LIB := $(LIBEXEC)/lib +LIBEXEC_INC := $(LIBEXEC)/include INCLUDEDIR := $(includedir) SHAREDIR := @SHAREDIR@
@@ -50,9 +53,6 @@ INITD_DIR := @INITD_DIR@ XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@ -PRIVATE_PREFIX := @PRIVATE_PREFIX@ -PRIVATE_BINDIR := @PRIVATE_BINDIR@ - XENFIRMWAREDIR := @XENFIRMWAREDIR@ XEN_CONFIG_DIR := @XEN_CONFIG_DIR@
m4/paths.m4 +14 -17
@@ -43,13 +43,20 @@ AC_ARG_WITH([initddir], ;; esac]) -dnl XXX: this should be changed to use the passed $libexec -dnl but can be done as a second step -case "$host_os" in -*netbsd*) LIBEXEC=$prefix/libexec ;; -*) LIBEXEC=$prefix/lib/xen/bin ;; -esac -AC_SUBST(LIBEXEC) +if test "$libexecdir" = '${exec_prefix}/libexec' ; then + case "$host_os" in + *netbsd*) ;; + *) + libexecdir='${exec_prefix}/lib' + ;; + esac +fi +dnl expand exec_prefix or it will endup in substituted variables +libexecdir=`eval echo $libexecdir` +dnl autoconf doc suggest to use a "package name" subdir +dnl This variable will be substituted in various .in files +LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin` +AC_SUBST(LIBEXEC_BIN) XEN_RUN_DIR=/var/run/xen AC_SUBST(XEN_RUN_DIR)
@@ -63,16 +70,6 @@ AC_SUBST(XEN_LIB_STORED) SHAREDIR=$prefix/share AC_SUBST(SHAREDIR) -PRIVATE_PREFIX=`eval echo $libdir` -AC_SUBST(PRIVATE_PREFIX) - -case "$host_os" in -*freebsd*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;; -*netbsd*) PRIVATE_BINDIR=$BINDIR ;; -*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;; -esac -AC_SUBST(PRIVATE_BINDIR) - XENFIRMWAREDIR=$prefix/lib/xen/boot AC_SUBST(XENFIRMWAREDIR)
stubdom/Makefile +3 -3
@@ -462,9 +462,9 @@ install-readme: $(INSTALL_DATA) README $(DESTDIR)$(DOCDIR)/README.stubdom install-ioemu: ioemu-stubdom - $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)" - $(INSTALL_PROG) stubdom-dm "$(DESTDIR)$(LIBEXEC)" - $(INSTALL_DATA) stubdompath.sh "$(DESTDIR)$(LIBEXEC)" + $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)" + $(INSTALL_PROG) stubdom-dm "$(DESTDIR)$(LIBEXEC_BIN)" + $(INSTALL_DATA) stubdompath.sh "$(DESTDIR)$(LIBEXEC_BIN)" $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)" $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
tools/Makefile +5 -6
@@ -94,8 +94,7 @@ uninstall: rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest* rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil* rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub - rm -rf $(D)$(LIBDIR)/xen/ - rm -rf $(D)$(LIBEXEC)/xen* + rm -rf $(D)$(LIBEXEC) rm -rf $(D)$(SBINDIR)/setmask rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm rm -rf $(D)$(SHAREDIR)/doc/xen
@@ -196,9 +195,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find cd qemu-xen-dir; \ $$source/configure --enable-xen --target-list=i386-softmmu \ $(QEMU_XEN_ENABLE_DEBUG) \ - --prefix=$(PREFIX)/lib/xen \ - --libdir=$(PREFIX)/lib/xen/lib \ - --includedir=$(PREFIX)/lib/xen/include \ + --prefix=$(LIBEXEC) \ + --libdir=$(LIBEXEC_LIB) \ + --includedir=$(LIBEXEC_INC) \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \ -I$(XEN_ROOT)/tools/libxc/include \
@@ -208,7 +207,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \ -L$(XEN_ROOT)/tools/xenstore \ -Wl,-rpath=$(PREFIX)/lib/xen/lib" \ - --bindir=$(LIBEXEC) \ + --bindir=$(LIBEXEC_BIN) \ --datadir=$(SHAREDIR)/qemu-xen \ --localstatedir=/var \ --disable-kvm \
tools/console/Makefile +2 -2
@@ -32,7 +32,7 @@ xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c)) install: $(BIN) $(INSTALL_DIR) $(DESTDIR)/$(SBINDIR) $(INSTALL_PROG) xenconsoled $(DESTDIR)/$(SBINDIR) - $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) - $(INSTALL_PROG) xenconsole $(DESTDIR)$(PRIVATE_BINDIR) + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) xenconsole $(DESTDIR)$(LIBEXEC_BIN) -include $(DEPS)
tools/hotplug/FreeBSD/rc.d/xencommons.in +1 -1
@@ -65,7 +65,7 @@ xen_startcmd() printf "\n" printf "Setting domain 0 name, domid and JSON config...\n" - ${PRIVATE_BINDIR}/xen-init-dom0 + ${LIBEXEC_BIN}/xen-init-dom0 } xen_stop()
tools/hotplug/FreeBSD/vif-bridge +1 -1
@@ -13,7 +13,7 @@ DIR=$(dirname "$0") . "${DIR}/hotplugpath.sh" -PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin +PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin export PATH path=$1
tools/hotplug/Linux/Makefile +2 -2
@@ -56,8 +56,8 @@ install: all install-initd install-scripts install-udev subdirs-install install-initd: all [ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR) [ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR) - [ -d $(DESTDIR)$(LIBEXEC) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC) - $(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC) + [ -d $(DESTDIR)$(LIBEXEC_BIN) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC_BIN) $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR) $(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
tools/hotplug/Linux/init.d/sysconfig.xencommons.in +1 -1
@@ -39,4 +39,4 @@ #XENBACKENDD_DEBUG=[yes|on|1] # qemu path -#QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386 +#QEMU_XEN=@LIBEXEC_BIN@/qemu-system-i386
tools/hotplug/Linux/init.d/xencommons.in.in +2 -2
@@ -92,14 +92,14 @@ do_start () { fi echo Setting domain 0 name, domid and JSON config... - ${PRIVATE_BINDIR}/xen-init-dom0 + ${LIBEXEC_BIN}/xen-init-dom0 fi echo Starting xenconsoled... test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE" ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS echo Starting QEMU as disk backend for dom0 - test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386" + test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386" $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \ -pidfile $QEMU_PIDFILE
tools/hotplug/Linux/init.d/xendomains.in +6 -6
@@ -20,7 +20,7 @@ # Short-Description: Wrapper to start/stop secondary xen domains # Description: Wrapper for starting / stopping domains automatically # when domain 0 boots / shuts down on systems using init. -# The $LIBEXEC/xendomains helper is shared between init and +# The $LIBEXEC_BIN/xendomains helper is shared between init and # systemd systems. ### END INIT INFO
@@ -28,19 +28,19 @@ case "$1" in start) - $LIBEXEC/xendomains start + $LIBEXEC_BIN/xendomains start ;; stop) - $LIBEXEC/xendomains stop + $LIBEXEC_BIN/xendomains stop ;; restart) - $LIBEXEC/xendomains restart + $LIBEXEC_BIN/xendomains restart ;; reload) - $LIBEXEC/xendomains reload + $LIBEXEC_BIN/xendomains reload ;; status) - $LIBEXEC/xendomains status + $LIBEXEC_BIN/xendomains status ;; *) echo "Usage: $0 {start|stop|restart|reload|status}"
tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in +1 -1
@@ -13,7 +13,7 @@ EnvironmentFile=-/etc/sysconfig/xenstored PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities ExecStartPre=/bin/mkdir -p /var/run/xen -ExecStart=@LIBEXEC@/qemu-system-i386 -xen-domid 0 \ +ExecStart=@LIBEXEC_BIN@/qemu-system-i386 -xen-domid 0 \ -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \ -pidfile @XEN_RUN_DIR@/qemu-dom0.pid
tools/hotplug/Linux/systemd/xendomains.service.in +3 -3
@@ -8,9 +8,9 @@ ConditionVirtualization=xen Type=oneshot RemainAfterExit=true ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities -ExecStart=-@LIBEXEC@/xendomains start -ExecStop=@LIBEXEC@/xendomains stop -ExecReload=@LIBEXEC@/xendomains restart +ExecStart=-@LIBEXEC_BIN@/xendomains start +ExecStop=@LIBEXEC_BIN@/xendomains stop +ExecReload=@LIBEXEC_BIN@/xendomains restart [Install] WantedBy=multi-user.target
tools/hotplug/Linux/xen-hotplug-common.sh.in +1 -1
@@ -30,7 +30,7 @@ dir=$(dirname "$0") exec 2>>/var/log/xen/xen-hotplug.log -export PATH="${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH" +export PATH="${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH" export LD_LIBRARY_PATH="${LIBDIR}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH" export LANG="POSIX" unset $(set | grep ^LC_ | cut -d= -f1)
tools/hotplug/NetBSD/block +1 -1
@@ -7,7 +7,7 @@ DIR=$(dirname "$0") . "${DIR}/hotplugpath.sh" -PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin +PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin export PATH error() {
tools/hotplug/NetBSD/rc.d/xencommons +1 -1
@@ -69,7 +69,7 @@ xen_startcmd() printf "\n" printf "Setting domain 0 name, domid and JSON config...\n" - ${PRIVATE_BINDIR}/xen-init-dom0 + ${LIBEXEC_BIN}/xen-init-dom0 } xen_stop()
tools/hotplug/NetBSD/vif-bridge +1 -1
@@ -7,7 +7,7 @@ DIR=$(dirname "$0") . "${DIR}/hotplugpath.sh" -PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin +PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin export PATH xpath=$1
tools/hotplug/NetBSD/vif-ip +1 -1
@@ -7,7 +7,7 @@ DIR=$(dirname "$0") . "${DIR}/hotplugpath.sh" -PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin +PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin export PATH xpath=$1
tools/libxl/Makefile +3 -3
@@ -254,10 +254,10 @@ install: all $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR) $(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR) - $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) $(INSTALL_PROG) xl $(DESTDIR)$(SBINDIR) - $(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(PRIVATE_BINDIR) - $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(PRIVATE_BINDIR) + $(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN) $(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR) $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenlight.so.$(MAJOR) $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenlight.so
tools/libxl/libxl_dm.c +2 -2
@@ -38,7 +38,7 @@ static const char *qemu_xen_path(libxl__gc *gc)#ifdef QEMU_XEN_PATH return QEMU_XEN_PATH ;#else -return libxl__abs_path (gc,"qemu-system-i386" ,libxl__libexec_path ()); +return libxl__abs_path (gc,"qemu-system-i386" ,libxl__private_bindir_path ());#endif }
@@ -73,7 +73,7 @@ const char *libxl__domain_device_model(libxl__gc *gc, }else {switch (info->device_model_version) {case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL : - dm =libxl__abs_path (gc,"qemu-dm" ,libxl__libexec_path ()); + dm =libxl__abs_path (gc,"qemu-dm" ,libxl__private_bindir_path ());break ;case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN : dm =qemu_xen_path (gc);
tools/libxl/libxl_internal.h +0 -1
@@ -2070,7 +2070,6 @@ _hidden int libxl__carefd_close(libxl__carefd*); _hidden int libxl__carefd_fd(const libxl__carefd*);/* common paths */ -_hidden const char *libxl__libexec_path(void); _hidden const char *libxl__private_bindir_path(void); _hidden const char *libxl__xenfirmwaredir_path(void); _hidden const char *libxl__xen_config_dir_path(void);
tools/libxl/libxl_paths.c +1 -6
@@ -15,14 +15,9 @@#include "libxl_osdeps.h" /* must come before any other headers */ #include "libxl_internal.h" -const char *libxl__libexec_path (void ) -{ -return LIBEXEC ; -} -const char *libxl__private_bindir_path (void ) { -return PRIVATE_BINDIR ; +return LIBEXEC_BIN ; }const char *libxl__xenfirmwaredir_path (void )
tools/libxl/libxl_save_callout.c +1 -1
@@ -174,7 +174,7 @@ static void run_helper(libxl__egc *egc, libxl__save_helper_state *shs, shs->stdout_what =GCSPRINTF ("domain %" PRIu32" save/restore helper" " stdout pipe" , domid); - *arg++ =getenv ("LIBXL_SAVE_HELPER" ) ?:PRIVATE_BINDIR "/" "libxl-save-helper" ; + *arg++ =getenv ("LIBXL_SAVE_HELPER" ) ?:LIBEXEC_BIN "/" "libxl-save-helper" ; *arg++ = mode_arg;const char **stream_fd_arg = arg++;for (i=0 ; i<num_argnums; i++)
tools/misc/Makefile +2 -2
@@ -45,10 +45,10 @@ build: $(TARGETS) install: build $(INSTALL_DIR) $(DESTDIR)$(BINDIR) $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) - $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) $(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR) $(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR) - $(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(PRIVATE_BINDIR) + $(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN) set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done .PHONY: clean
tools/pygrub/Makefile +4 -4
@@ -12,11 +12,11 @@ build: install: all CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \ $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \ - --install-scripts=$(PRIVATE_BINDIR) --force - set -e; if [ $(BINDIR) != $(PRIVATE_BINDIR) -a \ + --install-scripts=$(LIBEXEC_BIN) --force + set -e; if [ $(BINDIR) != $(LIBEXEC_BIN) -a \ "`readlink -f $(DESTDIR)/$(BINDIR)`" != \ - "`readlink -f $(PRIVATE_BINDIR)`" ]; then \ - ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR); \ + "`readlink -f $(LIBEXEC_BIN)`" ]; then \ + ln -sf $(LIBEXEC_BIN)/pygrub $(DESTDIR)/$(BINDIR); \ fi .PHONY: clean
tools/vtpmmgr/Makefile +3 -3
@@ -5,9 +5,9 @@ all: @true install: - $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)" - $(INSTALL_DATA) calc.pl "$(DESTDIR)$(LIBEXEC)" - $(INSTALL_DATA) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC)" + $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)" + $(INSTALL_DATA) calc.pl "$(DESTDIR)$(LIBEXEC_BIN)" + $(INSTALL_DATA) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC_BIN)" clean: @true
tools/xcutils/Makefile +2 -2
@@ -33,8 +33,8 @@ lsevtchn: lsevtchn.o .PHONY: install install: build - $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) - $(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(PRIVATE_BINDIR) + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(LIBEXEC_BIN) .PHONY: clean
tools/xenpaging/Makefile +2 -2
@@ -25,8 +25,8 @@ xenpaging: $(OBJS) install: all $(INSTALL_DIR) -m 0700 $(DESTDIR)$(XEN_PAGING_DIR) - $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC) - $(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC) + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC_BIN) clean: rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)
tools/xentrace/Makefile +2 -2
@@ -21,12 +21,12 @@ build: $(BIN) $(LIBBIN) .PHONY: install install: build $(INSTALL_DIR) $(DESTDIR)$(BINDIR) - [ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) + [ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) $(INSTALL_DIR) $(DESTDIR)$(MAN1DIR) $(INSTALL_DIR) $(DESTDIR)$(MAN8DIR) $(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR) $(INSTALL_PYTHON_PROG) $(SCRIPTS) $(DESTDIR)$(BINDIR) - [ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(PRIVATE_BINDIR) + [ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBEXEC_BIN) $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1DIR) $(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MAN8DIR)
Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
Quoted 2 lines · Olaf Hering
Most users of LIBEXEC are updated to use
LIBEXEC_BINbecause that is what they want.
This caused the qemu-dm binary to move from dist/install/usr/local/lib/xen/bin/qemu-dm has become dist/install/usr/local/lib/xen/qemu-dm, because you missed the hidden reliance on LIBEXEC inside the qemu-trad tree.
I propose that Ian J reviews and applies the following and I will fold the associated Config.mk change into this changeset.
I've done builds locally for both x86_32 and x86_64 and it has put qemu-dm back where it belongs...
Ian.
Quoted 1 line
From
6e0f43aa9d7af043347abe2ddbdf0e1eb0dbff0cMon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Mon, 6 Oct 2014 16:24:46 +0100
Subject: [PATCH] qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
The meaning of LIBEXEC in the Xen build system has been made to follow the more conventional meaning.
--- xen-config.mak | 2 +- xen-setup-stubdom | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
xen-config.mak +1 -1
@@ -9,4 +9,4 @@ CONFIG_SOFTMMU=yes CFLAGS += -I$(QEMU_ROOT)/hw -bindir = ${LIBEXEC} +bindir = ${LIBEXEC_BIN}
xen-setup-stubdom +1 -2
@@ -22,7 +22,7 @@ TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM -D__XEN_TOOLS__ TARGET_CFLAGS= $TARGET_CFLAGS TARGET_LDFLAGS= $TARGET_LDFLAGS -bindir = \${LIBEXEC} +bindir = \${LIBEXEC_BIN} END mv -f $target/config.mak.new $target/config.mak
#----------
Signature · 1 line
1.7.10.4
PATCH 1/1 QEMU_TAG update FOR FOLDING INTO LIBEXEC PATCH
** do not apply on its own **
--- Config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Config.mk +3 -3
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5 ETHERBOOT_NICS ?= rtl8139 8086100e -QEMU_TRADITIONAL_REVISION ?= 58fac0693d8ad591add917e939011fe069720b0c -# Fri Aug 1 16:32:18 2014 +0100 -# qemu-xen-trad: -I tools/libxc/include and tools/xenstore/include +QEMU_TRADITIONAL_REVISION ?= b0d42741f8e9a00854c3b3faca1da84bfc69bf22 +# Mon Oct 6 16:24:46 2014 +0100 +# qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC) # Specify which qemu-dm to use. This may be `ioemu' to use the old # Mercurial in-tree version, or a local directory, or a git URL.
Signature · 1 line
1.7.10.4
Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
In reply to Ian CampbellQuoted 8 lines · Ian Campbell
Quoted 2 lines · Olaf Hering
Most users of LIBEXEC are updated to use
LIBEXEC_BINbecause that is what they want.This caused the qemu-dm binary to move from dist/install/usr/local/lib/xen/bin/qemu-dm has become dist/install/usr/local/lib/xen/qemu-dm, because you missed the hidden reliance on LIBEXEC inside the qemu-trad tree.
Hmm, git grep does not curse into subtrees. Perhaps the proper fix would be to pass --bindir to qemu-trad? I will have a look.
Olaf
PATCH v5 16/28 Use configure --prefix=DIR to set PREFIX
In reply to Olaf HeringPREFIX is set by configure --prefix=DIR, nothing outside tools,docs,stubdom is using this variable.
--- config/StdGNU.mk | 2 -- config/SunOS.mk | 2 -- 2 files changed, 4 deletions(-)
config/StdGNU.mk +0 -2
@@ -27,8 +27,6 @@ INSTALL_DIR = $(INSTALL) -d -m0755 -p INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p -PREFIX ?= /usr - SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) BOOT_DIR ?= /boot
config/SunOS.mk +0 -2
@@ -19,8 +19,6 @@ INSTALL_DIR = $(INSTALL) -d -m0755 -p INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p -PREFIX ?= /usr - BOOT_DIR ?= /boot SunOS_LIBDIR = /usr/sfw/lib
PATCH v5 17/28 Use configure --localstatedir=BASEDIR to set path to /var
In reply to Olaf HeringThis is helpful to test make uninstall with --prefix=/private/dir as unprivileged user. No change in behaviour is expected by this change.
Please rerun autogen.sh after applying this patch.
--- m4/paths.m4 | 24 ++++++++++++++++-------- tools/Makefile | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-)
m4/paths.m4 +16 -8
@@ -2,6 +2,14 @@ AC_DEFUN([AX_XEN_EXPAND_CONFIG], [ dnl expand these early so we can use this for substitutions test "x$prefix" = "xNONE" && prefix=$ac_default_prefix test "x$exec_prefix" = "xNONE" && exec_prefix=${prefix} + +dnl Use /var instead of /usr/local/var because there can be only one +dnl xenstored active at a time. All tools have to share this dir, even +dnl if they come from a different --prefix=. +if test "$localstatedir" = '${prefix}/var' ; then + localstatedir=/var +fi + dnl expand exec_prefix or it will endup in substituted variables bindir=`eval echo $bindir` sbindir=`eval echo $sbindir`
@@ -58,13 +66,13 @@ dnl This variable will be substituted in various .in files LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin` AC_SUBST(LIBEXEC_BIN) -XEN_RUN_DIR=/var/run/xen +XEN_RUN_DIR=$localstatedir/run/xen AC_SUBST(XEN_RUN_DIR) -XEN_LOG_DIR=/var/log/xen +XEN_LOG_DIR=$localstatedir/log/xen AC_SUBST(XEN_LOG_DIR) -XEN_LIB_STORED=/var/lib/xenstored +XEN_LIB_STORED=$localstatedir/lib/xenstored AC_SUBST(XEN_LIB_STORED) SHAREDIR=$prefix/share
@@ -86,15 +94,15 @@ XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts AC_SUBST(XEN_SCRIPT_DIR) case "$host_os" in -*freebsd*) XEN_LOCK_DIR=/var/lib ;; -*netbsd*) XEN_LOCK_DIR=/var/lib ;; -*) XEN_LOCK_DIR=/var/lock ;; +*freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;; +*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;; +*) XEN_LOCK_DIR=$localstatedir/lock ;; esac AC_SUBST(XEN_LOCK_DIR) -XEN_RUN_DIR=/var/run/xen +XEN_RUN_DIR=$localstatedir/run/xen AC_SUBST(XEN_RUN_DIR) -XEN_PAGING_DIR=/var/lib/xen/xenpaging +XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging AC_SUBST(XEN_PAGING_DIR) ])
tools/Makefile +1 -1
@@ -209,7 +209,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find -Wl,-rpath=$(PREFIX)/lib/xen/lib" \ --bindir=$(LIBEXEC_BIN) \ --datadir=$(SHAREDIR)/qemu-xen \ - --localstatedir=/var \ + --localstatedir=$(localstatedir) \ --disable-kvm \ --disable-docs \ --disable-guest-agent \
PATCH v5 18/28 Add configure --enable-rpath
In reply to Olaf HeringThis fixes the tools when xen is configured with --prefix=/odd/path
Please rerun autogen.sh after applying this patch.
--- Config.mk | 3 +++ config/Tools.mk.in | 1 + tools/Makefile | 16 ++++++++++++++-- tools/configure.ac | 1 + 4 files changed, 19 insertions(+), 2 deletions(-)
Config.mk +3 -0
@@ -208,6 +208,9 @@ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i)) LDFLAGS += $(foreach i, $(PREPEND_LIB), -L$(i)) CFLAGS += $(foreach i, $(PREPEND_INCLUDES), -I$(i)) +ifeq ($(XEN_TOOLS_RPATH),y) +LDFLAGS += -Wl,-rpath,$(LIBDIR) +endif APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i)) APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
config/Tools.mk.in +1 -0
@@ -45,6 +45,7 @@ PTYFUNCS_LIBS := @PTYFUNCS_LIBS@ LIBNL3_LIBS := @LIBNL3_LIBS@ LIBNL3_CFLAGS := @LIBNL3_CFLAGS@ +XEN_TOOLS_RPATH := @rpath@ # Download GIT repositories via HTTP or GIT's own protocol? # GIT's protocol is faster and more robust, when it works at all (firewalls
tools/Makefile +14 -2
@@ -118,6 +118,14 @@ IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \ --interp-prefix=$(CROSS_SYS_ROOT) endif +ifeq ($(XEN_TOOLS_RPATH),y) +QEMU_UPSTREAM_RPATH := -Wl,-rpath,$(LIBEXEC_LIB):$(LIBDIR) +IOEMU_EXTRA_LDFLAGS := --extra-ldflags="-Wl,-rpath,$(LIBDIR)" +else +QEMU_UPSTREAM_RPATH := -Wl,-rpath,$(LIBEXEC_LIB) +IOEMU_EXTRA_LDFLAGS := +endif + QEMU_ROOT := $(shell if [ -d "$(QEMU_TRADITIONAL_LOC)" ]; then echo "$(QEMU_TRADITIONAL_LOC)"; else echo .; fi) ifneq ($(QEMU_ROOT),.) export QEMU_ROOT
@@ -153,7 +161,10 @@ subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find set -e; \ $(buildmakevars2shellvars); \ cd qemu-xen-traditional-dir; \ - $(QEMU_ROOT)/xen-setup --cpu=$(IOEMU_CPU_ARCH) $(IOEMU_CONFIGURE_CROSS); \ + $(QEMU_ROOT)/xen-setup \ + $(IOEMU_EXTRA_LDFLAGS) \ + --cpu=$(IOEMU_CPU_ARCH) \ + $(IOEMU_CONFIGURE_CROSS); \ $(MAKE) all subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -162,6 +173,7 @@ subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find cd qemu-xen-traditional-dir; \ $(QEMU_ROOT)/xen-setup \ --extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ + $(IOEMU_EXTRA_LDFLAGS) \ --cpu=$(IOEMU_CPU_ARCH) \ $(IOEMU_CONFIGURE_CROSS); \ $(MAKE) install
@@ -206,7 +218,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find $(EXTRA_CFLAGS_QEMU_XEN)" \ --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \ -L$(XEN_ROOT)/tools/xenstore \ - -Wl,-rpath=$(PREFIX)/lib/xen/lib" \ + $(QEMU_UPSTREAM_RPATH)" \ --bindir=$(LIBEXEC_BIN) \ --datadir=$(SHAREDIR)/qemu-xen \ --localstatedir=$(localstatedir) \
tools/configure.ac +1 -0
@@ -80,6 +80,7 @@ m4_include([../m4/systemd.m4]) AX_XEN_EXPAND_CONFIG() # Enable/disable options +AX_ARG_DEFAULT_DISABLE([rpath], [Build tools with -Wl,-rpath,LIBDIR]) AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP]) AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools]) AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
PATCH v5 19/28 Add configure --with-linux-backend-modules="mod1 mod2"
In reply to Olaf HeringThis replaces config/Linux.modules with a configure option. As a result of this change only a single xencomons.in is required, instead of a xencomons.in.in and sed hackery.
After this change blktap2 and blktap will be loaded at the same time. This is already done in out-of-tree xencommons scripts, and systemd will load both modules as well. No harm is expected by loading both modules.
Please rerun autogen.sh after applying this patch.
---
README | 12 --------
config/Linux.modules | 20 ------------
config/Tools.mk.in | 2 ++
tools/configure.ac | 34 +++++++++++++++++++-
tools/hotplug/Linux/Makefile | 14 +++------
.../init.d/{xencommons.in.in => xencommons.in} | 5 ++-
tools/hotplug/Linux/systemd/Makefile | 34 ++++----------------
tools/hotplug/Linux/update-modules.sh | 36 ----------------------
8 files changed, 49 insertions(+), 108 deletions(-)README +0 -12
@@ -235,15 +235,3 @@ There are optional targets as part of Xen's top-level makefile that will download and build tboot: install-tboot, build-tboot, dist-tboot, clean-tboot. These will download the latest tar file from the SourceForge site using wget, then build/install/dist according to Xen's settings. - -Required Kernel modules -====================== - -Xen has a set of Kernel modules which the init scripts ensure to load before -before starting Xen guests. The list of modules are maintained in one place: - - * config/$(XEN_OS).modules - -For more details refer to: - -http://wiki.xen.org/wiki/Category:Host_Configuration#Kernel_modules
config/Linux.modules deleted +0 -20
@@ -1,20 +0,0 @@ -# The file supports a simple language, comments are ignored, and if you there -# are module replacements this can be listed by using a pipe to show preference -# for the first module, followed by the older module. - -xen-evtchn -xen-gntdev -xen-gntalloc -xen-blkback -xen-netback -xen-pciback -evtchn -gntdev -netbk -blkbk -xen-scsibk -usbbk -pciback -xen-acpi-processor -# Prefer to load blktap2 if found, otherwise load blktap -blktap2|blktap
config/Tools.mk.in +2 -0
@@ -74,6 +74,8 @@ SYSTEMD_LIBS := @SYSTEMD_LIBS@ XEN_SYSTEMD_DIR := @SYSTEMD_DIR@ XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@ +LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@ + #System options ZLIB := @zlib@ CONFIG_LIBICONV := @libiconv@
tools/configure.ac +33 -1
@@ -10,7 +10,7 @@ AC_CONFIG_FILES([ hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog -hotplug/Linux/init.d/xencommons.in +hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount
@@ -90,6 +90,38 @@ AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS]) AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools]) AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools]) +AC_ARG_WITH([linux-backend-modules], + AS_HELP_STRING([--with-linux-backend-modules="mod1 mod2"], + [List of Linux backend module or modalias names to be autoloaded on startup.]), + [LINUX_BACKEND_MODULES="$withval"], + [case "$host_os" in +*linux*) +LINUX_BACKEND_MODULES=" +xen-evtchn +xen-gntdev +xen-gntalloc +xen-blkback +xen-netback +xen-pciback +evtchn +gntdev +netbk +blkbk +xen-scsibk +usbbk +pciback +xen-acpi-processor +blktap2 +blktap +" +;; +*) +LINUX_BACKEND_MODULES= +;; +esac]) +LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`" +AC_SUBST(LINUX_BACKEND_MODULES) + dnl Enable blktap2 on Linux only. AC_ARG_ENABLE([blktap2], AS_HELP_STRING([--enable-blktap2],
tools/hotplug/Linux/Makefile +4 -10
@@ -37,23 +37,17 @@ UDEV_RULES_DIR = $(CONFIG_DIR)/udev UDEV_RULES = xen-backend.rules $(UDEV_RULES-y) .PHONY: all -all: $(XENCOMMONS_INITD) subdirs-all - -$(XENCOMMONS_INITD): $(XEN_ROOT)/config/$(XEN_OS).modules $(XENCOMMONS_INITD).in - $(XEN_ROOT)/tools/hotplug/Linux/update-modules.sh \ - $(XEN_ROOT) \ - $(XEN_OS) \ - $(XENCOMMONS_INITD) > $@ +all: subdirs-all .PHONY: build -build: all +build: .PHONY: install install: all install-initd install-scripts install-udev subdirs-install # See docs/misc/distro_mapping.txt for INITD_DIR location .PHONY: install-initd -install-initd: all +install-initd: [ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR) [ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR) [ -d $(DESTDIR)$(LIBEXEC_BIN) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
@@ -65,7 +59,7 @@ install-initd: all $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR) .PHONY: install-scripts -install-scripts: all +install-scripts: [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \ $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR) set -e; for i in $(XEN_SCRIPTS); \
tools/hotplug/Linux/init.d/xencommons.in renamed from tools/hotplug/Linux/init.d/xencommons.in.in +4 -1
@@ -19,6 +19,7 @@ ### END INIT INFO XENSTORED=@XENSTORED@ +BACKEND_MODULES="@LINUX_BACKEND_MODULES@" . @XEN_SCRIPT_DIR@/hotplugpath.sh
@@ -58,8 +59,10 @@ fi do_start () { local time=0 local timeout=30 + local mod + + for mod in $BACKEND_MODULES ; do modprobe "$mod" &>/dev/null ; done - @LOAD_MODULES@ mkdir -p ${XEN_RUN_DIR} mkdir -p ${XEN_LOCK_DIR}
tools/hotplug/Linux/systemd/Makefile +6 -28
@@ -38,31 +38,9 @@ install: $(ALL_XEN_SYSTEMD) $(INSTALL_DATA) *.mount $(DESTDIR)$(XEN_SYSTEMD_DIR) $(INSTALL_DATA) *.conf $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD) -$(XEN_SYSTEMD_MODULES): $(XEN_ROOT)/config/$(XEN_OS).modules - @set -e ; \ - IFS='' ;\ - cat $(XEN_ROOT)/config/$(XEN_OS).modules | ( \ - while read l ; do \ - if echo $${l} | egrep -q "^#" ; then \ - continue ;\ - fi ;\ - if echo "$${l}" | egrep -q "\|" ; then \ - m1=$${l%%|*} ;\ - m2=$${l#*|} ;\ - # Systemd modules-load.d lacks support ;\ - # for module replacement options, we ;\ - # need to add that support upstream but ;\ - # its best instead to ensure this file ;\ - # is no longer needed. Some folks ;\ - # however have reported issues with ;\ - # some modules automatically loading ;\ - # so we just load all necessary xen ;\ - # modules and for replacements we load ;\ - # the latest module ;\ - echo "$$m1" ;\ - echo "$$m2" ;\ - else \ - echo "$$l" ;\ - fi ;\ - done \ - ) > $@ +$(XEN_SYSTEMD_MODULES): + rm -f [email protected] + for mod in $(LINUX_BACKEND_MODULES) ; do \ + echo $$mod ; \ + done > [email protected] + $(call move-if-changed,[email protected],$@)
tools/hotplug/Linux/update-modules.sh deleted +0 -36
@@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -set -e - -IFS='' - -XEN_ROOT=$1 -XEN_OS=$2 -XENCOMMONS_INITD=$3 - -cat $XEN_ROOT/config/${XEN_OS}.modules | ( - while read l ; do - if echo $l | egrep -q "^#" ; then - continue - fi - if echo "$l" | egrep -q "\|" ; then - m1=${l%%|*} - m2=${l#*|} - echo " modprobe $m1 2>/dev/null || modprobe $m2 2>/dev/null" - else - echo " modprobe $l 2>/dev/null" - fi - done -) > ${XENCOMMONS_INITD}.modules - -cat ${XENCOMMONS_INITD}.in | ( - while read l ; do - if echo "$l" | egrep -q "@LOAD_MODULES@" ; then - cat ${XENCOMMONS_INITD}.modules - else - echo $l - fi - done -) - -rm -f ${XENCOMMONS_INITD}.modules
PATCH v5 20/28 Move variable to set bash_completion.d to Paths.mk
In reply to Olaf Hering--- Config.mk | 2 -- config/Paths.mk.in | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)
Config.mk +0 -2
@@ -58,8 +58,6 @@ endif include $(XEN_ROOT)/config/$(XEN_OS).mk include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk -BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d - # arguments: variable, common path part, path to test, if yes, if no define setvar_dir ifndef $(1)
config/Paths.mk.in +1 -0
@@ -50,6 +50,7 @@ XEN_LIB_STORED := @XEN_LIB_STORED@ CONFIG_DIR := @CONFIG_DIR@ INITD_DIR := @INITD_DIR@ +BASH_COMPLETION_DIR := $(CONFIG_DIR)/bash_completion.d XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@
PATCH v5 21/28 Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
In reply to Olaf HeringSet CONFIG_LEAF_DIR with configure to give control if needed. The check for the correct value if the option is not specified is tricky. Since other packages (such as grub2) started to populate also /etc/default/ a given system may have both directories. Use "default" only if /etc/sysconfig does not exist. "sysconfig" remains the default.
Move the variable from StdGNU.mk to Linux.mk because thats the only place where it is used.
Please rerun autogen.sh after applying this patch.
--- Config.mk | 3 --- config/Linux.mk | 2 ++ config/Paths.mk.in | 1 + config/StdGNU.mk | 2 -- docs/misc/distro_mapping.txt | 4 ++-- m4/paths.m4 | 11 +++++++++++ 6 files changed, 16 insertions(+), 7 deletions(-)
Config.mk +0 -3
@@ -69,9 +69,6 @@ define setvar_dir endif endef -# See distro_mapping.txt for other options -$(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default)) - ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include EXTRA_LIB += $(EXTRA_PREFIX)/lib
config/Linux.mk +2 -0
@@ -1 +1,3 @@ include $(XEN_ROOT)/config/StdGNU.mk + +SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
config/Paths.mk.in +1 -0
@@ -50,6 +50,7 @@ XEN_LIB_STORED := @XEN_LIB_STORED@ CONFIG_DIR := @CONFIG_DIR@ INITD_DIR := @INITD_DIR@ +CONFIG_LEAF_DIR := @CONFIG_LEAF_DIR@ BASH_COMPLETION_DIR := $(CONFIG_DIR)/bash_completion.d XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@
config/StdGNU.mk +0 -2
@@ -27,8 +27,6 @@ INSTALL_DIR = $(INSTALL) -d -m0755 -p INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p -SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) - BOOT_DIR ?= /boot SOCKET_LIBS =
docs/misc/distro_mapping.txt +2 -2
@@ -14,8 +14,8 @@ scripts at run-time. If the Red Hat directory exists, it is used; otherwise the Debian one is used. The INITD_DIR path can be changed with configure --with-initddir=DIR. -The CONFIG_LEAF_DIR path can be changed by setting the variables in -the environment or your ".config" (which is included by Config.mk). +The CONFIG_LEAF_DIR name can be changed with configure +--with-sysconfig-leaf-dir=SUBDIR. To add support for new distributions that don't use the above locations, one must grep for the above elements and add appropriate checks.
m4/paths.m4 +11 -0
@@ -51,6 +51,17 @@ AC_ARG_WITH([initddir], ;; esac]) +AC_ARG_WITH([sysconfig-leaf-dir], + AS_HELP_STRING([--with-sysconfig-leaf-dir=SUBDIR], + [Name of subdirectory in /etc to store runtime options for runlevel + scripts and daemons such as xenstoerd. + This should be either "sysconfig" or "default". [sysconfig]]), + [config_leaf_dir=$withval], + [config_leaf_dir=sysconfig + if test ! -d /etc/sysconfig ; then config_leaf_dir=default ; fi]) +CONFIG_LEAF_DIR=$config_leaf_dir +AC_SUBST(CONFIG_LEAF_DIR) + if test "$libexecdir" = '${exec_prefix}/libexec' ; then case "$host_os" in *netbsd*) ;;
PATCH v5 22/28 Make XENFIRMWAREDIR a subdir of libexecdir
In reply to Olaf HeringPut the firmware files below libexecdir. This is essentially just a new name for the existing path. It has the benefit that it can be configured via --libexecdir= if required.
Please rerun autogen.sh after applying this patch.
--- config/Paths.mk.in | 2 +- m4/paths.m4 | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-)
config/Paths.mk.in +1 -1
@@ -55,7 +55,7 @@ BASH_COMPLETION_DIR := $(CONFIG_DIR)/bash_completion.d XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@ -XENFIRMWAREDIR := @XENFIRMWAREDIR@ +XENFIRMWAREDIR := $(LIBEXEC)/boot XEN_CONFIG_DIR := @XEN_CONFIG_DIR@ XEN_SCRIPT_DIR := @XEN_SCRIPT_DIR@
m4/paths.m4 +0 -3
@@ -89,9 +89,6 @@ AC_SUBST(XEN_LIB_STORED) SHAREDIR=$prefix/share AC_SUBST(SHAREDIR) -XENFIRMWAREDIR=$prefix/lib/xen/boot -AC_SUBST(XENFIRMWAREDIR) - CONFIG_DIR=$sysconfdir AC_SUBST(CONFIG_DIR)
PATCH v5 23/28 tools: remove private copies of includedir and libdir from libxenstat
In reply to Olaf HeringThey are wrong and unused.
--- tools/xenstat/libxenstat/Makefile | 4 ---- 1 file changed, 4 deletions(-)
tools/xenstat/libxenstat/Makefile +0 -4
@@ -15,10 +15,6 @@ XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -prefix=$(PREFIX) -includedir=$(prefix)/include -libdir=$(prefix)/lib - LDCONFIG=ldconfig MAKE_LINK=ln -sf
PATCH v5 24/28 Use Paths.mk for docs, stubdom and tools build
In reply to Olaf HeringPaths.mk contains just directories set by configure. Source this file first when building docs,stubdom or tools. Remove unused path variables from $subsystem.mk.
--- config/Docs.mk.in | 7 +------ config/Paths.mk.in | 2 ++ config/Stubdom.mk.in | 6 ------ config/Tools.mk.in | 9 ++------- tools/Rules.mk | 1 - 5 files changed, 5 insertions(+), 20 deletions(-)
config/Docs.mk.in +1 -6
@@ -1,9 +1,4 @@ -# Prefix and install folder -prefix := @prefix@ -PREFIX := $(prefix) -exec_prefix := @exec_prefix@ -libdir := @libdir@ -LIBDIR := $(libdir) +-include $(XEN_ROOT)/config/Paths.mk # Tools FIG2DEV := @FIG2DEV@
config/Paths.mk.in +2 -0
@@ -29,6 +29,8 @@ includedir := @includedir@ localstatedir := @localstatedir@ sysconfdir := @sysconfdir@ +PREFIX := $(prefix) + SBINDIR := $(sbindir) BINDIR := $(bindir) LIBEXEC := $(libexecdir)/$(PACKAGE_TARNAME)
config/Stubdom.mk.in +0 -6
@@ -1,10 +1,4 @@ -# Prefix and install folder -include $(XEN_ROOT)/config/Paths.mk -prefix := @prefix@ -PREFIX := $(prefix) -exec_prefix := @exec_prefix@ -libdir := @libdir@ -LIBDIR := $(libdir) # Path Programs CMAKE := @CMAKE@
config/Tools.mk.in +2 -7
@@ -1,15 +1,10 @@ +-include $(XEN_ROOT)/config/Paths.mk + CONFIG_RUMP := @CONFIG_RUMP@ ifeq ($(CONFIG_RUMP),y) XEN_OS := NetBSDRump endif -# Prefix and install folder -prefix := @prefix@ -PREFIX := $(prefix) -exec_prefix := @exec_prefix@ -libdir := @libdir@ -LIBDIR := $(libdir) - # A debug build of tools? debug := @debug@
tools/Rules.mk +0 -1
@@ -5,7 +5,6 @@ all: -include $(XEN_ROOT)/config/Tools.mk include $(XEN_ROOT)/Config.mk --include $(XEN_ROOT)/config/Paths.mk export _INSTALL := $(INSTALL) INSTALL = $(XEN_ROOT)/tools/cross-install
PATCH v5 25/28 tools: use XEN_LIB_STORED instead of /var/lib/xenstored
In reply to Olaf HeringRemove hardcoded /var/lib/xenstored instead of using the existing XEN_LIB_STORED variable.
Please rerun autogen.sh after applying this patch.
---
tools/configure.ac | 1 +
tools/hotplug/FreeBSD/rc.d/xencommons.in | 2 +-
tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 4 ++--
tools/hotplug/Linux/init.d/xencommons.in | 2 +-
tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} | 2 +-
tools/xenstore/Makefile | 3 ++-
tools/xenstore/xs_lib.c | 2 +-
7 files changed, 9 insertions(+), 7 deletions(-)tools/configure.ac +1 -0
@@ -25,6 +25,7 @@ hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains +hotplug/NetBSD/rc.d/xencommons ]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([../])
tools/hotplug/FreeBSD/rc.d/xencommons.in +1 -1
@@ -37,7 +37,7 @@ xen_startcmd() if test -z "$xenstored_pid"; then printf "Cleaning xenstore database.\n" if [ -z "${XENSTORED_ROOTDIR}" ]; then - XENSTORED_ROOTDIR="/var/lib/xenstored" + XENSTORED_ROOTDIR="@XEN_LIB_STORED@" fi rm -f ${XENSTORED_ROOTDIR}/tdb* >/dev/null 2>&1 printf "Starting xenservices: xenstored, xenconsoled."
tools/hotplug/Linux/init.d/sysconfig.xencommons.in +2 -2
@@ -27,10 +27,10 @@ #XENSTORED_TRACE=[yes|on|1] ## Type: string -## Default: "/var/lib/xenstored" +## Default: "@XEN_LIB_STORED@" # # Running xenstored on XENSTORED_ROOTDIR -#XENSTORED_ROOTDIR=/var/lib/xenstored +#XENSTORED_ROOTDIR=@XEN_LIB_STORED@ ## Type: string ## Default: Not defined, xenbackendd debug mode off
tools/hotplug/Linux/init.d/xencommons.in +1 -1
@@ -68,7 +68,7 @@ do_start () { if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` then - test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored" + test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="@XEN_LIB_STORED@" rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
tools/hotplug/NetBSD/rc.d/xencommons.in renamed from tools/hotplug/NetBSD/rc.d/xencommons +1 -1
@@ -41,7 +41,7 @@ xen_startcmd() if test -z "$xenstored_pid"; then printf "Cleaning xenstore database.\n" if [ -z "${XENSTORED_ROOTDIR}" ]; then - XENSTORED_ROOTDIR="/var/lib/xenstored" + XENSTORED_ROOTDIR="@XEN_LIB_STORED@" fi rm -f ${XENSTORED_ROOTDIR}/tdb* >/dev/null 2>&1 printf "Starting xenservices: xenstored, xenconsoled."
tools/xenstore/Makefile +2 -1
@@ -9,6 +9,7 @@ CFLAGS += -I. CFLAGS += -I$(XEN_ROOT)/tools/ CFLAGS += -I./include CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\"" CFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_CFLAGS) LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
@@ -129,7 +130,7 @@ install: all $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR) $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat ifeq ($(XENSTORE_XENSTORED),y) - $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored + $(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED) $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR) endif $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
tools/xenstore/xs_lib.c +1 -1
@@ -30,7 +30,7 @@const char *xs_daemon_rootdir (void ) {char *s =getenv ("XENSTORED_ROOTDIR" ); -return (s ? s :"/var/lib/xenstored" ); +return (s ? s :XEN_LIB_STORED ); }const char *xs_daemon_rundir (void )
PATCH v5 26/28 tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen
In reply to Olaf HeringAlso remove duplicate XEN_RUN_DIR from m4/paths.m4.
Please rerun autogen.sh after applying this patch.
--- m4/paths.m4 | 3 --- tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-)
m4/paths.m4 +0 -3
@@ -108,9 +108,6 @@ case "$host_os" in esac AC_SUBST(XEN_LOCK_DIR) -XEN_RUN_DIR=$localstatedir/run/xen -AC_SUBST(XEN_RUN_DIR) - XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging AC_SUBST(XEN_PAGING_DIR) ])
tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in +1 -1
@@ -12,7 +12,7 @@ EnvironmentFile=-/etc/default/xenstored EnvironmentFile=-/etc/sysconfig/xenstored PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities -ExecStartPre=/bin/mkdir -p /var/run/xen +ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@ ExecStart=@LIBEXEC_BIN@/qemu-system-i386 -xen-domid 0 \ -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \
PATCH v5 27/28 move vtpmmgr helpers from tools to stubdom
In reply to Olaf HeringTools.mk contains a dead CONFIG_VTPM, @vtpm@ is never expanded because @vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts to stubdom/vtpmmgr and install them as executeable. This was introduced by the recent commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
add example control tools")
Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently) not used by make itself.
---
config/Stubdom.mk.in | 1 -
config/Tools.mk.in | 1 -
stubdom/vtpmmgr/Makefile | 5 +++++
{tools => stubdom}/vtpmmgr/calc.pl | 0
{tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl | 0
tools/Makefile | 1 -
tools/vtpmmgr/Makefile | 15 ---------------
7 files changed, 5 insertions(+), 18 deletions(-)config/Stubdom.mk.in +0 -1
@@ -6,7 +6,6 @@ FETCHER := @FETCHER@ # A debug build of stubdom? //FIXME: Someone make this do something debug := @debug@ -vtpm = @vtpm@ STUBDOM_TARGETS := @STUBDOM_TARGETS@ STUBDOM_BUILD := @STUBDOM_BUILD@
config/Tools.mk.in +0 -1
@@ -59,7 +59,6 @@ CONFIG_QEMU_TRAD := @qemu_traditional@ CONFIG_QEMU_XEN := @qemu_xen@ CONFIG_BLKTAP1 := @blktap1@ CONFIG_BLKTAP2 := @blktap2@ -CONFIG_VTPM := @vtpm@ CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@ CONFIG_REMUS_NETBUF := @remus_netbuf@
stubdom/vtpmmgr/Makefile +5 -0
@@ -23,6 +23,11 @@ build: $(TARGET) $(TARGET): $(OBJS) ar -rcs $@ $^ +install: + $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)" + $(INSTALL_PROG) calc.pl "$(DESTDIR)$(LIBEXEC_BIN)" + $(INSTALL_PROG) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC_BIN)" + clean: rm -f $(TARGET) $(OBJS)
stubdom/vtpmmgr/calc.pl renamed from tools/vtpmmgr/calc.pl +0 -0
stubdom/vtpmmgr/manage-vtpmmgr.pl renamed from tools/vtpmmgr/manage-vtpmmgr.pl +0 -0
tools/Makefile +0 -1
@@ -34,7 +34,6 @@ SUBDIRS-$(CONFIG_X86) += xenpaging SUBDIRS-$(CONFIG_X86) += debugger/gdbsx SUBDIRS-$(CONFIG_X86) += debugger/kdd SUBDIRS-$(CONFIG_TESTS) += tests -SUBDIRS-$(CONFIG_VTPM) += vtpmmgr # These don't cross-compile ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
tools/vtpmmgr/Makefile deleted +0 -15
@@ -1,15 +0,0 @@ -XEN_ROOT=$(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -all: - @true - -install: - $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)" - $(INSTALL_DATA) calc.pl "$(DESTDIR)$(LIBEXEC_BIN)" - $(INSTALL_DATA) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC_BIN)" - -clean: - @true - -.PHONY: all install clean
Re: [PATCH 27/28] move vtpmmgr helpers from tools to stubdom
Quoted 10 lines · Olaf Hering
Tools.mk contains a dead
CONFIG_VTPM, @vtpm@ is never expanded because @vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts to stubdom/vtpmmgr and install them as executeable. This was introduced by the recent commitffa11862aa431494e809c6e99f7358c12cb67e44("vtpmmgr:
add example control tools")
Also remove vtpm= fromconfig/Stubdom.mkbecause vtpm= is (appearently) not used by make itself.Signed-off-by Olaf Hering <[email protected]>Acked-by Ian Campbell <[email protected]>
Looks good to me.
PATCH v5 28/28 Separate runtime debug output from debug symbols
In reply to Olaf HeringWith this change debug and debug_symbols is used consistently. With 'make debug=yn debug_symbols=yn' my rebuild time and diskspace usage goes down:
105275K clean xen.git checkout.
y 1247041K build time: 5:57
n 812112K build time: 5:34
No change in behaviour is expected by that patch for tools and xen. For stubdom CFLAGS change from -O1 to O2 with debug=n.
--- stubdom/Makefile | 3 +-- tools/Makefile | 7 +++++++ tools/ocaml/common.make | 5 ++++- xen/Rules.mk | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-)
stubdom/Makefile +1 -2
@@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os export XEN_OS=MiniOS export stubdom=y -export debug=y -include $(XEN_ROOT)/Config.mk -include $(XEN_ROOT)/config/Stubdom.mk +include $(XEN_ROOT)/Config.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH) ifeq ($(XEN_TARGET_ARCH),x86_32)
tools/Makefile +7 -0
@@ -197,6 +197,12 @@ else QEMU_XEN_ENABLE_DEBUG := endif +ifeq ($(debug_symbols),y) +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip +else +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info +endif + subdir-all-qemu-xen-dir: qemu-xen-dir-find if test -d $(QEMU_UPSTREAM_LOC) ; then \ source=$(QEMU_UPSTREAM_LOC); \
@@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find cd qemu-xen-dir; \ $$source/configure --enable-xen --target-list=i386-softmmu \ $(QEMU_XEN_ENABLE_DEBUG) \ + $(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \ --prefix=$(LIBEXEC) \ --libdir=$(LIBEXEC_LIB) \ --includedir=$(LIBEXEC_INC) \
tools/ocaml/common.make +4 -1
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where) OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^ *\(-g\) .*/\1/p') OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F -OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F +ifeq ($(debug_symbols),y) +OCAMLCFLAGS += -g +endif +OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F VERSION := 4.1
xen/Rules.mk +2 -1
@@ -43,7 +43,8 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(debug_symbols) += -g +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
xen/Rules.mk ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o · line 50
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 01.10.14 at 18:41, <[email protected]> wrote:
xen/Rules.mk +2
-1@@ -43,7 +43,8 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(debug_symbols) += -g +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
I'm fine with this change, but will make my ack depend on Andrew at least not objecting (iirc he had reservations on a previous iteration).
Jan
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 01.10.14 at 18:41, <[email protected]> wrote:
xen/Rules.mk +2
-1@@ -43,7 +43,8 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(debug_symbols) += -g +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc
Quoted 4 lines
xen/Rules.mk ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o · line 50
Quoted 1 line
xen/Rules.mk +0
-0CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLEI'm fine with this change, but will make my ack depend on Andrew at least not objecting (iirc he had reservations on a previous iteration).
Does that still stand? Quote:
...
Quoted 2 lines
I am not sure this is correct. Xen needs to embed its full symbol table for backtraces, so does need to be built unconditionally with -g
What does -g have to do with backtrace generation? If you're after .debug_frame, that can be had as .eh_frame without -g (and with -fasynchronous-unwind-tables passed instead). Yet whether everyone wants this is not at all clear, so providing a knob to turn it on/off seems quite desirable to me.
Jan
...
The point of the change is that building with -g has most likely not much benefit for most users. Please clearify if -g is really a hard requirement to build the hypervisor.
Olaf
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 10:00, <[email protected]> wrote:
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 01.10.14 at 18:41, <[email protected]> wrote:
xen/Rules.mk +2
-1@@ -43,7 +43,8 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(debug_symbols) += -g +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc
Quoted 6 lines
Quoted 4 lines
xen/Rules.mk ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o · line 50
Quoted 1 line
xen/Rules.mk +0
-0CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLEI'm fine with this change, but will make my ack depend on Andrew at least not objecting (iirc he had reservations on a previous iteration).
Does that still stand? Quote:
Is that a question to me or to him?
Quoted 9 lines
...
Quoted 2 lines
I am not sure this is correct. Xen needs to embed its full symbol table for backtraces, so does need to be built unconditionally with -g
What does -g have to do with backtrace generation? If you're after .debug_frame, that can be had as .eh_frame without -g (and with -fasynchronous-unwind-tables passed instead). Yet whether everyone wants this is not at all clear, so providing a knob to turn it on/off seems quite desirable to me.
My position didn't change, but I'm also not going to ignore his comment. Hence my desire for him to clarify whether he objects to the change (in which case I'd expect him to offer alternatives aiming in this...
Quoted 3 lines
The point of the change is that building with -g has most likely not much benefit for most users. Please clearify if -g is really a hard requirement to build the hypervisor.
... direction).
Jan
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 15 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 10:00, <[email protected]> wrote:
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 01.10.14 at 18:41, <[email protected]> wrote:
xen/Rules.mk +2
-1@@ -43,7 +43,8 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(debug_symbols) += -g +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc
Quoted 18 lines
Quoted 6 lines
Quoted 4 lines
xen/Rules.mk ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o · line 50
Quoted 1 line
xen/Rules.mk +0
-0CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLEI'm fine with this change, but will make my ack depend on Andrew at least not objecting (iirc he had reservations on a previous iteration).
Does that still stand? Quote:
Is that a question to me or to him?
Quoted 9 lines
...
Quoted 2 lines
I am not sure this is correct. Xen needs to embed its full symbol table for backtraces, so does need to be built unconditionally with -g
What does -g have to do with backtrace generation? If you're after .debug_frame, that can be had as .eh_frame without -g (and with -fasynchronous-unwind-tables passed instead). Yet whether everyone wants this is not at all clear, so providing a knob to turn it on/off seems quite desirable to me.
I think Andrew is talking about the symbol table rather than the debug info - xen's backtrace walker doesn't speak DWARF. AFAICT the symbol tables generated without '-g' are just fine for xen's own use printing backtraces &c, though possibly post-mortem tools for crash analysis might need more?
Tim.
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 11:52, <[email protected]> wrote:
I think Andrew is talking about the symbol table rather than the debug info - xen's backtrace walker doesn't speak DWARF. AFAICT the symbol tables generated without '-g' are just fine for xen's own use printing backtraces &c,
Right.
Quoted 2 lines
though possibly post-mortem tools for crash analysis might need more?
Perhaps. In which case people interested in this can enable debug info generation (and iirc Olaf's patch also doesn't change any defaults here).
Jan
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 7 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 11:52, <[email protected]> wrote:
I think Andrew is talking about the symbol table rather than the debug info - xen's backtrace walker doesn't speak DWARF. AFAICT the symbol tables generated without '-g' are just fine for xen's own use printing backtraces &c,
Right.
Quoted 8 lines
Quoted 2 lines
though possibly post-mortem tools for crash analysis might need more?
Perhaps. In which case people interested in this can enable debug info generation (and iirc Olaf's patch also doesn't change any defaults here).
Jan
After some investigation of my own, I have confirmed that neither System.map nor xen.gz are altered.
I do find it somewhat silly to generate a xen-syms without debugging symbols, but as that doesn't affect the eventual xen.gz, I am less worried about it.
However, you may have noticed that there are actually two -g's on the Xen build command line, the first of which is directly inherited directly from the root Config.mk.
Therefore, I think you can just unilaterally drop the -g from xen/Rules.mk
~Andrew
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 22 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 18:52, <[email protected]> wrote:
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 11:52, <[email protected]> wrote:
I think Andrew is talking about the symbol table rather than the debug info - xen's backtrace walker doesn't speak DWARF. AFAICT the symbol tables generated without '-g' are just fine for xen's own use printing backtraces &c,
Quoted 7 lines
Right.
Quoted 2 lines
though possibly post-mortem tools for crash analysis might need more?
Perhaps. In which case people interested in this can enable debug info generation (and iirc Olaf's patch also doesn't change any defaults here).
After some investigation of my own, I have confirmed that neither System.map nor xen.gz are altered.
I do find it somewhat silly to generate a xen-syms without debugging symbols, but as that doesn't affect the eventual xen.gz, I am less worried about it.
Quoted 5 lines
However, you may have noticed that there are actually two -g's on the Xen build command line, the first of which is directly inherited directly from the root Config.mk.
Therefore, I think you can just unilaterally drop the -g from
xen/Rules.mk
Indeed. Olaf, can you take adjust the patch accordingly please?
Jan
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
Quoted 3 lines · Jan Beulich
Quoted 2 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 18:52, <[email protected]> wrote:
Therefore, I think you can just unilaterally drop the -g from
xen/Rules.mkIndeed. Olaf, can you take adjust the patch accordingly please?
I did not get around to redo the patch with that change and the updated description. Will do that today.
Olaf
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
In reply to Jan BeulichQuoted 3 lines · Jan Beulich
Quoted 2 lines
Quoted 1 line
Quoted 1 line · On 02.10.14 at 10:00, <[email protected]> wrote:
Does that still stand? Quote:
Is that a question to me or to him?
For both of you.
My guess is that -g is not required for normal operation, backtraces will continue to work. Perhaps Andrew had something else in mind?
Olaf
Re: [PATCH 28/28] Separate runtime debug output from debug symbols
In reply to Olaf HeringQuoted 2 lines · Olaf Hering
With this change debug and
debug_symbolsis used consistently. With 'make debug=yn debug_symbols=yn'
What does this "yn" syntax do?
It's not clear to me what "this change" actually is, perhaps I'm just lacking the context, but could you explain in the commit message what it is you are actually changing. (You could assume I'd never heard of debug_symbols before today, because I hadn't...)
Quoted 98 lines
my rebuild time and diskspace
usage goes down:105275K clean xen.git checkout.y 1247041K build time: 5:57
n 812112K build time: 5:34No change in behaviour is expected by that patch for tools and xen. For stubdom CFLAGS change from -O1 to O2 with debug=n.
Signed-off-by Olaf Hering <[email protected]>Release-Acked-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>Cc David Scott <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>Cc Jan Beulich <[email protected]>Cc Keir Fraser <[email protected]>Cc Samuel Thibault <[email protected]>Cc Stefano Stabellini <[email protected]>Cc Tim Deegan <[email protected]>Cc Wei Liu <[email protected]>--- stubdom/Makefile | 3 +-- tools/Makefile | 7 +++++++ tools/ocaml/common.make | 5 ++++- xen/Rules.mk | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-)stubdom/Makefile +1
-2@@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os export XEN_OS=MiniOS export stubdom=y -export debug=y -include $(XEN_ROOT)/Config.mk -include $(XEN_ROOT)/config/Stubdom.mk +include $(XEN_ROOT)/Config.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH) ifeq ($(XEN_TARGET_ARCH),x86_32)tools/Makefile +7
-0@@ -197,6 +197,12 @@ else QEMU_XEN_ENABLE_DEBUG := endif +ifeq ($(debug_symbols),y) +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip +else +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info +endif + subdir-all-qemu-xen-dir: qemu-xen-dir-find if test -d $(QEMU_UPSTREAM_LOC) ; then \ source=$(QEMU_UPSTREAM_LOC); \@@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find cd qemu-xen-dir; \ $$source/configure --enable-xen --target-list=i386-softmmu \ $(QEMU_XEN_ENABLE_DEBUG) \ + $(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \ --prefix=$(LIBEXEC) \ --libdir=$(LIBEXEC_LIB) \ --includedir=$(LIBEXEC_INC) \tools/ocaml/common.make +4
-1@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where) OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^ *\(-g\) .*/\1/p') OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F -OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F +ifeq ($(debug_symbols),y) +OCAMLCFLAGS += -g +endif +OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F VERSION := 4.1xen/Rules.mk +2
-1@@ -43,7 +43,8 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(debug_symbols) += -g +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
PATCH v2 1/1 Separate runtime debug output from debug symbols
In reply to Olaf HeringTwo make variables exist (debug=y and debug_symbols=y) to control either the creation of additional runtime debug or the creation of debug symbols for tools like gdb. Some places in the code still passed -g unconditionally to the compiler. Wrap them into a "debug_symbols" conditional. The xen build passed -g unconditional, reuse the existing debug_symbols=y check in Config.mk. There are still parts of the code that hardcode -g, namely the external qemu-traditional and stubdom packages. They are not changed by this patch.
No change in behaviour is expected by that patch for tools and xen. For stubdom CFLAGS change from -O1 to O2 with debug=n.
--- stubdom/Makefile | 3 +-- tools/Makefile | 7 +++++++ tools/ocaml/common.make | 5 ++++- xen/Rules.mk | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-)
stubdom/Makefile +1 -2
@@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os export XEN_OS=MiniOS export stubdom=y -export debug=y -include $(XEN_ROOT)/Config.mk -include $(XEN_ROOT)/config/Stubdom.mk +include $(XEN_ROOT)/Config.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH) ifeq ($(XEN_TARGET_ARCH),x86_32)
tools/Makefile +7 -0
@@ -197,6 +197,12 @@ else QEMU_XEN_ENABLE_DEBUG := endif +ifeq ($(debug_symbols),y) +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip +else +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info +endif + subdir-all-qemu-xen-dir: qemu-xen-dir-find if test -d $(QEMU_UPSTREAM_LOC) ; then \ source=$(QEMU_UPSTREAM_LOC); \
@@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find cd qemu-xen-dir; \ $$source/configure --enable-xen --target-list=i386-softmmu \ $(QEMU_XEN_ENABLE_DEBUG) \ + $(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \ --prefix=$(LIBEXEC) \ --libdir=$(LIBEXEC_LIB) \ --includedir=$(LIBEXEC_INC) \
tools/ocaml/common.make +4 -1
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where) OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^ *\(-g\) .*/\1/p') OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F -OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F +ifeq ($(debug_symbols),y) +OCAMLCFLAGS += -g +endif +OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F VERSION := 4.1
xen/Rules.mk +1 -1
@@ -43,7 +43,7 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += -nostdinc CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
Re: [PATCH v2] Separate runtime debug output from debug symbols
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 06.10.14 at 10:55, <[email protected]> wrote:
Two make variables exist (debug=y and debug_symbols=y) to control either the creation of additional runtime debug or the creation of debug symbols for tools like gdb. Some places in the code still passed -g unconditionally to the compiler. Wrap them into a "
debug_symbols" conditional. The xen build passed -g unconditional, reuse the existing debug_symbols=y check in Config.mk. There are still parts of the code that hardcode -g, namely the external qemu-traditional and stubdom packages. They are not changed by this patch.
Quoted 8 lines
No change in behaviour is expected by that patch for tools and xen. For stubdom CFLAGS change from -O1 to O2 with debug=n.
Signed-off-by Olaf Hering <[email protected]>Release-Acked-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>[...]xen/Rules.mk | 2 +-
For just this small part of the patch:
Re: [PATCH v2] Separate runtime debug output from debug symbols
Quoted 13 lines · Jan Beulich
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 06.10.14 at 10:55, <[email protected]> wrote:
Two make variables exist (debug=y and debug_symbols=y) to control either the creation of additional runtime debug or the creation of debug symbols for tools like gdb. Some places in the code still passed -g unconditionally to the compiler. Wrap them into a "
debug_symbols" conditional. The xen build passed -g unconditional, reuse the existing debug_symbols=y check in Config.mk. There are still parts of the code that hardcode -g, namely the external qemu-traditional and stubdom packages. They are not changed by this patch.No change in behaviour is expected by that patch for tools and xen. For stubdom CFLAGS change from -O1 to O2 with debug=n.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Olaf Hering <[email protected]>Release-Acked-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>[...]xen/Rules.mk | 2 +-For just this small part of the patch:
Acked-by Jan Beulich <[email protected]>
Unfortunately this seems to cause:
/usr/bin/wget -c -O zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz
/zlib-1.2.3.tar.gz: Scheme missing.I think the reordering in stubdom/Makefile has caused XEN_EXTFILES_URL to not be defined at the correct point in time.
Ian.
Re: [PATCH v2] Separate runtime debug output from debug symbols
Quoted 7 lines · Ian Campbell
Unfortunately this seems to cause:
/usr/bin/wget -c -O zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz: Scheme missing.I think the reordering in stubdom/Makefile has caused
XEN_EXTFILES_URLto not be defined at the correct point in time.
My stubdom build used to work. I will have a look.
Olaf
Re: [PATCH v2] Separate runtime debug output from debug symbols
Quoted 11 lines · Olaf Hering
Quoted 7 lines · Ian Campbell
Unfortunately this seems to cause:
/usr/bin/wget -c -O zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz: Scheme missing.I think the reordering in stubdom/Makefile has caused
XEN_EXTFILES_URLto not be defined at the correct point in time.My stubdom build used to work. I will have a look.
It used to work, but I have it now disabled in my wrapper. So I did not notice the breakage anymore. Leaving stubdom/Makefile unchanged will not alter the meaning of this patch because in the end it is supposed to handle just debug_symbols. The 'exports debug=y' needs more investigation on my side.
I will resend an new version that does not touch stubdom/Makefile.
Olaf
Quoted 1 line · Olaf Hering
Konrad, you are in CC because I would like to see this in 4.5-rc1.
Thank you.
Quoted 4 lines
In my attempt to get a xen.rpm from 'make rpmball' which operates entirely below the configured --prefix= I came up with these changes.
Regression wise it will be quite easy to figure out if something is broken - it hasn't been built. Hence the error reporting of that should be fairly easy.
The benefit of this change is that it does an good cleanup of Makefile/configure.ac and in the long term that should make it better and easier to compile Xen on other platforms.
Quoted 6 lines
This is a resend of the remaining parts of this series with the comments incorporated:
http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03003.html
http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03981.html
Quoted 8 lines
In v5 of this series the --libexec patch was updated to also remove
PRIVATE_PREFIXandPRIVATE_BINDIRfrom paths.m4, and it does not remove $(LIBDIR)/xen/ anymore - just $(LIBEXEC). The patch to "separate runtime debug info" is the simplified version.With this series its now possible to run everything except pygrub below the configured --prefix=.
Yeey!
Quoted 126 lines
NOTE: the renaming of
tools/hotplug/Linux/init.d/xencommons.inmay cause trouble in configured working copies. Use 'git clean -dfx' to wipe all and everything before git pull.One outstanding bug is pygrub, which does not know about $prefix/$lib/python/site-packages. This is still on my todo list.
Please rerun
autogen.shafter applying this series.Olaf
Olaf Hering (28):
tools: fix make uninstall
tools/hotplug: fix race during xen.conf creationtools/python: use also LDFLAGS for build
Add configure --with-initddir=DIR
tools/hotplug: useXEN_SCRIPT_DIRinstead of hardcoded pathtools/configure.ac: sortAC_CONFIG_FILES
tools/hotplug: useINITD_DIRinstead of CONFIG_DIR/init.d|rc.dtools/hotplug: substituteXEN_SCRIPT_DIRon FreeBSD
remove duplicate variables from config
Substitue configure variables in Paths.mk.in
tools: substitute bindir instead of BINDIR
Use configure --mandir=DIR to set MANDIR
Use configure --docdir=DIR to set DOCDIR
Use configure --includedir=DIR to set INCLUDEDIR
Use configure --libexecdir=BASEDIR to set LIBEXEC
Use configure --prefix=DIR to set PREFIX
Use configure --localstatedir=BASEDIR to set path to /var Add configure --enable-rpath
Add configure --with-linux-backend-modules="mod1 mod2" Move variable to set bash_completion.d to Paths.mk
Add configure --with-sysconfig-leaf-dir=SUBDIR to setCONFIG_LEAF_DIRMake XENFIRMWAREDIR a subdir of libexecdir
tools: remove private copies of includedir and libdir from libxenstat Use Paths.mk for docs, stubdom and tools build
tools: useXEN_LIB_STOREDinstead of/var/lib/xenstoredtools/hotplug: UseXEN_RUN_DIRinstead of/var/run/xenmove vtpmmgr helpers from tools to stubdom
Separate runtime debug output from debug symbols.gitignore | 7 ++ Config.mk | 14 +-- Makefile | 12 --- README | 12 --- config/Docs.mk.in | 7 +- config/Linux.mk | 2 + config/Linux.modules | 20 ---- config/NetBSD.mk | 5 - config/NetBSDRump.mk | 2 - config/Paths.mk.in | 44 +++++++-- config/StdGNU.mk | 23 ----- config/Stubdom.mk.in | 7 -- config/SunOS.mk | 15 --- config/Tools.mk.in | 13 +-- docs/misc/distro_mapping.txt | 5 +- m4/paths.m4 | 101 ++++++++++++++------- m4/xenstored.m4 | 8 +- stubdom/Makefile | 9 +- stubdom/vtpmmgr/Makefile | 5 + {tools => stubdom}/vtpmmgr/calc.pl | 0 {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl | 0 tools/Makefile | 46 ++++++++-- tools/Rules.mk | 1 - tools/configure.ac | 53 +++++++++-- tools/console/Makefile | 4 +- tools/hotplug/FreeBSD/Makefile | 5 +- .../FreeBSD/rc.d/{xencommons => xencommons.in} | 6 +- tools/hotplug/FreeBSD/vif-bridge | 2 +- tools/hotplug/Linux/Makefile | 18 ++-- tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 10 +- .../Linux/init.d/{xen-watchdog => xen-watchdog.in} | 2 +- .../init.d/{xencommons.in.in => xencommons.in} | 13 ++- .../Linux/init.d/{xendomains => xendomains.in} | 14 +-- tools/hotplug/Linux/systemd/Makefile | 37 ++------ .../systemd/xen-qemu-dom0-disk-backend.service.in | 4 +- .../hotplug/Linux/systemd/xen-watchdog.service.in | 2 +- tools/hotplug/Linux/systemd/xenconsoled.service.in | 2 +- tools/hotplug/Linux/systemd/xendomains.service.in | 6 +- tools/hotplug/Linux/systemd/xenstored.service.in | 4 +- tools/hotplug/Linux/update-modules.sh | 36 -------- tools/hotplug/Linux/{vif-setup => vif-setup.in} | 2 +- .../{xen-backend.rules => xen-backend.rules.in} | 16 ++-- ...-hotplug-common.sh => xen-hotplug-common.sh.in} | 4 +- tools/hotplug/Linux/{xendomains => xendomains.in} | 2 +- tools/hotplug/NetBSD/Makefile | 6 +- tools/hotplug/NetBSD/block | 2 +- .../NetBSD/rc.d/{xencommons => xencommons.in} | 4 +- tools/hotplug/NetBSD/vif-bridge | 2 +- tools/hotplug/NetBSD/vif-ip | 2 +- tools/libxl/Makefile | 6 +- tools/libxl/libxl_dm.c | 4 +- tools/libxl/libxl_internal.h | 1 - tools/libxl/libxl_paths.c | 7 +- tools/libxl/libxl_save_callout.c | 2 +- tools/misc/Makefile | 4 +- tools/ocaml/common.make | 5 +- tools/pygrub/Makefile | 8 +- tools/python/Makefile | 4 +- tools/vtpmmgr/Makefile | 15 --- tools/xcutils/Makefile | 4 +- tools/xenpaging/Makefile | 4 +- tools/xenstat/libxenstat/Makefile | 4 - tools/xenstore/Makefile | 3 +- tools/xenstore/xs_lib.c | 2 +- tools/xentrace/Makefile | 4 +- xen/Rules.mk | 3 +- 66 files changed, 322 insertions(+), 374 deletions(-) delete mode 100644 config/Linux.modules rename {tools => stubdom}/vtpmmgr/calc.pl (100%) rename {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl (100%) rename tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} (96%) rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%) rename tools/hotplug/Linux/init.d/{xencommons.in.in => xencommons.in} (91%) rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (79%) delete mode 100755 tools/hotplug/Linux/update-modules.sh rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (61%) rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (62%) rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (94%) rename tools/hotplug/Linux/{xendomains => xendomains.in} (99%) rename tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} (97%) delete mode 100644 tools/vtpmmgr/Makefile
On Wed, 2014-10-01 at 18:41 +0200, Olaf Hering wrote:
I've pushed everything but the final patch since that had discussion and it looked like it needed Xen-side acks etc.
See other mails for what had to happen to your libexec patch. With those changes I don't see any change of path with a default build