Skip to contentSkip to conversation

tool changes to honor configure --prefix=DIR

PATCH In review Olaf Hering 8 participants 52 messages Oct 1, 2014 – Oct 8, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

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/Makefile
#1 lore raw

PATCH 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.

Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Wei Liu <[email protected]>
---
 Makefile       | 12 ------------
 tools/Makefile |  9 +++++++++
 2 files changed, 9 insertions(+), 12 deletions(-)
Makefile +0 -12
index 3b9bf7a..bf8028a 100644
@@ -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
index 00f539a..99e5694 100644
@@ -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
Acked-by on v5 1/28
#2 lore raw

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 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.

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.

Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
#3 lore raw

PATCH v5 2/28 tools/hotplug: fix race during xen.conf creation

In reply to 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 process. Fix this by let the all target depend on install. Also remove the generated file with make clean.

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
index dc98b67..90ba16e 100644
@@ -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)
#4 lore raw

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.

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
index dc98b67..90ba16e 100644
@@ -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)
#5 lore raw

PATCH v5 3/28 tools/python: use also LDFLAGS for build

In reply to Olaf Hering

An upcoming change will pass -Wl,-rpath to xc.so. Make sure such LDFLAGS will be used for python libs.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 tools/python/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/python/Makefile +2 -2
index 4918229..533d3de 100644
@@ -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
#6 lore raw

PATCH v5 4/28 Add configure --with-initddir=DIR

In reply to Olaf Hering

Preserve 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 2bb8dcc..e4ff64d 100644
@@ -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
index 507b6d1..c01d0ef 100644
@@ -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
index f849d07..d2b1399 100644
@@ -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
index b183845..19b6481 100644
@@ -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)
#7 lore raw

PATCH v5 5/28 tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path

In reply to Olaf Hering

Helper 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 .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
index 67ed7cb..4344c52 100644
@@ -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
index ddf83d7..4cc3a01 100644
@@ -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
index d493eca..1470514 100644
@@ -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
index cfa4dd6..cb77811 100644
@@ -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
similarity index 97%
rename from tools/hotplug/Linux/init.d/xen-watchdog
rename to tools/hotplug/Linux/init.d/xen-watchdog.in
index 3592fda..32c7268 100644
@@ -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
index a723eb4..bd1d9ba 100644
@@ -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
similarity index 97%
rename from tools/hotplug/Linux/init.d/xendomains
rename to tools/hotplug/Linux/init.d/xendomains.in
index 3857602..5b88e2d 100644
@@ -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
similarity index 61%
rename from tools/hotplug/Linux/vif-setup
rename to tools/hotplug/Linux/vif-setup.in
index bcc462e..c3bc662 100644
@@ -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
similarity index 62%
rename from tools/hotplug/Linux/xen-backend.rules
rename to tools/hotplug/Linux/xen-backend.rules.in
index a0d409e..7d2f914 100644
@@ -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
similarity index 98%
rename from tools/hotplug/Linux/xen-hotplug-common.sh
rename to tools/hotplug/Linux/xen-hotplug-common.sh.in
index 7af4688..996e974 100644
@@ -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
similarity index 99%
rename from tools/hotplug/Linux/xendomains
rename to tools/hotplug/Linux/xendomains.in
index c45f132..de711b7 100644
@@ -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"
#8 lore raw

PATCH v5 6/28 tools/configure.ac: sort AC_CONFIG_FILES

In reply to Olaf Hering

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 tools/configure.ac | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/configure.ac +6 -6
index cb77811..686f499 100644
@@ -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
#9 lore raw

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
index 6480aa5..e21f046 100644
@@ -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
index fc61162..9084859 100644
@@ -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

#10 lore raw

PATCH v5 8/28 tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD

In reply to Olaf Hering

Also 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
index 4344c52..2201cb0 100644
@@ -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
index 686f499..788ba72 100644
@@ -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
index e21f046..169a124 100644
@@ -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
similarity index 98%
rename from tools/hotplug/FreeBSD/rc.d/xencommons
rename to tools/hotplug/FreeBSD/rc.d/xencommons.in
index 2d9034c..8b051ec 100644
@@ -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

#11 lore raw

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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index e4ff64d..9bda626 100644
@@ -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
index 141de7c..21318d6 100644
@@ -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
index 8daade8..2a87218 100644
@@ -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
index c01d0ef..4bded93 100644
@@ -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
index 4cc3a01..dd6170c 100644
@@ -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
index 1470514..92bde78 100644
@@ -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
index 19b6481..178b9a9 100644
@@ -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
#12 lore raw

PATCH v5 10/28 Substitue configure variables in Paths.mk.in

In reply to Olaf Hering

This 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 config/Paths.mk.in | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
config/Paths.mk.in +17 -0
index 4bded93..65ca37b 100644
@@ -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@
#13 lore raw

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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 65ca37b..c3c9897 100644
@@ -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
index 178b9a9..a9c6ebd 100644
@@ -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
index 30b44c9..b268fc2 100644
@@ -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
index d423ff8..4d76d6b 100644
@@ -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
index acb2b77..ee77bf9 100644
@@ -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
index 15fad35..7ca0264 100644
@@ -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
index 4a9fcee..013e69e 100644
@@ -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
#14 lore raw

PATCH v5 12/28 Use configure --mandir=DIR to set MANDIR

In reply to Olaf Hering

Also move common MAN8DIR and MAN1DIR to Paths.mk.in

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 9bda626..b8afa43 100644
@@ -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
index c3c9897..3ba4f77 100644
@@ -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
index dd6170c..bcf02ea 100644
@@ -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
index 92bde78..c88fc2a 100644
@@ -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
#15 lore raw

PATCH v5 13/28 Use configure --docdir=DIR to set DOCDIR

In reply to Olaf Hering
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 Config.mk          | 1 -
 config/Paths.mk.in | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
Config.mk +0 -1
index b8afa43..569f4ab 100644
@@ -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
index 3ba4f77..a2221c8 100644
@@ -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@
#16 lore raw

PATCH v5 14/28 Use configure --includedir=DIR to set INCLUDEDIR

In reply to Olaf Hering
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index a2221c8..2151c14 100644
@@ -33,6 +33,7 @@ SBINDIR                  := $(sbindir)
 BINDIR                   := $(bindir)
 LIBEXEC                  := @LIBEXEC@
 
+INCLUDEDIR               := $(includedir)
 SHAREDIR                 := @SHAREDIR@
 MANDIR                   := $(mandir)
 MAN1DIR                  := $(MANDIR)/man1
config/StdGNU.mk +0 -1
index bcf02ea..b28a077 100644
@@ -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
index c88fc2a..1eaf0f8 100644
@@ -20,7 +20,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-INCLUDEDIR = $(PREFIX)/include
 
 BOOT_DIR ?= /boot
#17 lore raw

PATCH v5 15/28 Use configure --libexecdir=BASEDIR to set LIBEXEC

In reply to Olaf Hering

The 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.

Cc George Dunlap <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 569f4ab..ca400a7 100644
@@ -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
index 2151c14..8755785 100644
@@ -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
index a9c6ebd..b7b351c 100644
@@ -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
index 81f6d5a..9dac103 100644
@@ -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
index 99e5694..fced437 100644
@@ -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
index 3e38252..6e55618 100644
@@ -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
index 8b051ec..c73616e 100644
@@ -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
index fa7570d..d350df4 100644
@@ -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
index 5317fef..184f56d 100644
@@ -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
index 4d76d6b..4322081 100644
@@ -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
index bd1d9ba..590f745 100644
@@ -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
index 5b88e2d..dcd330c 100644
@@ -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
index 8dbd110..806bcaa 100644
@@ -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
index 70ce7c0..f88c336 100644
@@ -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
index 996e974..1deafe1 100644
@@ -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
index f1146b5..b2e9af5 100644
@@ -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
index 7ac87e2..793bede 100644
@@ -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
index 64162a8..960303e 100644
@@ -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
index 583e277..28c43de 100644
@@ -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
index 7bfcdd9..0bf666f 100644
@@ -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
index 0018113..d8992bb 100644
@@ -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
index b87c5e2..83bef59 100644
@@ -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
index 14b28d1..9b7b0d5 100644
@@ -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
index 1c9f806..40b25e4 100644
@@ -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
index 266fd16..3237461 100644
@@ -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
index a37a8b1..3dff608 100644
@@ -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
index 8890b06..b14c170 100644
@@ -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
index f71703d..1c5237c 100644
@@ -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
index 3734ca6..c742e62 100644
@@ -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
index 63b09c0..b821952 100644
@@ -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)
#18 lore raw

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_BIN because 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 6e0f43aa9d7af043347abe2ddbdf0e1eb0dbff0c Mon 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
index 77fef4f..280af0c 100644
@@ -9,4 +9,4 @@ CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
 
-bindir = ${LIBEXEC}
+bindir = ${LIBEXEC_BIN}
xen-setup-stubdom +1 -2
index 4f1b081..b523509 100755
@@ -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
#19 lore raw

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
index 2bb8dcc..e61b3ec 100644
@@ -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
#20 lore raw

Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC

In reply to Ian Campbell
Quoted 8 lines · Ian Campbell
Quoted 2 lines · Olaf Hering

Most users of LIBEXEC are updated to use LIBEXEC_BIN because 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

#21 lore raw

PATCH v5 16/28 Use configure --prefix=DIR to set PREFIX

In reply to Olaf Hering

PREFIX is set by configure --prefix=DIR, nothing outside tools,docs,stubdom is using this variable.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 config/StdGNU.mk | 2 --
 config/SunOS.mk  | 2 --
 2 files changed, 4 deletions(-)
config/StdGNU.mk +0 -2
index b28a077..16c3043 100644
@@ -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
index 1eaf0f8..bb8073f 100644
@@ -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
#22 lore raw

PATCH v5 17/28 Use configure --localstatedir=BASEDIR to set path to /var

In reply to Olaf Hering

This 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 m4/paths.m4    | 24 ++++++++++++++++--------
 tools/Makefile |  2 +-
 2 files changed, 17 insertions(+), 9 deletions(-)
m4/paths.m4 +16 -8
index b7b351c..53fb7b7 100644
@@ -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
index fced437..b4a26c4 100644
@@ -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 \
#23 lore raw

PATCH v5 18/28 Add configure --enable-rpath

In reply to Olaf Hering

This fixes the tools when xen is configured with --prefix=/odd/path

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index ca400a7..73281d8 100644
@@ -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
index a69b846..7183c32 100644
@@ -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
index b4a26c4..452510a 100644
@@ -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
index 788ba72..b9a1f6e 100644
@@ -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])
#24 lore raw

PATCH v5 19/28 Add configure --with-linux-backend-modules="mod1 mod2"

In reply to Olaf Hering

This 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 78c5db2..e860644 100644
@@ -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
deleted file mode 100644
index 8a764df..0000000
@@ -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
index 7183c32..bf437f6 100644
@@ -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
index b9a1f6e..a882948 100644
@@ -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
index 184f56d..8cdaa9a 100644
@@ -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
similarity index 96%
rename from tools/hotplug/Linux/init.d/xencommons.in.in
rename to tools/hotplug/Linux/init.d/xencommons.in
index 590f745..10edf29 100644
@@ -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
index 90ba16e..6950d24 100644
@@ -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
deleted file mode 100755
index 692d220..0000000
@@ -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
#25 lore raw

PATCH v5 20/28 Move variable to set bash_completion.d to Paths.mk

In reply to Olaf Hering
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 Config.mk          | 2 --
 config/Paths.mk.in | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)
Config.mk +0 -2
index 73281d8..cf7af12 100644
@@ -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
index 8755785..e1fe4a3 100644
@@ -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@
#26 lore raw

PATCH v5 21/28 Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR

In reply to Olaf Hering

Set 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index cf7af12..dff71b3 100644
@@ -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
index b421a1c..2a84b6b 100644
@@ -1 +1,3 @@
 include $(XEN_ROOT)/config/StdGNU.mk
+
+SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
config/Paths.mk.in +1 -0
index e1fe4a3..9fd87c5 100644
@@ -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
index 16c3043..1566d7f 100644
@@ -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
index d2b1399..2e46592 100644
@@ -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
index 53fb7b7..dcb8f28 100644
@@ -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*) ;;
#27 lore raw

PATCH v5 22/28 Make XENFIRMWAREDIR a subdir of libexecdir

In reply to Olaf Hering

Put 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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 config/Paths.mk.in | 2 +-
 m4/paths.m4        | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)
config/Paths.mk.in +1 -1
index 9fd87c5..50d40cc 100644
@@ -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
index dcb8f28..46172cb 100644
@@ -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)
#28 lore raw

PATCH v5 23/28 tools: remove private copies of includedir and libdir from libxenstat

In reply to Olaf Hering

They are wrong and unused.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 tools/xenstat/libxenstat/Makefile | 4 ----
 1 file changed, 4 deletions(-)
tools/xenstat/libxenstat/Makefile +0 -4
index f64a45c..86068cb 100644
@@ -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
#29 lore raw

PATCH v5 24/28 Use Paths.mk for docs, stubdom and tools build

In reply to Olaf Hering

Paths.mk contains just directories set by configure. Source this file first when building docs,stubdom or tools. Remove unused path variables from $subsystem.mk.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 497650f..33bd529 100644
@@ -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
index 50d40cc..fe10f76 100644
@@ -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
index c1c83bc..9098cbf 100644
@@ -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
index bf437f6..545bdc0 100644
@@ -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
index e2fdf63..87a56dc 100644
@@ -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
#30 lore raw

PATCH v5 25/28 tools: use XEN_LIB_STORED instead of /var/lib/xenstored

In reply to Olaf Hering

Remove hardcoded /var/lib/xenstored instead of using the existing XEN_LIB_STORED variable.

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index a882948..98b2455 100644
@@ -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
index c73616e..900990b 100644
@@ -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
index 4322081..c12fc8a 100644
@@ -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
index 10edf29..d53a1f3 100644
@@ -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
similarity index 98%
rename from tools/hotplug/NetBSD/rc.d/xencommons
rename to tools/hotplug/NetBSD/rc.d/xencommons.in
index 793bede..db03f22 100644
@@ -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
index cff57ed..563abd4 100644
@@ -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
index 9a78755..d166497 100644
@@ -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)
#31 lore raw

PATCH v5 26/28 tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen

In reply to Olaf Hering

Also remove duplicate XEN_RUN_DIR from m4/paths.m4.

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 46172cb..b35596c 100644
@@ -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
index 806bcaa..d3470fc 100644
@@ -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 \
#32 lore raw

PATCH v5 27/28 move vtpmmgr helpers from tools to stubdom

In reply to 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 commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
add example control tools")
Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently) not used by make itself.

Cc Daniel De Graaf <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Wei Liu <[email protected]>
---
 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
index 9098cbf..5990fc4 100644
@@ -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
index 545bdc0..89de5bd 100644
@@ -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
index a39a22c..c5e17c5 100644
@@ -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
similarity index 100%
rename from tools/vtpmmgr/calc.pl
rename to stubdom/vtpmmgr/calc.pl
stubdom/vtpmmgr/manage-vtpmmgr.pl renamed from tools/vtpmmgr/manage-vtpmmgr.pl +0 -0
similarity index 100%
rename from tools/vtpmmgr/manage-vtpmmgr.pl
rename to stubdom/vtpmmgr/manage-vtpmmgr.pl
tools/Makefile +0 -1
index 452510a..543cd29 100644
@@ -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
deleted file mode 100644
index b14c170..0000000
@@ -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
Acked-by on v5 27/28
#33 lore raw

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 commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
add example control tools")
Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently) not used by make itself.

Looks good to me.

#34 lore raw

PATCH v5 28/28 Separate runtime debug output from debug symbols

In reply to Olaf Hering

With 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.

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
index 9dac103..60dc0b8 100644
@@ -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
index 543cd29..884dc91 100644
@@ -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
index d5478f6..33b3142 100644
@@ -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
index a97405c..2d414ab 100644
@@ -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
#35 lore raw

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

#36 lore raw

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 -0
 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).

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

#37 lore raw

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 -0
 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).

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

#38 lore raw

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 -0
 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).

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.

#39 lore raw

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

#40 lore raw

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

#41 lore raw

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

#42 lore raw

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.mk

Indeed. 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

#43 lore raw

Re: [PATCH 28/28] Separate runtime debug output from debug symbols

In reply to Jan Beulich
Quoted 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

#44 lore raw

Re: [PATCH 28/28] Separate runtime debug output from debug symbols

In reply to Olaf Hering
Quoted 2 lines · Olaf Hering

With this change debug and debug_symbols is 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: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.

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
index 9dac103..60dc0b8 100644
@@ -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
index 543cd29..884dc91 100644
@@ -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
index d5478f6..33b3142 100644
@@ -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
index a97405c..2d414ab 100644
@@ -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
#45 lore raw

PATCH v2 1/1 Separate runtime debug output from debug symbols

In reply to Olaf Hering

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.

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            | 2 +-
 4 files changed, 13 insertions(+), 4 deletions(-)
stubdom/Makefile +1 -2
index 9dac103..60dc0b8 100644
@@ -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
index 543cd29..884dc91 100644
@@ -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
index d5478f6..33b3142 100644
@@ -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
index a97405c..60cd173 100644
@@ -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
Acked-by on v2 1/1
#46 lore raw

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.

 xen/Rules.mk            | 2 +-

For just this small part of the patch:

#47 lore raw

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
 xen/Rules.mk            | 2 +-

For just this small part of the patch:

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.

#48 lore raw

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_URL to not be defined at the correct point in time.

My stubdom build used to work. I will have a look.

Olaf

#49 lore raw

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_URL to 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

#50 lore raw
In reply to Olaf Hering
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_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=.

Yeey!

Quoted 126 lines

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/Makefile
#51 lore raw
In reply to Olaf Hering

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