xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR
@ 2014-09-22 12:59 Olaf Hering
  2014-09-22 12:59 ` [PATCH 01/46] stubdom: fix lwip compile Olaf Hering
                   ` (45 more replies)
  0 siblings, 46 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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 same series with the comments incorporated:
http://lists.xenproject.org/archives/html/xen-devel/2014-04/msg03240.html
http://lists.xenproject.org/archives/html/xen-devel/2014-07/msg03447.html

In v3 of this series configure is updated to provide all paths:
sysconfdir, docdir, mandir, includedir, libexecdir, localstatedir.

Additional options: with-initd-dir, with-linux-backend-modules,
with-bash_completion-dir and enable-rpath

Every path is now stored in config/Paths.mk.

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.

Also ocamlfind behaves odd. Its required to pass
OCAMLDESTDIR=$PWD/dist/install/${prefix}/lib64/ocaml to make rpmball.
This looks like a limitation of ocaml-findlib. The rpath change includes
an ocaml patch to pass rpath to the oxenstored link command.

Please review and apply.

Olaf

Olaf Hering (46):
  stubdom: fix lwip compile
  tools/xenpaging: create dumpdir with mode 0700
  install.sh: Preserve permissions from make install
  tools/mkrpm: allow custom rpm package name
  tools: remove obsolete path.py from tools/python
  tools/pygrub: store kernels in /var/run/xen/pygrub
  tools/hotplug: create XEN_RUN_DIR at runtime
  tools/hotplug: create XEN_LOCK_DIR at runtime
  tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
  tools/examples: remove obsolete install targets
  remove obsolete SUBSYS_DIR variable
  Config.mk: move directory list into BUILD_MAKE_VARS
  Config.mk: replace dependency to genpath with actual target
  Config.mk: add new macro buildmakevars2header
  tools/libxl: use buildmakevars2header to create _paths.h
  tools/libxc: provide variable paths to libxc
  tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE
  Use configure --sysconfdir=DIR to set CONFIG_DIR
  Add configure --with-initd-dir=DIR
  tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
  tools/configure.ac: sort AC_CONFIG_FILES
  tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  remove duplicate variables from config
  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"
  Add configure --with-bash_completion-dir=DIR
  Make XENFIRMWAREDIR a subdir of libexecdir
  Use just PREFIX to reference the path in Paths.mk
  tools: remove private copies of includedir and libdir from libxenstat
  Use Paths.mk for docs, stubdom and tools build
  Move xenconsoled to libexec
  Move xenstored to libexec
  Move xenwatchdogd to libexec
  tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  Use XEN_RUN_DIR instead of /var/run/xen
  Move systemd paths to Paths.mk
  Include Paths.mk in toplevel Makefile to fix uninstall
  Move MAN1DIR and MAN8DIR to Paths.mk
  rerun autogen.sh

 .gitignore                                         |   8 +
 Config.mk                                          |  35 ++--
 Makefile                                           |   7 +-
 README                                             |  12 --
 config/Docs.mk.in                                  |   7 -
 config/FreeBSD.mk                                  |   2 -
 config/Linux.modules                               |  20 --
 config/NetBSD.mk                                   |   5 -
 config/NetBSDRump.mk                               |   2 -
 config/Paths.mk.in                                 |  23 ++-
 config/StdGNU.mk                                   |  22 --
 config/Stubdom.mk.in                               |   8 -
 config/SunOS.mk                                    |  20 --
 config/Tools.mk.in                                 |  13 +-
 configure                                          | 125 ++++++++++--
 docs/Makefile                                      |   1 +
 docs/misc/distro_mapping.txt                       |   4 +-
 install.sh                                         |   3 -
 m4/paths.m4                                        | 110 ++++++++--
 m4/systemd.m4                                      |   4 +-
 m4/xenstored.m4                                    |   8 +-
 stubdom/Makefile                                   |  24 ++-
 stubdom/lwip.dhcp_create_request-hwaddr_len.patch  |  26 +++
 tools/Makefile                                     |  25 ++-
 tools/Rules.mk                                     |   2 +-
 tools/configure                                    | 222 ++++++++++++++++++---
 tools/configure.ac                                 |  53 ++++-
 tools/console/Makefile                             |   7 +-
 tools/examples/Makefile                            |  21 +-
 tools/hotplug/FreeBSD/Makefile                     |   5 +-
 .../FreeBSD/rc.d/{xencommons => xencommons.in}     |  18 +-
 tools/hotplug/FreeBSD/vif-bridge                   |   2 +-
 tools/hotplug/Linux/Makefile                       |  18 +-
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in |   8 +-
 .../Linux/init.d/{xen-watchdog => xen-watchdog.in} |   4 +-
 .../init.d/{xencommons.in.in => xencommons.in}     |  18 +-
 .../Linux/init.d/{xendomains => xendomains.in}     |  14 +-
 tools/hotplug/Linux/systemd/Makefile               |  33 +--
 .../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/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}  |   9 +-
 tools/hotplug/NetBSD/Makefile                      |   6 +-
 tools/hotplug/NetBSD/block                         |   2 +-
 tools/hotplug/NetBSD/rc.d/xen-watchdog             |   2 +-
 .../NetBSD/rc.d/{xencommons => xencommons.in}      |  16 +-
 tools/hotplug/NetBSD/vif-bridge                    |   2 +-
 tools/hotplug/NetBSD/vif-ip                        |   2 +-
 tools/hotplug/common/Makefile                      |   2 +-
 tools/libxc/Makefile                               |   9 +
 tools/libxc/xc_private.h                           |   1 +
 tools/libxc/xc_suspend.c                           |   2 +-
 tools/libxl/Makefile                               |  13 +-
 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                                |   8 +-
 tools/misc/mkrpm                                   |   2 +-
 tools/ocaml/xenstored/Makefile                     |   5 +-
 tools/pygrub/Makefile                              |   8 +-
 tools/pygrub/src/pygrub                            |   8 +-
 tools/python/Makefile                              |   9 +-
 tools/vtpmmgr/Makefile                             |   6 +-
 tools/xcutils/Makefile                             |   4 +-
 tools/xenpaging/Makefile                           |   6 +-
 tools/xenstat/libxenstat/Makefile                  |   4 -
 tools/xenstore/Makefile                            |   7 +-
 tools/xenstore/xs_lib.c                            |   2 +-
 tools/xentrace/Makefile                            |   4 +-
 75 files changed, 695 insertions(+), 469 deletions(-)
 delete mode 100644 config/Linux.modules
 create mode 100644 stubdom/lwip.dhcp_create_request-hwaddr_len.patch
 rename tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} (81%)
 rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (95%)
 rename tools/hotplug/Linux/init.d/{xencommons.in.in => xencommons.in} (88%)
 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} (98%)
 rename tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} (83%)

^ permalink raw reply	[flat|nested] 116+ messages in thread

* [PATCH 01/46] stubdom: fix lwip compile
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 12:59 ` [PATCH 02/46] tools/xenpaging: create dumpdir with mode 0700 Olaf Hering
                   ` (44 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

stubdom/lwip-x86_64/src/core/dhcp.c: In function 'dhcp_create_request':
stubdom/lwip-x86_64/src/core/dhcp.c:1359:71: error: array subscript is above array bounds [-Werror=array-bounds]
     dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;

gcc can not know if hwaddr_len exceeds the hwaddr array size,
so force an upper limit to assist gcc.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile                                  |  1 +
 stubdom/lwip.dhcp_create_request-hwaddr_len.patch | 26 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 6bea68b..88da991 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -145,6 +145,7 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	tar xzf $<
 	mv lwip $@
 	patch -d $@ -p0 < lwip.patch-cvs
+	patch -d $@ -p0 < lwip.dhcp_create_request-hwaddr_len.patch
 	touch $@
 
 #############
diff --git a/stubdom/lwip.dhcp_create_request-hwaddr_len.patch b/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
new file mode 100644
index 0000000..12f1014
--- /dev/null
+++ b/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
@@ -0,0 +1,26 @@
+---
+ lwip-x86_64/src/core/dhcp.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: src/core/dhcp.c
+===================================================================
+--- src/core/dhcp.c
++++ src/core/dhcp.c
+@@ -1322,6 +1322,8 @@ dhcp_create_request(struct netif *netif)
+ {
+   struct dhcp *dhcp;
+   u16_t i;
++  /* gcc can not know if hwaddr_len exceeds the hwaddr array size */
++  u8_t hwaddr_len = netif->hwaddr_len > NETIF_MAX_HWADDR_LEN ? NETIF_MAX_HWADDR_LEN : netif->hwaddr_len;
+   LWIP_ERROR("dhcp_create_request: netif != NULL", (netif != NULL), return ERR_ARG;);
+   dhcp = netif->dhcp;
+   LWIP_ERROR("dhcp_create_request: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
+@@ -1356,7 +1358,7 @@ dhcp_create_request(struct netif *netif)
+   dhcp->msg_out->giaddr.addr = 0;
+   for (i = 0; i < DHCP_CHADDR_LEN; i++) {
+     /* copy netif hardware address, pad with zeroes */
+-    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
++    dhcp->msg_out->chaddr[i] = (i < hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
+   }
+   for (i = 0; i < DHCP_SNAME_LEN; i++) {
+     dhcp->msg_out->sname[i] = 0;

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 02/46] tools/xenpaging: create dumpdir with mode 0700
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
  2014-09-22 12:59 ` [PATCH 01/46] stubdom: fix lwip compile Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 15:52   ` Ian Campbell
  2014-09-22 12:59 ` [PATCH 03/46] install.sh: Preserve permissions from make install Olaf Hering
                   ` (43 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

The swapfile contain sensitive guest info.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/xenpaging/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 4ff3375..fedd0fb 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -23,7 +23,7 @@ xenpaging: $(OBJS)
 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 install: all
-	$(INSTALL_DIR) $(DESTDIR)$(XEN_PAGING_DIR)
+	$(INSTALL_DIR) -m 0700 $(DESTDIR)$(XEN_PAGING_DIR)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
 	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 03/46] install.sh: Preserve permissions from make install
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
  2014-09-22 12:59 ` [PATCH 01/46] stubdom: fix lwip compile Olaf Hering
  2014-09-22 12:59 ` [PATCH 02/46] tools/xenpaging: create dumpdir with mode 0700 Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 15:54   ` Ian Campbell
  2014-09-22 12:59 ` [PATCH 04/46] tools/mkrpm: allow custom rpm package name Olaf Hering
                   ` (42 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 install.sh | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/install.sh b/install.sh
index 272123a..3e11c4d 100644
--- a/install.sh
+++ b/install.sh
@@ -27,9 +27,6 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-echo " - modifying permissions"
-chmod -R a+rX "$tmp"
-
 (cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
 rm -rf "$tmp"

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 04/46] tools/mkrpm: allow custom rpm package name
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (2 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 03/46] install.sh: Preserve permissions from make install Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 15:55   ` Ian Campbell
  2014-09-22 12:59 ` [PATCH 05/46] tools: remove obsolete path.py from tools/python Olaf Hering
                   ` (41 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Even if xen is configured and compiled with different --prefix= so that
it operates entirely below $prefix, the resulting package from 'make
rpmball' is always called "xen.rpm".

Use an environment name to give a different name.
This can be used like this:

suffix=-bugN
prefix=/opx/xen/staging${suffix}
./configure --prefix=${prefix}
make rpmball PKG_SUFFIX=${suffix}

The result will be "xen-bugN.rpm" instead of "xen.rpm". The benefit is that
many xen${suffix}.rpm packages can be installed at the same time.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/misc/mkrpm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
index a9aa5e2..9b8c6d9 100644
--- a/tools/misc/mkrpm
+++ b/tools/misc/mkrpm
@@ -31,7 +31,7 @@ rm -rf rpm
 mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
 cat >rpm/SPECS/xen.spec <<EOF
 Summary: Xen development build, version $version
-Name: xen
+Name: xen$PKG_SUFFIX
 Version: $version
 Release: $release
 License: GPL

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 05/46] tools: remove obsolete path.py from tools/python
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (3 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 04/46] tools/mkrpm: allow custom rpm package name Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 15:55   ` Ian Campbell
  2014-09-22 12:59 ` [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
                   ` (40 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

The directory tools/python/xen/util does not exist.
Upcoming changes to genpath will fail if the rule persists.
Nothing uses path.py (anymore?), so get rid it.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/python/Makefile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/tools/python/Makefile b/tools/python/Makefile
index c914332..4918229 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -4,13 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 .PHONY: all
 all: build
 
-XENPATH = "xen/util/path.py"
-
-genpath-target = $(call buildmakevars2file,$(XENPATH))
-$(eval $(genpath-target))
-
 .PHONY: build
-build: genpath genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
+build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/idl.py
 	PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
 		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
@@ -31,6 +26,6 @@ test:
 clean:
 	find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -delete
 	rm -rf build/
-	rm -f $(XENPATH) $(DEPS)
+	rm -f $(DEPS)
 
 -include $(DEPS)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (4 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 05/46] tools: remove obsolete path.py from tools/python Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 15:29   ` Andrew Cooper
  2014-09-22 12:59 ` [PATCH 07/46] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
                   ` (39 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Move location of temporary bootfiles from /var/run/xend/boot to
/var/run/xen/pygrub. Create the subdirectory if does not exist.
The <dir> argument --output-directory must be an existing directory.

The reason for this change is that all entrys below /var/run have to be
created at runtime in case /var/run is cleared on every boot.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/pygrub/src/pygrub | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 2618e11..e73a174 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -778,7 +778,7 @@ if __name__ == "__main__":
     debug = False
     not_really = False
     output_format = "sxp"
-    output_directory = "/var/run/xend/boot"
+    output_directory = "/var/run/xen/pygrub"
 
     # what was passed in
     incfg = { "kernel": None, "ramdisk": None, "args": "" }
@@ -829,11 +829,17 @@ if __name__ == "__main__":
                 sys.exit(1)
             output_format = a
         elif o in ("--output-directory",):
+            if not os.path.isdir(a):
+                print "%s is not an existing directory" % a
+                sys.exit(1)
             output_directory = a
 
     if debug:
 	logging.basicConfig(level=logging.DEBUG)
 
+    if not os.path.isdir(output_directory):
+        os.mkdir(output_directory, 0700)
+
     if output is None or output == "-":
         fd = sys.stdout.fileno()
     else:

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 07/46] tools/hotplug: create XEN_RUN_DIR at runtime
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (5 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 12:59 ` [PATCH 08/46] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
                   ` (38 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Create XEN_RUN_DIR instead of hardcoded path because it is a compiletime
setting. Also /var/run might be empty on startup because it is a tmpfs
mount point.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/init.d/xencommons.in.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
index 1d860d9..be21960 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in.in
@@ -60,7 +60,7 @@ do_start () {
 	local timeout=30
 
 	@LOAD_MODULES@
-	mkdir -p /var/run/xen
+	mkdir -p ${XEN_RUN_DIR}
 
 	if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
 	then

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 08/46] tools/hotplug: create XEN_LOCK_DIR at runtime
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (6 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 07/46] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 12:59 ` [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
                   ` (37 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Create XEN_LOCK_DIR because it is a compiletime setting. Also /var/lock
might be empty on startup because it is a tmpfs mount point.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/init.d/xencommons.in.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
index be21960..a723eb4 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in.in
@@ -61,6 +61,7 @@ do_start () {
 
 	@LOAD_MODULES@
 	mkdir -p ${XEN_RUN_DIR}
+	mkdir -p ${XEN_LOCK_DIR}
 
 	if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
 	then

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (7 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 08/46] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2016-04-11 16:34   ` George Dunlap
  2014-09-22 12:59 ` [PATCH 10/46] tools/examples: remove obsolete install targets Olaf Hering
                   ` (36 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Use XEN_LOCK_DIR because it is a compiletime setting.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/xendomains | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/hotplug/Linux/xendomains b/tools/hotplug/Linux/xendomains
index 0794bb9..c45f132 100644
--- a/tools/hotplug/Linux/xendomains
+++ b/tools/hotplug/Linux/xendomains
@@ -49,12 +49,7 @@ if ! [ -e /proc/xen/privcmd ]; then
 	exit 0
 fi
 
-# See docs/misc/distro_mapping.txt
-if [ -d /var/lock/subsys ]; then
-	LOCKFILE=/var/lock/subsys/xendomains
-else
-	LOCKFILE=/var/lock/xendomains
-fi
+LOCKFILE=${XEN_LOCK_DIR}/xendomains
 
 if [ -d /etc/sysconfig ]; then
 	XENDOM_CONFIG=/etc/sysconfig/xendomains

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 10/46] tools/examples: remove obsolete install targets
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (8 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
@ 2014-09-22 12:59 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 11/46] remove obsolete SUBSYS_DIR variable Olaf Hering
                   ` (35 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 12:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

install-hotplug and install-udev are obsolete since commit 57bcfa11
("tools/hotplug: Separate OS-specific scripts.")

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/examples/Makefile | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 86d9cc1..473580e 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -19,7 +19,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-readmes install-configs $(HOTPLUGS)
+install: all install-readmes install-configs
 
 .PHONY: install-readmes
 install-readmes:
@@ -41,24 +41,5 @@ install-configs: $(XEN_CONFIGS)
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
 	done
 
-.PHONY: install-hotplug
-install-hotplug:
-	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
-	set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
-	    do \
-	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
-	done
-
-.PHONY: install-udev
-install-udev:
-	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
-	set -e; for i in $(UDEV_RULES); \
-	    do \
-	    $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
-	    ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \
-	done
-
 .PHONY: clean
 clean:

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 11/46] remove obsolete SUBSYS_DIR variable
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (9 preceding siblings ...)
  2014-09-22 12:59 ` [PATCH 10/46] tools/examples: remove obsolete install targets Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 12/46] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
                   ` (34 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

/var/run is a runtime directory. It is not supposed to be packaged.
Remove unused SUBSYS_DIR variable from Config.mk and distro_mapping.txt.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk                    | 1 -
 docs/misc/distro_mapping.txt | 1 -
 2 files changed, 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 015b90b..7cbf392 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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,SUBSYS_DIR,/var/run,/subsys,/subsys,))
 $(eval $(call setvar_dir,INITD_DIR,/etc,/rc.d/init.d,/rc.d/init.d,/init.d))
 
 ifneq ($(EXTRA_PREFIX),)
diff --git a/docs/misc/distro_mapping.txt b/docs/misc/distro_mapping.txt
index f56e281..f849d07 100644
--- a/docs/misc/distro_mapping.txt
+++ b/docs/misc/distro_mapping.txt
@@ -5,7 +5,6 @@ other distros one needs to set the variables for the elements below
                  | Red Hat          |  Debian       |  Suse          |
 -----------------+------------------+---------------+----------------+
 CONFIG_LEAF_DIR  | sysconfig        | default       | sysconfig      |
-SUBSYS_DIR       | /var/run/subsys  | /var/run      | /var/run       |
 INITD_DIR        | /etc/rc.d/init.d | /etc/init.d   | /etc/init.d    |
 -----------------+------------------+---------------+----------------+

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 12/46] Config.mk: move directory list into BUILD_MAKE_VARS
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (10 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 11/46] remove obsolete SUBSYS_DIR variable Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 13/46] Config.mk: replace dependency to genpath with actual target Olaf Hering
                   ` (33 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

To maintain the list of directories in a single place, move the existing
list into its own variable and use it in buildmakevars2file.
Required for upcoming changes.
Trim also whitespaces.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7cbf392..3f96f8c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -166,16 +166,17 @@ 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 \
+                   XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
+                   XEN_RUN_DIR XEN_PAGING_DIR
+
 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 define buildmakevars2file-closure
     .PHONY: genpath
     genpath:
-	rm -f $(1).tmp;                                                     \
-	$(foreach var,                                                      \
-	          SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR     \
-	          XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
-	          XEN_RUN_DIR XEN_PAGING_DIR,                               \
-	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;)        \
+	rm -f $(1).tmp; \
+	$(foreach var, $(BUILD_MAKE_VARS), \
+	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
 	$(call move-if-changed,$(1).tmp,$(1))
 endef

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 13/46] Config.mk: replace dependency to genpath with actual target
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (11 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 12/46] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 15:59   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 14/46] Config.mk: add new macro buildmakevars2header Olaf Hering
                   ` (32 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

genpath is a detail of buildmakevars2file. Replace the dependency to
genpath with the actual buildmakevars2file target. This change by
itself does not fix any bug. Upcoming changes will add dependencies to
$(target), but no rule exist to create $(target).

To force a rebuild of the $(1) rule the target now depends on the
existing .phony target. This dummy target is already used elsewhere in
the code.

No change in behaviour is expected by this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk                     |  3 +--
 stubdom/Makefile              | 16 ++++++++--------
 tools/hotplug/common/Makefile |  2 +-
 tools/libxl/Makefile          |  2 +-
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/Config.mk b/Config.mk
index 3f96f8c..64982c6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -172,8 +172,7 @@ BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR \
 
 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 define buildmakevars2file-closure
-    .PHONY: genpath
-    genpath:
+    $(1): .phony
 	rm -f $(1).tmp; \
 	$(foreach var, $(BUILD_MAKE_VARS), \
 	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 88da991..1e96d67 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -48,18 +48,18 @@ TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
 TARGETS=$(STUBDOM_TARGETS)
 
+STUBDOMPATH="stubdompath.sh"
+genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
+$(eval $(genpath-target))
+
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath $(STUBDOM_BUILD)
+build: $(STUBDOMPATH) $(STUBDOM_BUILD)
 else
-build: genpath
+build: $(STUBDOMPATH)
 endif
 
-STUBDOMPATH="stubdompath.sh"
-genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
-$(eval $(genpath-target))
-
 ##############
 # Cross-newlib
 ##############
@@ -450,9 +450,9 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme $(STUBDOM_INSTALL)
+install: $(STUBDOMPATH) install-readme $(STUBDOM_INSTALL)
 else
-install: genpath
+install: $(STUBDOMPATH)
 endif
 
 install-readme:
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 18d87aa..657a8e3 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -16,7 +16,7 @@ $(eval $(genpath-target))
 all: build
 
 .PHONY: build
-build: genpath
+build: $(HOTPLUGPATH)
 
 .PHONY: install
 install: all install-scripts
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 990414b..9836b44 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -163,7 +163,7 @@ _%.api-for-check: %.h $(AUTOINCS)
 		>$@.new
 	mv -f $@.new $@
 
-_paths.h: genpath
+_paths.h: _paths.h.tmp
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
 	rm -f $@.tmp
 	$(call move-if-changed,$@.2.tmp,$@)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 14/46] Config.mk: add new macro buildmakevars2header
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (12 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 13/46] Config.mk: replace dependency to genpath with actual target Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 16:04   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 15/46] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
                   ` (31 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

This macro is similar to buildmakevars2file, it just creates a C header
file instead of shell style syntax. Upcoming changes will use this macro
in libxl and libxc.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Config.mk b/Config.mk
index 64982c6..4c3a2a7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -179,6 +179,15 @@ define buildmakevars2file-closure
 	$(call move-if-changed,$(1).tmp,$(1))
 endef
 
+buildmakevars2header = $(eval $(call buildmakevars2header-closure,$(1)))
+define buildmakevars2header-closure
+    $(1): .phony
+	rm -f $(1).tmp; \
+	$(foreach var, $(BUILD_MAKE_VARS), \
+	          echo "#define $(var) \"$($(var))\"" >>$(1).tmp;) \
+	$(call move-if-changed,$(1).tmp,$(1))
+endef
+
 ifeq ($(debug_symbols),y)
 CFLAGS += -g
 endif

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 15/46] tools/libxl: use buildmakevars2header to create _paths.h
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (13 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 14/46] Config.mk: add new macro buildmakevars2header Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 16/46] tools/libxc: provide variable paths to libxc Olaf Hering
                   ` (30 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Replace usage of buildmakevars2file with buildmakevars2header. The macro
generates a C header file, so remove code which converts shell variables
into C defines. Also update the dependency, the macro itself creates a
dependency for _paths.h. A temporary file is not needed anymore.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/Makefile | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 9836b44..9d67d0b 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -150,7 +150,7 @@ $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS) \
 	@rm -f $*.[ch]
 	$(FLEX) --header-file=$*.h --outfile=$*.c $<
 
-genpath-target = $(call buildmakevars2file,_paths.h.tmp)
+genpath-target = $(call buildmakevars2header,_paths.h)
 $(eval $(genpath-target))
 
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
@@ -163,11 +163,6 @@ _%.api-for-check: %.h $(AUTOINCS)
 		>$@.new
 	mv -f $@.new $@
 
-_paths.h: _paths.h.tmp
-	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
-	rm -f $@.tmp
-	$(call move-if-changed,$@.2.tmp,$@)
-
 _libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
 	$(PERL) $^ --prefix=libxl >$@.new
 	$(call move-if-changed,$@.new,$@)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 16/46] tools/libxc: provide variable paths to libxc
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (14 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 15/46] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 17/46] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
                   ` (29 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

In preparation to remove hardcoded /var/run/xen paths, provide
XEN_RUN_DIR and related directories to xc_private.h. Similar code exists
already for libxl, stubdom and other parts.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore               | 1 +
 tools/libxc/Makefile     | 9 +++++++++
 tools/libxc/xc_private.h | 1 +
 3 files changed, 11 insertions(+)

diff --git a/.gitignore b/.gitignore
index 8e34b85..0b10c94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -307,6 +307,7 @@ tools/include/xen-foreign/arm64.h
 .git
 tools/misc/xen-hptool
 tools/misc/xen-mfndump
+tools/libxc/_*.[ch]
 tools/libxl/_*.[ch]
 tools/libxl/testidl
 tools/libxl/testidl.c
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 3b04027..3c390f8 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -122,6 +122,14 @@ ifneq ($(nosharedlibs),y)
 LIB += xenctrl_osdep_ENOSYS.so
 endif
 
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
+xc_private.h: _paths.h
+
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS): xc_private.h
+
 .PHONY: all
 all: build
 
@@ -154,6 +162,7 @@ TAGS:
 .PHONY: clean
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) \
+            _paths.h \
             $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
             $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
             $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 94df688..010e00f 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 
+#include "_paths.h"
 #include "xenctrl.h"
 #include "xenctrlosdep.h"

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 17/46] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (15 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 16/46] tools/libxc: provide variable paths to libxc Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR Olaf Hering
                   ` (28 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Remove hardcoded /var/run/xen directory path, use XEN_RUN_DIR instead.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_suspend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxc/xc_suspend.c b/tools/libxc/xc_suspend.c
index 200d381..e22f4ac 100644
--- a/tools/libxc/xc_suspend.c
+++ b/tools/libxc/xc_suspend.c
@@ -20,7 +20,7 @@
 #include "xc_private.h"
 #include "xenguest.h"
 
-#define SUSPEND_LOCK_FILE "/var/run/xen/suspend-evtchn-%d.lock"
+#define SUSPEND_LOCK_FILE    XEN_RUN_DIR "/suspend-evtchn-%d.lock"
 
 /*
  * locking

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (16 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 17/46] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 16:13   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 19/46] Add configure --with-initd-dir=DIR Olaf Hering
                   ` (27 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Preserve existing behaviour: if the option was not given, set existing
defaults for FreeBSD, Solaris and everything else.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/FreeBSD.mk |  2 --
 config/StdGNU.mk  |  1 -
 config/SunOS.mk   |  5 -----
 m4/paths.m4       | 21 ++++++++++++++++++++-
 4 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/config/FreeBSD.mk b/config/FreeBSD.mk
index 1b4c74c..5a13d607 100644
--- a/config/FreeBSD.mk
+++ b/config/FreeBSD.mk
@@ -4,5 +4,3 @@ DLOPEN_LIBS =
 
 # No wget on FreeBSD base system
 WGET = ftp
-
-CONFIG_DIR = $(PREFIX)/etc
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index c6439f6..ddf83d7 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -41,7 +41,6 @@ XENFIRMWAREDIR = $(PREFIX)/lib/xen/boot
 PRIVATE_PREFIX = $(LIBDIR)/xen
 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
 
-CONFIG_DIR = /etc
 XEN_LOCK_DIR = /var/lock
 XEN_RUN_DIR = /var/run/xen
 XEN_PAGING_DIR = /var/lib/xen/xenpaging
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 50c60fe..d493eca 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -31,11 +31,6 @@ XENFIRMWAREDIR = $(LIBDIR)/xen/boot
 PRIVATE_PREFIX = $(LIBDIR)/xen
 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
 
-ifeq ($(PREFIX),/usr)
-CONFIG_DIR = /etc
-else
-CONFIG_DIR = $(PREFIX)/etc
-endif
 XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
 XEN_SCRIPT_DIR = $(PRIVATE_PREFIX)/scripts
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index eac50af..47edca5 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -3,6 +3,25 @@ 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 
+if test "x$sysconfdir" = 'x${prefix}/etc' ; then
+    case "$host_os" in
+         *freebsd*)
+         sysconfdir=$prefix/etc
+         ;;
+         *solaris*)
+         if test "$prefix" = "/usr" ; then
+             sysconfdir=/etc
+         else
+             sysconfdir=$prefix/etc
+         fi
+         ;;
+         *)
+         sysconfdir=/etc
+         ;;
+    esac
+fi
+
 BINDIR=$prefix/bin
 AC_SUBST(BINDIR)
 
@@ -41,7 +60,7 @@ AC_SUBST(PRIVATE_BINDIR)
 XENFIRMWAREDIR=$prefix/lib/xen/boot
 AC_SUBST(XENFIRMWAREDIR)
 
-CONFIG_DIR=/etc
+CONFIG_DIR=$sysconfdir
 AC_SUBST(CONFIG_DIR)
 
 XEN_CONFIG_DIR=$CONFIG_DIR/xen

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (17 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 16:22   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 20/46] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
                   ` (26 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk                    |  1 -
 config/Paths.mk.in           |  1 +
 docs/misc/distro_mapping.txt |  3 +--
 m4/paths.m4                  | 20 ++++++++++++++++++++
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 4c3a2a7..fc2e312 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 507b6d1..c01d0ef 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -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@
 
diff --git a/docs/misc/distro_mapping.txt b/docs/misc/distro_mapping.txt
index f849d07..a4dea45 100644
--- a/docs/misc/distro_mapping.txt
+++ b/docs/misc/distro_mapping.txt
@@ -13,8 +13,7 @@ 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 path can be changed with configure --with-initd-dir=DIR
 
 To add support for new distributions that don't use the above locations,
 one must grep for the above elements and add appropriate checks.
diff --git a/m4/paths.m4 b/m4/paths.m4
index 47edca5..d33a9e6 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -22,6 +22,23 @@ if test "x$sysconfdir" = 'x${prefix}/etc' ; then
     esac
 fi
 
+AC_ARG_WITH([initd-dir],
+    AS_HELP_STRING([--with-initd-dir=DIR],
+    [Path to directory with sysv runlevel scripts. [PREFIX/etc/init.d]]),
+    [initd_dir_path=$withval],
+    [case "$host_os" in
+         *linux*)
+         if test -d $sysconfdir/rc.d/init.d ; then
+             initd_dir_path=$sysconfdir/rc.d/init.d
+         else
+             initd_dir_path=$sysconfdir/init.d
+         fi
+         ;;
+         *)
+         initd_dir_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=$initd_dir_path
+AC_SUBST(INITD_DIR)
+
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 AC_SUBST(XEN_CONFIG_DIR)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 20/46] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (18 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 19/46] Add configure --with-initd-dir=DIR Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 16:27   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 21/46] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
                   ` (25 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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
likely a typo introduced by 9f6d07bac9f14aaa8bafe38b4a217e61a3a57842
("tools: get rid of hardcoded config dirs")

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 .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(-)

diff --git a/.gitignore b/.gitignore
index 0b10c94..9630e27 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index ddf83d7..4cc3a01 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -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
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index d493eca..1470514 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -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
 
diff --git a/tools/configure.ac b/tools/configure.ac
index f44b9f3..7e1991a 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -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([../])
diff --git a/tools/hotplug/Linux/init.d/xen-watchdog b/tools/hotplug/Linux/init.d/xen-watchdog.in
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
--- a/tools/hotplug/Linux/init.d/xen-watchdog
+++ b/tools/hotplug/Linux/init.d/xen-watchdog.in
@@ -17,7 +17,7 @@
 ### END INIT INFO
 #
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 DAEMON=${SBINDIR}/xenwatchdogd
 base=$(basename $DAEMON)
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
index a723eb4..bd1d9ba 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in.in
@@ -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
diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains.in
similarity index 97%
rename from tools/hotplug/Linux/init.d/xendomains
rename to tools/hotplug/Linux/init.d/xendomains.in
index 3857602..5b88e2d 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains.in
@@ -24,7 +24,7 @@
 #                    systemd systems.
 ### END INIT INFO
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 case "$1" in
     start)
diff --git a/tools/hotplug/Linux/vif-setup b/tools/hotplug/Linux/vif-setup.in
similarity index 61%
rename from tools/hotplug/Linux/vif-setup
rename to tools/hotplug/Linux/vif-setup.in
index bcc462e..c3bc662 100644
--- a/tools/hotplug/Linux/vif-setup
+++ b/tools/hotplug/Linux/vif-setup.in
@@ -4,6 +4,6 @@ if test "$script"
 then
     exec $script $*
 else
-    exec /etc/xen/scripts/vif-bridge $*
+    exec @XEN_SCRIPT_DIR@/vif-bridge $*
 fi
 
diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules.in
similarity index 62%
rename from tools/hotplug/Linux/xen-backend.rules
rename to tools/hotplug/Linux/xen-backend.rules.in
index a0d409e..7d2f914 100644
--- a/tools/hotplug/Linux/xen-backend.rules
+++ b/tools/hotplug/Linux/xen-backend.rules.in
@@ -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"
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh b/tools/hotplug/Linux/xen-hotplug-common.sh.in
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
--- a/tools/hotplug/Linux/xen-hotplug-common.sh
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
@@ -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
 }
diff --git a/tools/hotplug/Linux/xendomains b/tools/hotplug/Linux/xendomains.in
similarity index 99%
rename from tools/hotplug/Linux/xendomains
rename to tools/hotplug/Linux/xendomains.in
index c45f132..de711b7 100644
--- a/tools/hotplug/Linux/xendomains
+++ b/tools/hotplug/Linux/xendomains.in
@@ -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"

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 21/46] tools/configure.ac: sort AC_CONFIG_FILES
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (19 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 20/46] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 16:38   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 22/46] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
                   ` (24 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/configure.ac | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index 7e1991a..d91fa6f 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -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

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 22/46] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (20 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 21/46] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23  9:23   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 23/46] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
                   ` (23 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Makefile                       | 4 ++--
 tools/hotplug/FreeBSD/Makefile | 4 ++--
 tools/hotplug/NetBSD/Makefile  | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 580df64..7558262 100644
--- a/Makefile
+++ b/Makefile
@@ -211,8 +211,8 @@ 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 -rf $(D)$(INITD_DIR)/xendomains $(D)$(INITD_DIR)/xend
+	rm -rf $(D)$(INITD_DIR)/xencommons $(D)$(INITD_DIR)/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
diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 6480aa5..e21f046 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -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)
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index fc61162..9084859 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -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:

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 23/46] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (21 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 22/46] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23  9:24   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 24/46] remove duplicate variables from config Olaf Hering
                   ` (22 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Also remove DESTDIR from the path, this was most likely not intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 .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(-)

diff --git a/.gitignore b/.gitignore
index 9630e27..f9d250f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/tools/configure.ac b/tools/configure.ac
index d91fa6f..bcc8a93 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -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
diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index e21f046..169a124 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -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)
 
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons b/tools/hotplug/FreeBSD/rc.d/xencommons.in
similarity index 98%
rename from tools/hotplug/FreeBSD/rc.d/xencommons
rename to tools/hotplug/FreeBSD/rc.d/xencommons.in
index 2d9034c..8b051ec 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -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

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 24/46] remove duplicate variables from config
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (22 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 23/46] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23  9:25   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 25/46] Use configure --mandir=DIR to set MANDIR Olaf Hering
                   ` (21 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 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(-)

diff --git a/Config.mk b/Config.mk
index fc2e312..75282d7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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
diff --git a/config/NetBSD.mk b/config/NetBSD.mk
index 141de7c..21318d6 100644
--- a/config/NetBSD.mk
+++ b/config/NetBSD.mk
@@ -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
diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
index 8daade8..2a87218 100644
--- a/config/NetBSDRump.mk
+++ b/config/NetBSDRump.mk
@@ -3,8 +3,6 @@ include $(XEN_ROOT)/config/StdGNU.mk
 DLOPEN_LIBS =
 PTHREAD_LIBS =
 
-XEN_LOCK_DIR = /var/lib
-
 WGET = ftp
 
 XENSTORE_XENSTORED=n
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index c01d0ef..4bded93 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -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@
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 4cc3a01..dd6170c 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -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 =
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 1470514..92bde78 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -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
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index d33a9e6..0255966 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -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

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 25/46] Use configure --mandir=DIR to set MANDIR
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (23 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 24/46] remove duplicate variables from config Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23  9:32   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 26/46] Use configure --docdir=DIR to set DOCDIR Olaf Hering
                   ` (20 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk          | 1 -
 config/Paths.mk.in | 1 +
 config/StdGNU.mk   | 1 -
 config/SunOS.mk    | 1 -
 m4/paths.m4        | 4 ++++
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 75282d7..bb190f0 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 4bded93..fe9ce8e 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -17,6 +17,7 @@ BINDIR                   := @BINDIR@
 LIBEXEC                  := @LIBEXEC@
 
 SHAREDIR                 := @SHAREDIR@
+MANDIR                   := @MANDIR@
 LIBDIR                   := @LIBDIR@
 
 XEN_RUN_DIR              := @XEN_RUN_DIR@
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index dd6170c..d6175c0 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -29,7 +29,6 @@ INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
 INCLUDEDIR = $(PREFIX)/include
-MANDIR = $(SHAREDIR)/man
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 92bde78..94103fc 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -21,7 +21,6 @@ INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
 INCLUDEDIR = $(PREFIX)/include
-MANDIR = $(PREFIX)/share/man
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index 0255966..5e90eb4 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -68,6 +68,10 @@ AC_SUBST(XEN_LIB_STORED)
 SHAREDIR=$prefix/share
 AC_SUBST(SHAREDIR)
 
+dnl double eval because default mandir includes datarootdir, which includes prefix
+MANDIR=`eval eval echo $mandir`
+AC_SUBST(MANDIR)
+
 PRIVATE_PREFIX=$LIBDIR/xen
 AC_SUBST(PRIVATE_PREFIX)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 26/46] Use configure --docdir=DIR to set DOCDIR
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (24 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 25/46] Use configure --mandir=DIR to set MANDIR Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 27/46] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
                   ` (19 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk          | 1 -
 config/Paths.mk.in | 1 +
 m4/paths.m4        | 4 ++++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index bb190f0..3353a71 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index fe9ce8e..d369944 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -18,6 +18,7 @@ LIBEXEC                  := @LIBEXEC@
 
 SHAREDIR                 := @SHAREDIR@
 MANDIR                   := @MANDIR@
+DOCDIR                   := @DOCDIR@
 LIBDIR                   := @LIBDIR@
 
 XEN_RUN_DIR              := @XEN_RUN_DIR@
diff --git a/m4/paths.m4 b/m4/paths.m4
index 5e90eb4..b36a336 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -72,6 +72,10 @@ dnl double eval because default mandir includes datarootdir, which includes pref
 MANDIR=`eval eval echo $mandir`
 AC_SUBST(MANDIR)
 
+dnl double eval because default docdir includes datarootdir, which includes prefix
+DOCDIR=`eval eval echo $docdir`
+AC_SUBST(DOCDIR)
+
 PRIVATE_PREFIX=$LIBDIR/xen
 AC_SUBST(PRIVATE_PREFIX)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 27/46] Use configure --includedir=DIR to set INCLUDEDIR
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (25 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 26/46] Use configure --docdir=DIR to set DOCDIR Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
                   ` (18 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/Paths.mk.in | 1 +
 config/StdGNU.mk   | 1 -
 config/SunOS.mk    | 1 -
 m4/paths.m4        | 3 +++
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index d369944..4b6ac36 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -16,6 +16,7 @@ SBINDIR                  := @SBINDIR@
 BINDIR                   := @BINDIR@
 LIBEXEC                  := @LIBEXEC@
 
+INCLUDEDIR               := @INCLUDEDIR@
 SHAREDIR                 := @SHAREDIR@
 MANDIR                   := @MANDIR@
 DOCDIR                   := @DOCDIR@
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index d6175c0..f2c3dfa 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -28,7 +28,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-INCLUDEDIR = $(PREFIX)/include
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 94103fc..4b08fee 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -20,7 +20,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-INCLUDEDIR = $(PREFIX)/include
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index b36a336..9b3dc59 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -45,6 +45,9 @@ AC_SUBST(BINDIR)
 SBINDIR=$prefix/sbin
 AC_SUBST(SBINDIR)
 
+INCLUDEDIR=`eval echo $includedir`
+AC_SUBST(INCLUDEDIR)
+
 dnl XXX: this should be changed to use the passed $libexec
 dnl but can be done as a second step
 case "$host_os" in

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (26 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 27/46] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23  9:45   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 29/46] Use configure --prefix=DIR to set PREFIX Olaf Hering
                   ` (17 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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

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.

An internal libxl function was removed. A single helper to retrieve
LIBEXEC_BIN remains.

As suggested by the docs, 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.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk                                          |  2 +-
 config/Paths.mk.in                                 |  6 ++--
 m4/paths.m4                                        | 34 ++++++++++++----------
 stubdom/Makefile                                   |  6 ++--
 tools/Makefile                                     | 10 +++----
 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/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 +--
 29 files changed, 75 insertions(+), 79 deletions(-)

diff --git a/Config.mk b/Config.mk
index 3353a71..c8dac4c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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
 
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 4b6ac36..2ff017a 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -15,6 +15,9 @@
 SBINDIR                  := @SBINDIR@
 BINDIR                   := @BINDIR@
 LIBEXEC                  := @LIBEXEC@
+LIBEXEC_BIN              := @LIBEXEC_BIN@
+LIBEXEC_LIB              := @LIBEXEC_LIB@
+LIBEXEC_INC              := @LIBEXEC_INC@
 
 INCLUDEDIR               := @INCLUDEDIR@
 SHAREDIR                 := @SHAREDIR@
@@ -31,9 +34,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@
diff --git a/m4/paths.m4 b/m4/paths.m4
index 9b3dc59..d21850b 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -48,13 +48,25 @@ AC_SUBST(SBINDIR)
 INCLUDEDIR=`eval echo $includedir`
 AC_SUBST(INCLUDEDIR)
 
-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
+if test "x$libexecdir" = 'x${exec_prefix}/libexec' ; then
+    case "$host_os" in
+         *netbsd*)
+         libexecdir=$prefix/libexec
+         ;;
+         *)
+         libexecdir=$prefix/lib
+         ;;
+    esac
+fi
+dnl %configure uses --libexec=%libdir, so append package name
+LIBEXEC=`eval echo $libexecdir/xen`
+LIBEXEC_BIN=$LIBEXEC/bin
+LIBEXEC_LIB=$LIBEXEC/lib
+LIBEXEC_INC=$LIBEXEC/include
 AC_SUBST(LIBEXEC)
+AC_SUBST(LIBEXEC_BIN)
+AC_SUBST(LIBEXEC_LIB)
+AC_SUBST(LIBEXEC_INC)
 
 LIBDIR=`eval echo $libdir`
 AC_SUBST(LIBDIR)
@@ -79,16 +91,6 @@ dnl double eval because default docdir includes datarootdir, which includes pref
 DOCDIR=`eval eval echo $docdir`
 AC_SUBST(DOCDIR)
 
-PRIVATE_PREFIX=$LIBDIR/xen
-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)
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 1e96d67..c072709 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -460,9 +460,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"
 
diff --git a/tools/Makefile b/tools/Makefile
index b6476c9..7e5d4ce 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -86,7 +86,7 @@ uninstall:
 	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
@@ -187,9 +187,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 \
@@ -199,7 +199,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 \
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 3e38252..6e55618 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -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)
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons.in b/tools/hotplug/FreeBSD/rc.d/xencommons.in
index 8b051ec..c73616e 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -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()
diff --git a/tools/hotplug/FreeBSD/vif-bridge b/tools/hotplug/FreeBSD/vif-bridge
index fa7570d..d350df4 100644
--- a/tools/hotplug/FreeBSD/vif-bridge
+++ b/tools/hotplug/FreeBSD/vif-bridge
@@ -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
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index d5a9ed2..4361f68 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -54,8 +54,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)
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
index bd1d9ba..590f745 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in.in
@@ -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
diff --git a/tools/hotplug/Linux/init.d/xendomains.in b/tools/hotplug/Linux/init.d/xendomains.in
index 5b88e2d..dcd330c 100644
--- a/tools/hotplug/Linux/init.d/xendomains.in
+++ b/tools/hotplug/Linux/init.d/xendomains.in
@@ -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}"
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 8dbd110..806bcaa 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -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
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 70ce7c0..f88c336 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -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
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh.in b/tools/hotplug/Linux/xen-hotplug-common.sh.in
index 996e974..1deafe1 100644
--- a/tools/hotplug/Linux/xen-hotplug-common.sh.in
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
@@ -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)
diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block
index f1146b5..b2e9af5 100644
--- a/tools/hotplug/NetBSD/block
+++ b/tools/hotplug/NetBSD/block
@@ -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() {
diff --git a/tools/hotplug/NetBSD/rc.d/xencommons b/tools/hotplug/NetBSD/rc.d/xencommons
index 7ac87e2..793bede 100644
--- a/tools/hotplug/NetBSD/rc.d/xencommons
+++ b/tools/hotplug/NetBSD/rc.d/xencommons
@@ -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()
diff --git a/tools/hotplug/NetBSD/vif-bridge b/tools/hotplug/NetBSD/vif-bridge
index 64162a8..960303e 100644
--- a/tools/hotplug/NetBSD/vif-bridge
+++ b/tools/hotplug/NetBSD/vif-bridge
@@ -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
diff --git a/tools/hotplug/NetBSD/vif-ip b/tools/hotplug/NetBSD/vif-ip
index 583e277..28c43de 100644
--- a/tools/hotplug/NetBSD/vif-ip
+++ b/tools/hotplug/NetBSD/vif-ip
@@ -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
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 9d67d0b..175bd3c 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -239,10 +239,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
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 103cbca..dfef00f 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -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);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index f61673c..e13a37e 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -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);
diff --git a/tools/libxl/libxl_paths.c b/tools/libxl/libxl_paths.c
index 14b28d1..9b7b0d5 100644
--- a/tools/libxl/libxl_paths.c
+++ b/tools/libxl/libxl_paths.c
@@ -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)
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index 1c9f806..40b25e4 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -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++)
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 69b1817..97e3fe6 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -43,10 +43,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
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index a37a8b1..3dff608 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -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
diff --git a/tools/vtpmmgr/Makefile b/tools/vtpmmgr/Makefile
index 8890b06..b14c170 100644
--- a/tools/vtpmmgr/Makefile
+++ b/tools/vtpmmgr/Makefile
@@ -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
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 98706bf..c2e314d 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -32,8 +32,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
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index fedd0fb..a73cd3a 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -24,8 +24,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)
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 63b09c0..b821952 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -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)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 29/46] Use configure --prefix=DIR to set PREFIX
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (27 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:14   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
                   ` (16 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/StdGNU.mk | 1 -
 config/SunOS.mk  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index f2c3dfa..97faee8 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -27,7 +27,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-PREFIX ?= /usr
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 4b08fee..9c1a48d 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -19,7 +19,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-PREFIX ?= /usr
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (28 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 29/46] Use configure --prefix=DIR to set PREFIX Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:18   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 31/46] Add configure --enable-rpath Olaf Hering
                   ` (15 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

This is helpful to test make uninstall with --prefix=/private/dir as
unprivileged user. No change in behaviour is expected by this change.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 m4/paths.m4 | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/m4/paths.m4 b/m4/paths.m4
index d21850b..deb9196 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -2,6 +2,9 @@ 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}
+if test "x$localstatedir" = 'x${prefix}/var' ; then
+    localstatedir=/var
+fi
 
 dnl 
 if test "x$sysconfdir" = 'x${prefix}/etc' ; then
@@ -71,13 +74,13 @@ AC_SUBST(LIBEXEC_INC)
 LIBDIR=`eval echo $libdir`
 AC_SUBST(LIBDIR)
 
-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
@@ -107,15 +110,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)
 ])

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 31/46] Add configure --enable-rpath
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (29 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:23   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
                   ` (14 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk                      |  3 +++
 config/Tools.mk.in             |  2 ++
 tools/Makefile                 | 15 +++++++++++++--
 tools/configure.ac             |  1 +
 tools/ocaml/xenstored/Makefile |  1 +
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index c8dac4c..3947e85 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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)
+APPEND_LDFLAGS += -Wl,-rpath,$(LIBDIR)
+endif
 APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i))
 APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 974e28e..5126bb1 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -43,6 +43,8 @@ PTHREAD_LIBS        := @PTHREAD_LIBS@
 
 PTYFUNCS_LIBS       := @PTYFUNCS_LIBS@
 
+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
 # may block it). We make it the default, but if your GIT repository downloads
diff --git a/tools/Makefile b/tools/Makefile
index 7e5d4ce..0988020 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -111,6 +111,14 @@ IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
 			 --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
@@ -146,7 +154,9 @@ subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(QEMU_ROOT)/xen-setup \
+		$(IOEMU_EXTRA_LDFLAGS) \
+		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) all
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -155,6 +165,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) \
 		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) install
 
@@ -198,7 +209,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=/var \
diff --git a/tools/configure.ac b/tools/configure.ac
index bcc8a93..013f04d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -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])
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 068e04a..18dedf7 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -8,6 +8,7 @@ LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
 
 CFLAGS  += $(CFLAGS-y)
 LDFLAGS += $(LDFLAGS-y)
+LDFLAGS += $(APPEND_LDFLAGS)
 
 OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xb \

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (30 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 31/46] Add configure --enable-rpath Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:28   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 33/46] Add configure --with-bash_completion-dir=DIR Olaf Hering
                   ` (13 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 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               | 33 +++-----------------
 tools/hotplug/Linux/update-modules.sh              | 36 ----------------------
 8 files changed, 48 insertions(+), 108 deletions(-)

diff --git a/README b/README
index 81bf938..3203d8a 100644
--- a/README
+++ b/README
@@ -231,15 +231,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
diff --git a/config/Linux.modules b/config/Linux.modules
deleted file mode 100644
index 8a764df..0000000
--- a/config/Linux.modules
+++ /dev/null
@@ -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
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 5126bb1..23ae8b1 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -71,6 +71,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@
diff --git a/tools/configure.ac b/tools/configure.ac
index 013f04d..7c0181c 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -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],
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 4361f68..e6e7bcb 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -35,23 +35,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)
@@ -63,7 +57,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); \
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in
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
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -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}
 
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index dc98b67..ac20c76 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -37,31 +37,8 @@ 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):
+	for mod in $(LINUX_BACKEND_MODULES) ; do \
+		echo $$mod ; \
+		done > $@.tmp ; \
+	$(call move-if-changed,$@.tmp,$@)
diff --git a/tools/hotplug/Linux/update-modules.sh b/tools/hotplug/Linux/update-modules.sh
deleted file mode 100755
index 692d220..0000000
--- a/tools/hotplug/Linux/update-modules.sh
+++ /dev/null
@@ -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

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 33/46] Add configure --with-bash_completion-dir=DIR
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (31 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:32   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 34/46] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
                   ` (12 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk          | 2 --
 config/Paths.mk.in | 1 +
 m4/paths.m4        | 7 +++++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 3947e85..4eae6d2 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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)
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 2ff017a..c2a6d91 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -31,6 +31,7 @@ XEN_LIB_STORED           := @XEN_LIB_STORED@
 
 CONFIG_DIR               := @CONFIG_DIR@
 INITD_DIR                := @INITD_DIR@
+BASH_COMPLETION_DIR      := @BASH_COMPLETION_DIR@
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index deb9196..664b434 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -42,6 +42,13 @@ AC_ARG_WITH([initd-dir],
          ;;
      esac])
 
+AC_ARG_WITH([bash_completion-dir],
+    AS_HELP_STRING([--with-bash_completion-dir=DIR],
+    [Path to directory with sysv runlevel scripts. [SYSCONFDIR/bash_completion.d]]),
+    [BASH_COMPLETION_DIR=$withval],
+    [BASH_COMPLETION_DIR=$sysconfdir/bash_completion.d])
+AC_SUBST(BASH_COMPLETION_DIR)
+
 BINDIR=$prefix/bin
 AC_SUBST(BINDIR)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 34/46] Make XENFIRMWAREDIR a subdir of libexecdir
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (32 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 33/46] Add configure --with-bash_completion-dir=DIR Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:33   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk Olaf Hering
                   ` (11 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/Paths.mk.in | 2 +-
 m4/paths.m4        | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index c2a6d91..518cf1d 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -35,7 +35,7 @@ BASH_COMPLETION_DIR      := @BASH_COMPLETION_DIR@
 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@
diff --git a/m4/paths.m4 b/m4/paths.m4
index 664b434..f89378c 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -73,10 +73,12 @@ LIBEXEC=`eval echo $libexecdir/xen`
 LIBEXEC_BIN=$LIBEXEC/bin
 LIBEXEC_LIB=$LIBEXEC/lib
 LIBEXEC_INC=$LIBEXEC/include
+LIBEXEC_BOOT=$LIBEXEC/boot
 AC_SUBST(LIBEXEC)
 AC_SUBST(LIBEXEC_BIN)
 AC_SUBST(LIBEXEC_LIB)
 AC_SUBST(LIBEXEC_INC)
+AC_SUBST(LIBEXEC_BOOT)
 
 LIBDIR=`eval echo $libdir`
 AC_SUBST(LIBDIR)
@@ -101,9 +103,6 @@ dnl double eval because default docdir includes datarootdir, which includes pref
 DOCDIR=`eval eval echo $docdir`
 AC_SUBST(DOCDIR)
 
-XENFIRMWAREDIR=$prefix/lib/xen/boot
-AC_SUBST(XENFIRMWAREDIR)
-
 CONFIG_DIR=$sysconfdir
 AC_SUBST(CONFIG_DIR)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (33 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 34/46] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:33   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 36/46] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
                   ` (10 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 m4/systemd.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index 760bbad..9569f14 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -65,7 +65,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
 	    dnl files. It would also be best to just extend the upstream
 	    dnl pkg-config  pkg.m4 with an AC_DEFUN() to do this neatly.
 	    dnl SYSTEMD_DIR="`$PKG_CONFIG --define-variable=prefix=$PREFIX --variable=systemdsystemunitdir systemd`"
-	    SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
+	    SYSTEMD_DIR="\$(PREFIX)/lib/systemd/system/"
 	], [])
 
 	AS_IF([test "x$SYSTEMD_DIR" = x], [
@@ -74,7 +74,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
 
 	dnl There is no variable for this yet for some reason
 	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
-	    SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
+	    SYSTEMD_MODULES_LOAD="\$(PREFIX)/lib/modules-load.d/"
 	], [])
 
 	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 36/46] tools: remove private copies of includedir and libdir from libxenstat
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (34 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:34   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build Olaf Hering
                   ` (9 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

They are wrong and unused.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/xenstat/libxenstat/Makefile | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index f64a45c..86068cb 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -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

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (35 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 36/46] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:37   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 38/46] Move xenconsoled to libexec Olaf Hering
                   ` (8 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

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

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/Docs.mk.in    | 7 -------
 config/Paths.mk.in   | 2 ++
 config/Stubdom.mk.in | 8 --------
 config/Tools.mk.in   | 7 -------
 docs/Makefile        | 1 +
 stubdom/Makefile     | 1 +
 tools/Rules.mk       | 2 +-
 7 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/config/Docs.mk.in b/config/Docs.mk.in
index 497650f..22537d7 100644
--- a/config/Docs.mk.in
+++ b/config/Docs.mk.in
@@ -1,10 +1,3 @@
-# Prefix and install folder
-prefix              := @prefix@
-PREFIX              := $(prefix)
-exec_prefix         := @exec_prefix@
-libdir              := @libdir@
-LIBDIR              := $(libdir)
-
 # Tools
 FIG2DEV             := @FIG2DEV@
 POD2MAN             := @POD2MAN@
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 518cf1d..0d5972d 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -12,6 +12,8 @@
 #
 # http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration
 
+PREFIX                   := @prefix@
+
 SBINDIR                  := @SBINDIR@
 BINDIR                   := @BINDIR@
 LIBEXEC                  := @LIBEXEC@
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index c1c83bc..1b830eb 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -1,11 +1,3 @@
-# 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@
 FETCHER             := @FETCHER@
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 23ae8b1..e90578b 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -3,13 +3,6 @@ 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@
 
diff --git a/docs/Makefile b/docs/Makefile
index 2c0903b..2518b5f 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,4 +1,5 @@
 XEN_ROOT=$(CURDIR)/..
+-include $(XEN_ROOT)/config/Paths.mk
 include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Docs.mk
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index c072709..4236574 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -5,6 +5,7 @@ export XEN_OS=MiniOS
 
 export stubdom=y
 export debug=y
+-include $(XEN_ROOT)/config/Paths.mk
 include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Stubdom.mk
 
diff --git a/tools/Rules.mk b/tools/Rules.mk
index fa59365..167cc83 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -3,9 +3,9 @@
 # `all' is the default target
 all:
 
+-include $(XEN_ROOT)/config/Paths.mk
 -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

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 38/46] Move xenconsoled to libexec
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (36 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:40   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 39/46] Move xenstored " Olaf Hering
                   ` (7 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

xenconsoled is started by runlevel scripts, its not supposed to be
called by admin.  So move it out of the way into LIBEXEC_BIN.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/console/Makefile                             | 3 +--
 tools/hotplug/FreeBSD/rc.d/xencommons.in           | 6 +++---
 tools/hotplug/Linux/init.d/xencommons.in           | 2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in | 2 +-
 tools/hotplug/NetBSD/rc.d/xencommons               | 6 +++---
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/tools/console/Makefile b/tools/console/Makefile
index 6e55618..fc3af74 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -30,9 +30,8 @@ xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
 
 .PHONY: install
 install: $(BIN)
-	$(INSTALL_DIR) $(DESTDIR)/$(SBINDIR)
-	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(LIBEXEC_BIN)
 	$(INSTALL_PROG) xenconsole $(DESTDIR)$(LIBEXEC_BIN)
 
 -include $(DEPS)
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons.in b/tools/hotplug/FreeBSD/rc.d/xencommons.in
index c73616e..88ff5b0 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -60,7 +60,7 @@ xen_startcmd()
 		XENCONSOLED_ARGS="${XENCONSOLED_ARGS} --log=${XENCONSOLED_TRACE}"
 	fi
 
-	${SBINDIR}/xenconsoled ${XENCONSOLED_ARGS}
+	${LIBEXEC_BIN}/xenconsoled ${XENCONSOLED_ARGS}
 
 	printf "\n"
 
@@ -74,7 +74,7 @@ xen_stop()
 	printf "Stopping xencommons.\n"
 	printf "WARNING: Not stopping xenstored, as it cannot be restarted.\n"
 
-	rc_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	rc_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${LIBEXEC_BIN}/xenconsoled)
 	pids="$pids $rc_pid"
 
 	kill -${sig_stop:-TERM} $pids
@@ -88,7 +88,7 @@ xen_status()
 		pids="$pids $xenstored_pid"
 	fi
 
-	xenconsoled_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	xenconsoled_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${LIBEXEC_BIN}/xenconsoled)
 	if test -n ${xenconsoled_pid}; then
 		pids="$pids $xenconsoled_pid"
 	fi
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 10edf29..6595fbf 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -100,7 +100,7 @@ do_start () {
 
 	echo Starting xenconsoled...
 	test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
-	${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
+	${LIBEXEC_BIN}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
 	echo Starting QEMU as disk backend for dom0
 	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386"
 	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 15fad35..0aa34fa 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -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=@LIBEXEC_BIN@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
 
 [Install]
 WantedBy=multi-user.target
diff --git a/tools/hotplug/NetBSD/rc.d/xencommons b/tools/hotplug/NetBSD/rc.d/xencommons
index 793bede..16ec79b 100644
--- a/tools/hotplug/NetBSD/rc.d/xencommons
+++ b/tools/hotplug/NetBSD/rc.d/xencommons
@@ -64,7 +64,7 @@ xen_startcmd()
 		XENCONSOLED_ARGS="${XENCONSOLED_ARGS} --log=${XENCONSOLED_TRACE}"
 	fi
 
-	${SBINDIR}/xenconsoled ${XENCONSOLED_ARGS}
+	${LIBEXEC_BIN}/xenconsoled ${XENCONSOLED_ARGS}
 
 	printf "\n"
 
@@ -78,7 +78,7 @@ xen_stop()
 	printf "Stopping xencommons.\n"
 	printf "WARNING: Not stopping xenstored, as it cannot be restarted.\n"
 
-	rc_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	rc_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${LIBEXEC_BIN}/xenconsoled)
 	pids="$pids $rc_pid"
 
 	kill -${sig_stop:-TERM} $pids
@@ -92,7 +92,7 @@ xen_status()
 		pids="$pids $xenstored_pid"
 	fi
 
-	xenconsoled_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	xenconsoled_pid=$(check_pidfile ${XENCONSOLED_PIDFILE} ${LIBEXEC_BIN}/xenconsoled)
 	if test -n ${xenconsoled_pid}; then
 		pids="$pids $xenconsoled_pid"
 	fi

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 39/46] Move xenstored to libexec
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (37 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 38/46] Move xenconsoled to libexec Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:41   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 40/46] Move xenwatchdogd " Olaf Hering
                   ` (6 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

xenstored is started by runlevel scripts, its not supposed to be
called by admin.  So move it out of the way into LIBEXEC_BIN.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 m4/xenstored.m4                                    | 8 ++++----
 tools/hotplug/FreeBSD/rc.d/xencommons.in           | 6 +++---
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in | 4 ++--
 tools/hotplug/NetBSD/rc.d/xencommons               | 6 +++---
 tools/ocaml/xenstored/Makefile                     | 4 ++--
 tools/xenstore/Makefile                            | 4 ++--
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/m4/xenstored.m4 b/m4/xenstored.m4
index 30b44c9..bbc8082 100644
--- a/m4/xenstored.m4
+++ b/m4/xenstored.m4
@@ -6,10 +6,10 @@ AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
 
 AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [
 	xenstore="oxenstored"
-	xenstored=$SBINDIR/oxenstored
+	xenstored=$LIBEXEC_BIN/oxenstored
 	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
 		xenstore="xenstored"
-		xenstored=$SBINDIR/xenstored
+		xenstored=$LIBEXEC_BIN/xenstored
 	])
 ])
 
@@ -29,11 +29,11 @@ AC_ARG_WITH([xenstored],
 	[
 		AS_IF([test "x$withval" = "xxenstored"], [
 			xenstore=$withval
-			xenstored=$SBINDIR/xenstored
+			xenstored=$LIBEXEC_BIN/xenstored
 		])
 		AS_IF([test "x$withval" = "xoxenstored"], [
 			xenstore=$withval
-			xenstored=$SBINDIR/oxenstored
+			xenstored=$LIBEXEC_BIN/oxenstored
 			AX_XEN_OCAML_XENSTORE_CHECK()
 		])
 		AS_IF([test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"], [
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons.in b/tools/hotplug/FreeBSD/rc.d/xencommons.in
index 88ff5b0..aaf0902 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -33,7 +33,7 @@ xen_startcmd()
 	local time=0
 	local timeout=30
 
-	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${LIBEXEC_BIN}/xenstored)
 	if test -z "$xenstored_pid"; then
 		printf "Cleaning xenstore database.\n"
 		if [ -z "${XENSTORED_ROOTDIR}" ]; then
@@ -45,7 +45,7 @@ xen_startcmd()
 		if [ -n "${XENSTORED_TRACE}" ]; then
 			XENSTORED_ARGS="${XENSTORED_ARGS} -T /var/log/xen/xenstored-trace.log"
 		fi
-		${SBINDIR}/xenstored ${XENSTORED_ARGS}
+		${LIBEXEC_BIN}/xenstored ${XENSTORED_ARGS}
 		while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
 			printf "."
 			time=$(($time+1))
@@ -83,7 +83,7 @@ xen_stop()
 
 xen_status()
 {
-	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${LIBEXEC_BIN}/xenstored)
 	if test -n ${xenstored_pid}; then
 		pids="$pids $xenstored_pid"
 	fi
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index d423ff8..e0eb026 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -14,8 +14,8 @@
 # the XENSTORED variable there.
 #
 # This can be either of:
-#  * @SBINDIR@/oxenstored
-#  * @SBINDIR@/xenstored
+#  * @LIBEXEC_BIN@/oxenstored
+#  * @LIBEXEC_BIN@/xenstored
 #
 # Changing this requires a reboot to take effect.
 #XENSTORED=@XENSTORED@
diff --git a/tools/hotplug/NetBSD/rc.d/xencommons b/tools/hotplug/NetBSD/rc.d/xencommons
index 16ec79b..f58e4ac 100644
--- a/tools/hotplug/NetBSD/rc.d/xencommons
+++ b/tools/hotplug/NetBSD/rc.d/xencommons
@@ -37,7 +37,7 @@ xen_startcmd()
 	local time=0
 	local timeout=30
 
-	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${LIBEXEC_BIN}/xenstored)
 	if test -z "$xenstored_pid"; then
 		printf "Cleaning xenstore database.\n"
 		if [ -z "${XENSTORED_ROOTDIR}" ]; then
@@ -49,7 +49,7 @@ xen_startcmd()
 		if [ -n "${XENSTORED_TRACE}" ]; then
 			XENSTORED_ARGS="${XENSTORED_ARGS} -T /var/log/xen/xenstored-trace.log"
 		fi
-		${SBINDIR}/xenstored ${XENSTORED_ARGS}
+		${LIBEXEC_BIN}/xenstored ${XENSTORED_ARGS}
 		while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
 			printf "."
 			time=$(($time+1))
@@ -87,7 +87,7 @@ xen_stop()
 
 xen_status()
 {
-	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${LIBEXEC_BIN}/xenstored)
 	if test -n ${xenstored_pid}; then
 		pids="$pids $xenstored_pid"
 	fi
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 18dedf7..ec36036 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -73,8 +73,8 @@ bins: $(PROGRAMS)
 libs: $(LIBS)
 
 install: all
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) oxenstored $(DESTDIR)$(SBINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) oxenstored $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
 	$(INSTALL_DATA) oxenstored.conf $(DESTDIR)$(XEN_CONFIG_DIR)
 
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 48f1e96..a3d8f8c 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -124,12 +124,12 @@ tarball: clean
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
 ifeq ($(XENSTORE_XENSTORED),y)
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
-	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
+	$(INSTALL_PROG) xenstored $(DESTDIR)$(LIBEXEC_BIN)
 endif
 	$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
 	$(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 40/46] Move xenwatchdogd to libexec
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (38 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 39/46] Move xenstored " Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-22 13:00 ` [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
                   ` (5 subsequent siblings)
  45 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

xenwatchdogd is started by runlevel scripts, its not supposed to be
called by admin.  So move it out of the way into LIBEXEC_BIN.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/hotplug/Linux/init.d/xen-watchdog.in          | 2 +-
 tools/hotplug/Linux/systemd/xen-watchdog.service.in | 2 +-
 tools/hotplug/NetBSD/rc.d/xen-watchdog              | 2 +-
 tools/misc/Makefile                                 | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xen-watchdog.in b/tools/hotplug/Linux/init.d/xen-watchdog.in
index 32c7268..5bedb25 100644
--- a/tools/hotplug/Linux/init.d/xen-watchdog.in
+++ b/tools/hotplug/Linux/init.d/xen-watchdog.in
@@ -19,7 +19,7 @@
 
 . @XEN_SCRIPT_DIR@/hotplugpath.sh
 
-DAEMON=${SBINDIR}/xenwatchdogd
+DAEMON=${LIBEXEC_BIN}/xenwatchdogd
 base=$(basename $DAEMON)
 
 # Source function library.
diff --git a/tools/hotplug/Linux/systemd/xen-watchdog.service.in b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
index acb2b77..b18d4aa 100644
--- a/tools/hotplug/Linux/systemd/xen-watchdog.service.in
+++ b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
@@ -6,7 +6,7 @@ ConditionVirtualization=xen
 
 [Service]
 Type=forking
-ExecStart=@SBINDIR@/xenwatchdogd 30 15
+ExecStart=@LIBEXEC_BIN@/xenwatchdogd 30 15
 KillSignal=USR1
 
 [Install]
diff --git a/tools/hotplug/NetBSD/rc.d/xen-watchdog b/tools/hotplug/NetBSD/rc.d/xen-watchdog
index ff4a52c..090f84c 100644
--- a/tools/hotplug/NetBSD/rc.d/xen-watchdog
+++ b/tools/hotplug/NetBSD/rc.d/xen-watchdog
@@ -16,7 +16,7 @@ export LD_LIBRARY_PATH
 
 name="xenwatchdog"
 rcvar=$name
-command="${SBINDIR}/xenwatchdogd"
+command="${LIBEXEC_BIN}/xenwatchdogd"
 start_cmd="echo Starting ${name}. && PATH=${PATH}:${SBINDIR} ${command} 30 15"
 
 load_rc_config $name
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 97e3fe6..e96c1bd 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -21,12 +21,12 @@ INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
 INSTALL_SBIN-y := xen-bugtool xen-python-path xenperf xenpm xen-tmem-list-parse gtraceview \
-	gtracestat xenlockprof xenwatchdogd xen-ringwatch xencov
+	gtracestat xenlockprof xen-ringwatch xencov
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash xen-lowmemd xen-mfndump
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
 
-INSTALL_PRIVBIN-y := xenpvnetboot
+INSTALL_PRIVBIN-y := xenpvnetboot xenwatchdogd
 INSTALL_PRIVBIN := $(INSTALL_PRIVBIN-y)
 
 # Include configure output (config.h) to headers search path

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (39 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 40/46] Move xenwatchdogd " Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:41   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
                   ` (4 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Config.mk                                               | 2 +-
 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 +-
 8 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Config.mk b/Config.mk
index 4eae6d2..e6c7f11 100644
--- a/Config.mk
+++ b/Config.mk
@@ -162,7 +162,7 @@ endef
 
 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
+                   XEN_RUN_DIR XEN_PAGING_DIR XEN_LIB_STORED
 
 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 define buildmakevars2file-closure
diff --git a/tools/configure.ac b/tools/configure.ac
index 7c0181c..2976ba5 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -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([../])
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons.in b/tools/hotplug/FreeBSD/rc.d/xencommons.in
index aaf0902..f64ed71 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -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."
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index e0eb026..e21a43e 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -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
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 6595fbf..455c8ea 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -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"
 
diff --git a/tools/hotplug/NetBSD/rc.d/xencommons b/tools/hotplug/NetBSD/rc.d/xencommons.in
similarity index 98%
rename from tools/hotplug/NetBSD/rc.d/xencommons
rename to tools/hotplug/NetBSD/rc.d/xencommons.in
index f58e4ac..f1e813b 100644
--- a/tools/hotplug/NetBSD/rc.d/xencommons
+++ b/tools/hotplug/NetBSD/rc.d/xencommons.in
@@ -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."
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index a3d8f8c..0c352f3 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -8,6 +8,7 @@ CFLAGS += -Werror
 CFLAGS += -I.
 CFLAGS += -I$(XEN_ROOT)/tools/
 CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
 
 CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
 LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
@@ -128,7 +129,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)$(LIBEXEC_BIN)
 endif
 	$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index 9a78755..d166497 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -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)

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (40 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:44   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 43/46] Move systemd paths to Paths.mk Olaf Hering
                   ` (3 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Also remove duplicate XEN_RUN_DIR from m4/paths.m4.
Fix XEN_RUN_DIR expansion in toplevel Makefile

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Makefile                                                          | 2 +-
 m4/paths.m4                                                       | 3 ---
 tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 7558262..b0742cf 100644
--- a/Makefile
+++ b/Makefile
@@ -221,7 +221,7 @@ uninstall:
 	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*
+	rm -rf $(D)$(XEN_RUN_DIR)/* $(D)/var/lib/xen*
 	make -C tools uninstall
 	rm -rf $(D)/boot/tboot*
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index f89378c..965a1d4 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -122,9 +122,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)
 ])
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 806bcaa..d3470fc 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -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 \

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 43/46] Move systemd paths to Paths.mk
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (41 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:44   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall Olaf Hering
                   ` (2 subsequent siblings)
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Every path should be in Paths.mk.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/Paths.mk.in | 3 +++
 config/Tools.mk.in | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 0d5972d..093d317 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -41,3 +41,6 @@ XENFIRMWAREDIR           := @LIBEXEC_BOOT@
 
 XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
 XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
+
+XEN_SYSTEMD_DIR          := @SYSTEMD_DIR@
+XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index e90578b..7000699 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -61,8 +61,6 @@ CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@
 CONFIG_SYSTEMD      := @systemd@
 SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
 SYSTEMD_LIBS        := @SYSTEMD_LIBS@
-XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
-XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
 
 LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (42 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 43/46] Move systemd paths to Paths.mk Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:47   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 45/46] Move MAN1DIR and MAN8DIR to Paths.mk Olaf Hering
  2014-09-22 13:00 ` [PATCH 46/46] rerun autogen.sh Olaf Hering
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

make uninstall references various variable paths.
If they are not set it may wipe /*.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index b0742cf..4dbf7b8 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@
 .PHONY: all
 all: dist
 
+-include config/Paths.mk
 -include config/Toplevel.mk
 SUBSYSTEMS?=xen tools stubdom docs
 TARGS_DIST=$(patsubst %, dist-%, $(SUBSYSTEMS))

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 45/46] Move MAN1DIR and MAN8DIR to Paths.mk
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (43 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:47   ` Ian Campbell
  2014-09-22 13:00 ` [PATCH 46/46] rerun autogen.sh Olaf Hering
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 config/Paths.mk.in | 4 ++++
 config/StdGNU.mk   | 3 ---
 config/SunOS.mk    | 3 ---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 093d317..5bf3fe8 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -44,3 +44,7 @@ XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
 
 XEN_SYSTEMD_DIR          := @SYSTEMD_DIR@
 XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
+
+MAN1DIR                  := $(MANDIR)/man1
+MAN8DIR                  := $(MANDIR)/man8
+
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 97faee8..16c3043 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -27,9 +27,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-MAN1DIR = $(MANDIR)/man1
-MAN8DIR = $(MANDIR)/man8
-
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
 BOOT_DIR ?= /boot
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 9c1a48d..bb8073f 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -19,9 +19,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-MAN1DIR = $(MANDIR)/man1
-MAN8DIR = $(MANDIR)/man8
-
 BOOT_DIR ?= /boot
 
 SunOS_LIBDIR = /usr/sfw/lib

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* [PATCH 46/46] rerun autogen.sh
  2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (44 preceding siblings ...)
  2014-09-22 13:00 ` [PATCH 45/46] Move MAN1DIR and MAN8DIR to Paths.mk Olaf Hering
@ 2014-09-22 13:00 ` Olaf Hering
  2014-09-23 10:48   ` Ian Campbell
  45 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-22 13:00 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 configure       | 125 ++++++++++++++++++++++++++-----
 tools/configure | 222 ++++++++++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 298 insertions(+), 49 deletions(-)

diff --git a/configure b/configure
index 5090baf..19da80f 100755
--- a/configure
+++ b/configure
@@ -598,19 +598,24 @@ XEN_PAGING_DIR
 XEN_LOCK_DIR
 XEN_SCRIPT_DIR
 XEN_CONFIG_DIR
+INITD_DIR
 CONFIG_DIR
-XENFIRMWAREDIR
-PRIVATE_BINDIR
-PKG_XEN_PREFIX
-PRIVATE_PREFIX
+DOCDIR
+MANDIR
 SHAREDIR
 XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 LIBDIR
+LIBEXEC_BOOT
+LIBEXEC_INC
+LIBEXEC_LIB
+LIBEXEC_BIN
 LIBEXEC
+INCLUDEDIR
 SBINDIR
 BINDIR
+BASH_COMPLETION_DIR
 host_os
 host_vendor
 host_cpu
@@ -660,6 +665,8 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+with_initd_dir
+with_bash_completion_dir
 enable_xen
 enable_tools
 enable_stubdom
@@ -1289,6 +1296,15 @@ Optional Features:
   --enable-stubdom        Enable build and install of stubdom
   --disable-docs          Disable build and install of docs
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-initd-dir=DIR    Path to directory with sysv runlevel scripts.
+                          [PREFIX/etc/init.d]
+  --with-bash_completion-dir=DIR
+                          Path to directory with sysv runlevel scripts.
+                          [SYSCONFDIR/bash_completion.d]
+
 Report bugs to <xen-devel@lists.xen.org>.
 Xen Hypervisor home page: <http://www.xen.org/>.
 _ACEOF
@@ -1851,6 +1867,57 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
 test "x$exec_prefix" = "xNONE" && exec_prefix=${prefix}
+if test "x$localstatedir" = 'x${prefix}/var' ; then
+    localstatedir=/var
+fi
+
+if test "x$sysconfdir" = 'x${prefix}/etc' ; then
+    case "$host_os" in
+         *freebsd*)
+         sysconfdir=$prefix/etc
+         ;;
+         *solaris*)
+         if test "$prefix" = "/usr" ; then
+             sysconfdir=/etc
+         else
+             sysconfdir=$prefix/etc
+         fi
+         ;;
+         *)
+         sysconfdir=/etc
+         ;;
+    esac
+fi
+
+
+# Check whether --with-initd-dir was given.
+if test "${with_initd_dir+set}" = set; then :
+  withval=$with_initd_dir; initd_dir_path=$withval
+else
+  case "$host_os" in
+         *linux*)
+         if test -d $sysconfdir/rc.d/init.d ; then
+             initd_dir_path=$sysconfdir/rc.d/init.d
+         else
+             initd_dir_path=$sysconfdir/init.d
+         fi
+         ;;
+         *)
+         initd_dir_path=$sysconfdir/rc.d
+         ;;
+     esac
+fi
+
+
+
+# Check whether --with-bash_completion-dir was given.
+if test "${with_bash_completion_dir+set}" = set; then :
+  withval=$with_bash_completion_dir; BASH_COMPLETION_DIR=$withval
+else
+  BASH_COMPLETION_DIR=$sysconfdir/bash_completion.d
+fi
+
+
 
 BINDIR=$prefix/bin
 
@@ -1858,37 +1925,55 @@ BINDIR=$prefix/bin
 SBINDIR=$prefix/sbin
 
 
-LIBEXEC=$prefix/lib/xen/bin
+INCLUDEDIR=`eval echo $includedir`
 
 
-LIBDIR=`eval echo $libdir`
+if test "x$libexecdir" = 'x${exec_prefix}/libexec' ; then
+    case "$host_os" in
+         *netbsd*)
+         libexecdir=$prefix/libexec
+         ;;
+         *)
+         libexecdir=$prefix/lib
+         ;;
+    esac
+fi
+LIBEXEC=`eval echo $libexecdir/xen`
+LIBEXEC_BIN=$LIBEXEC/bin
+LIBEXEC_LIB=$LIBEXEC/lib
+LIBEXEC_INC=$LIBEXEC/include
+LIBEXEC_BOOT=$LIBEXEC/boot
 
 
-XEN_RUN_DIR=/var/run/xen
 
 
-XEN_LOG_DIR=/var/log/xen
 
 
-XEN_LIB_STORED=/var/lib/xenstored
+LIBDIR=`eval echo $libdir`
 
 
-SHAREDIR=$prefix/share
+XEN_RUN_DIR=$localstatedir/run/xen
 
 
-PRIVATE_PREFIX=$LIBDIR/xen
+XEN_LOG_DIR=$localstatedir/log/xen
 
 
-PKG_XEN_PREFIX=$LIBDIR/xen
+XEN_LIB_STORED=$localstatedir/lib/xenstored
 
 
-PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+SHAREDIR=$prefix/share
 
 
-XENFIRMWAREDIR=$prefix/lib/xen/boot
+MANDIR=`eval eval echo $mandir`
 
 
-CONFIG_DIR=/etc
+DOCDIR=`eval eval echo $docdir`
+
+
+CONFIG_DIR=$sysconfdir
+
+
+INITD_DIR=$initd_dir_path
 
 
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
@@ -1897,13 +1982,17 @@ XEN_CONFIG_DIR=$CONFIG_DIR/xen
 XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
 
 
-XEN_LOCK_DIR=/var/lock
+case "$host_os" in
+*freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*) XEN_LOCK_DIR=$localstatedir/lock ;;
+esac
 
 
-XEN_RUN_DIR=/var/run/xen
+XEN_RUN_DIR=$localstatedir/run/xen
 
 
-XEN_PAGING_DIR=/var/lib/xen/xenpaging
+XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
 
diff --git a/tools/configure b/tools/configure
index 3830da4..dbecb4a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -696,6 +696,7 @@ qemu_xen
 rombios
 qemu_traditional
 blktap2
+LINUX_BACKEND_MODULES
 blktap1
 debug
 seabios
@@ -704,23 +705,29 @@ xsmpolicy
 ocamltools
 monitors
 githttp
+rpath
 XEN_PAGING_DIR
 XEN_LOCK_DIR
 XEN_SCRIPT_DIR
 XEN_CONFIG_DIR
+INITD_DIR
 CONFIG_DIR
-XENFIRMWAREDIR
-PRIVATE_BINDIR
-PKG_XEN_PREFIX
-PRIVATE_PREFIX
+DOCDIR
+MANDIR
 SHAREDIR
 XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 LIBDIR
+LIBEXEC_BOOT
+LIBEXEC_INC
+LIBEXEC_LIB
+LIBEXEC_BIN
 LIBEXEC
+INCLUDEDIR
 SBINDIR
 BINDIR
+BASH_COMPLETION_DIR
 FILE_OFFSET_BITS
 OBJEXT
 EXEEXT
@@ -780,6 +787,9 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 enable_largefile
+with_initd_dir
+with_bash_completion_dir
+enable_rpath
 enable_githttp
 enable_monitors
 enable_ocamltools
@@ -788,6 +798,7 @@ enable_ovmf
 enable_seabios
 enable_debug
 enable_blktap1
+with_linux_backend_modules
 enable_blktap2
 enable_qemu_traditional
 enable_rombios
@@ -1445,6 +1456,8 @@ Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-largefile     omit support for large files
+  --enable-rpath          Build tools with -Wl,-rpath,LIBDIR (default is
+                          DISABLED)
   --enable-githttp        Download GIT repositories via HTTP (default is
                           DISABLED)
   --disable-monitors      Disable xenstat and xentop monitoring tools (default
@@ -1467,6 +1480,14 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-initd-dir=DIR    Path to directory with sysv runlevel scripts.
+                          [PREFIX/etc/init.d]
+  --with-bash_completion-dir=DIR
+                          Path to directory with sysv runlevel scripts.
+                          [SYSCONFDIR/bash_completion.d]
+  --with-linux-backend-modules="mod1 mod2"
+                          List of Linux backend module or modalias names to be
+                          autoloaded on startup.
   --with-system-qemu[=PATH]
                           Use system supplied qemu PATH or qemu (taken from
                           $PATH) as qemu-xen device model instead of building
@@ -2251,7 +2272,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/Linux/init.d/xencommons.in hotplug/Linux/init.d/sysconfig.xencommons 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"
+ac_config_files="$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 hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.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 hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -3682,6 +3703,57 @@ esac
 
 test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
 test "x$exec_prefix" = "xNONE" && exec_prefix=${prefix}
+if test "x$localstatedir" = 'x${prefix}/var' ; then
+    localstatedir=/var
+fi
+
+if test "x$sysconfdir" = 'x${prefix}/etc' ; then
+    case "$host_os" in
+         *freebsd*)
+         sysconfdir=$prefix/etc
+         ;;
+         *solaris*)
+         if test "$prefix" = "/usr" ; then
+             sysconfdir=/etc
+         else
+             sysconfdir=$prefix/etc
+         fi
+         ;;
+         *)
+         sysconfdir=/etc
+         ;;
+    esac
+fi
+
+
+# Check whether --with-initd-dir was given.
+if test "${with_initd_dir+set}" = set; then :
+  withval=$with_initd_dir; initd_dir_path=$withval
+else
+  case "$host_os" in
+         *linux*)
+         if test -d $sysconfdir/rc.d/init.d ; then
+             initd_dir_path=$sysconfdir/rc.d/init.d
+         else
+             initd_dir_path=$sysconfdir/init.d
+         fi
+         ;;
+         *)
+         initd_dir_path=$sysconfdir/rc.d
+         ;;
+     esac
+fi
+
+
+
+# Check whether --with-bash_completion-dir was given.
+if test "${with_bash_completion_dir+set}" = set; then :
+  withval=$with_bash_completion_dir; BASH_COMPLETION_DIR=$withval
+else
+  BASH_COMPLETION_DIR=$sysconfdir/bash_completion.d
+fi
+
+
 
 BINDIR=$prefix/bin
 
@@ -3689,37 +3761,55 @@ BINDIR=$prefix/bin
 SBINDIR=$prefix/sbin
 
 
-LIBEXEC=$prefix/lib/xen/bin
+INCLUDEDIR=`eval echo $includedir`
 
 
-LIBDIR=`eval echo $libdir`
+if test "x$libexecdir" = 'x${exec_prefix}/libexec' ; then
+    case "$host_os" in
+         *netbsd*)
+         libexecdir=$prefix/libexec
+         ;;
+         *)
+         libexecdir=$prefix/lib
+         ;;
+    esac
+fi
+LIBEXEC=`eval echo $libexecdir/xen`
+LIBEXEC_BIN=$LIBEXEC/bin
+LIBEXEC_LIB=$LIBEXEC/lib
+LIBEXEC_INC=$LIBEXEC/include
+LIBEXEC_BOOT=$LIBEXEC/boot
+
 
 
-XEN_RUN_DIR=/var/run/xen
 
 
-XEN_LOG_DIR=/var/log/xen
 
+LIBDIR=`eval echo $libdir`
 
-XEN_LIB_STORED=/var/lib/xenstored
 
+XEN_RUN_DIR=$localstatedir/run/xen
 
-SHAREDIR=$prefix/share
 
+XEN_LOG_DIR=$localstatedir/log/xen
 
-PRIVATE_PREFIX=$LIBDIR/xen
 
+XEN_LIB_STORED=$localstatedir/lib/xenstored
 
-PKG_XEN_PREFIX=$LIBDIR/xen
+
+SHAREDIR=$prefix/share
+
+
+MANDIR=`eval eval echo $mandir`
 
 
-PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+DOCDIR=`eval eval echo $docdir`
 
 
-XENFIRMWAREDIR=$prefix/lib/xen/boot
+CONFIG_DIR=$sysconfdir
 
 
-CONFIG_DIR=/etc
+INITD_DIR=$initd_dir_path
 
 
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
@@ -3728,18 +3818,45 @@ XEN_CONFIG_DIR=$CONFIG_DIR/xen
 XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
 
 
-XEN_LOCK_DIR=/var/lock
+case "$host_os" in
+*freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*) XEN_LOCK_DIR=$localstatedir/lock ;;
+esac
 
 
-XEN_RUN_DIR=/var/run/xen
+XEN_RUN_DIR=$localstatedir/run/xen
 
 
-XEN_PAGING_DIR=/var/lib/xen/xenpaging
+XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 
 
 
 # Enable/disable options
 
+# Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+  enableval=$enable_rpath;
+fi
+
+
+if test "x$enable_rpath" = "xno"; then :
+
+    ax_cv_rpath="n"
+
+elif test "x$enable_rpath" = "xyes"; then :
+
+    ax_cv_rpath="y"
+
+elif test -z $ax_cv_rpath; then :
+
+    ax_cv_rpath="n"
+
+fi
+rpath=$ax_cv_rpath
+
+
+
 # Check whether --enable-githttp was given.
 if test "${enable_githttp+set}" = set; then :
   enableval=$enable_githttp;
@@ -3924,6 +4041,41 @@ blktap1=$ax_cv_blktap1
 
 
 
+
+# Check whether --with-linux-backend-modules was given.
+if test "${with_linux_backend_modules+set}" = set; then :
+  withval=$with_linux_backend_modules; LINUX_BACKEND_MODULES="$withval"
+else
+  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
+fi
+
+LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
+
+
 # Check whether --enable-blktap2 was given.
 if test "${enable_blktap2+set}" = set; then :
   enableval=$enable_blktap2;
@@ -6014,13 +6166,13 @@ if test "${with_xenstored+set}" = set; then :
 		if test "x$withval" = "xxenstored"; then :
 
 			xenstore=$withval
-			xenstored=$SBINDIR/xenstored
+			xenstored=$LIBEXEC_BIN/xenstored
 
 fi
 		if test "x$withval" = "xoxenstored"; then :
 
 			xenstore=$withval
-			xenstored=$SBINDIR/oxenstored
+			xenstored=$LIBEXEC_BIN/oxenstored
 
 	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
 
@@ -6040,11 +6192,11 @@ else
 
 
 	xenstore="oxenstored"
-	xenstored=$SBINDIR/oxenstored
+	xenstored=$LIBEXEC_BIN/oxenstored
 	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
 
 		xenstore="xenstored"
-		xenstored=$SBINDIR/xenstored
+		xenstored=$LIBEXEC_BIN/xenstored
 
 fi
 
@@ -8640,7 +8792,7 @@ fi
 
 	if test "x$SYSTEMD_DIR" = x; then :
 
-	    	    	    	    	    	    	    	    	    	    	    	    	    SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
+	    	    	    	    	    	    	    	    	    	    	    	    	    SYSTEMD_DIR="\$(PREFIX)/lib/systemd/system/"
 
 fi
 
@@ -8652,7 +8804,7 @@ fi
 
 		if test "x$SYSTEMD_MODULES_LOAD" = x; then :
 
-	    SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
+	    SYSTEMD_MODULES_LOAD="\$(PREFIX)/lib/modules-load.d/"
 
 fi
 
@@ -9365,17 +9517,25 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
-    "hotplug/Linux/init.d/xencommons.in") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xencommons.in" ;;
+    "hotplug/FreeBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/FreeBSD/rc.d/xencommons" ;;
     "hotplug/Linux/init.d/sysconfig.xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/sysconfig.xencommons" ;;
+    "hotplug/Linux/init.d/xen-watchdog") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xen-watchdog" ;;
+    "hotplug/Linux/init.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xencommons" ;;
+    "hotplug/Linux/init.d/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xendomains" ;;
     "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
     "hotplug/Linux/systemd/var-lib-xenstored.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/var-lib-xenstored.mount" ;;
-    "hotplug/Linux/systemd/xenstored.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.socket" ;;
-    "hotplug/Linux/systemd/xenstored_ro.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored_ro.socket" ;;
-    "hotplug/Linux/systemd/xenstored.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.service" ;;
-    "hotplug/Linux/systemd/xenconsoled.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenconsoled.service" ;;
     "hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service" ;;
-    "hotplug/Linux/systemd/xendomains.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xendomains.service" ;;
     "hotplug/Linux/systemd/xen-watchdog.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-watchdog.service" ;;
+    "hotplug/Linux/systemd/xenconsoled.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenconsoled.service" ;;
+    "hotplug/Linux/systemd/xendomains.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xendomains.service" ;;
+    "hotplug/Linux/systemd/xenstored.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.service" ;;
+    "hotplug/Linux/systemd/xenstored.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.socket" ;;
+    "hotplug/Linux/systemd/xenstored_ro.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored_ro.socket" ;;
+    "hotplug/Linux/vif-setup") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/vif-setup" ;;
+    "hotplug/Linux/xen-backend.rules") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-backend.rules" ;;
+    "hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
+    "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
+    "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

^ permalink raw reply related	[flat|nested] 116+ messages in thread

* Re: [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub
  2014-09-22 12:59 ` [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
@ 2014-09-22 15:29   ` Andrew Cooper
  2014-09-22 15:36     ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Andrew Cooper @ 2014-09-22 15:29 UTC (permalink / raw)
  To: Olaf Hering, xen-devel
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, Jan Beulich, Samuel Thibault,
	Ian Campbell

On 22/09/14 13:59, Olaf Hering wrote:
> Move location of temporary bootfiles from /var/run/xend/boot to
> /var/run/xen/pygrub. Create the subdirectory if does not exist.
> The <dir> argument --output-directory must be an existing directory.
>
> The reason for this change is that all entrys below /var/run have to be
> created at runtime in case /var/run is cleared on every boot.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  tools/pygrub/src/pygrub | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index 2618e11..e73a174 100644
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -778,7 +778,7 @@ if __name__ == "__main__":
>      debug = False
>      not_really = False
>      output_format = "sxp"
> -    output_directory = "/var/run/xend/boot"
> +    output_directory = "/var/run/xen/pygrub"
>  
>      # what was passed in
>      incfg = { "kernel": None, "ramdisk": None, "args": "" }
> @@ -829,11 +829,17 @@ if __name__ == "__main__":
>                  sys.exit(1)
>              output_format = a
>          elif o in ("--output-directory",):
> +            if not os.path.isdir(a):
> +                print "%s is not an existing directory" % a
> +                sys.exit(1)
>              output_directory = a
>  
>      if debug:
>  	logging.basicConfig(level=logging.DEBUG)
>  
> +    if not os.path.isdir(output_directory):
> +        os.mkdir(output_directory, 0700)

This can fail if output_directory exists but is not a directory.  It
needs wrapping to catch OSError and provide a more useful error to the user.

~Andrew

> +
>      if output is None or output == "-":
>          fd = sys.stdout.fileno()
>      else:
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub
  2014-09-22 15:29   ` Andrew Cooper
@ 2014-09-22 15:36     ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 15:36 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Olaf Hering, Keir Fraser, David Scott, Stefano Stabellini,
	George Dunlap, Ian Jackson, Tim Deegan, xen-devel, Jan Beulich,
	Samuel Thibault

On Mon, 2014-09-22 at 16:29 +0100, Andrew Cooper wrote:
> On 22/09/14 13:59, Olaf Hering wrote:
> > Move location of temporary bootfiles from /var/run/xend/boot to
> > /var/run/xen/pygrub. Create the subdirectory if does not exist.
> > The <dir> argument --output-directory must be an existing directory.
> >
> > The reason for this change is that all entrys below /var/run have to be
> > created at runtime in case /var/run is cleared on every boot.
> >
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> >  tools/pygrub/src/pygrub | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> > index 2618e11..e73a174 100644
> > --- a/tools/pygrub/src/pygrub
> > +++ b/tools/pygrub/src/pygrub
> > @@ -778,7 +778,7 @@ if __name__ == "__main__":
> >      debug = False
> >      not_really = False
> >      output_format = "sxp"
> > -    output_directory = "/var/run/xend/boot"
> > +    output_directory = "/var/run/xen/pygrub"
> >  
> >      # what was passed in
> >      incfg = { "kernel": None, "ramdisk": None, "args": "" }
> > @@ -829,11 +829,17 @@ if __name__ == "__main__":
> >                  sys.exit(1)
> >              output_format = a
> >          elif o in ("--output-directory",):
> > +            if not os.path.isdir(a):
> > +                print "%s is not an existing directory" % a
> > +                sys.exit(1)
> >              output_directory = a
> >  
> >      if debug:
> >  	logging.basicConfig(level=logging.DEBUG)
> >  
> > +    if not os.path.isdir(output_directory):
> > +        os.mkdir(output_directory, 0700)
> 
> This can fail if output_directory exists but is not a directory.  It
> needs wrapping to catch OSError and provide a more useful error to the user.

It'll already log something like
OSError: [Errno 17] File exists: '/tmp/notadir'

Not sure what else could be logged.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 02/46] tools/xenpaging: create dumpdir with mode 0700
  2014-09-22 12:59 ` [PATCH 02/46] tools/xenpaging: create dumpdir with mode 0700 Olaf Hering
@ 2014-09-22 15:52   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 15:52 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 14:59 +0200, Olaf Hering wrote:
> The swapfile contain sensitive guest info.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 03/46] install.sh: Preserve permissions from make install
  2014-09-22 12:59 ` [PATCH 03/46] install.sh: Preserve permissions from make install Olaf Hering
@ 2014-09-22 15:54   ` Ian Campbell
  2014-09-23 12:14     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 15:54 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 14:59 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

I wonder what this will break. Only one way to find out:

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Although, do you suppose that the tar unpack right above it ought to use
-p/--preserve-permissions ?

> ---
>  install.sh | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/install.sh b/install.sh
> index 272123a..3e11c4d 100644
> --- a/install.sh
> +++ b/install.sh
> @@ -27,9 +27,6 @@ tmp="`mktemp -d`"
>  echo "Installing Xen from '$src' to '$dst'..."
>  (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
>  
> -echo " - modifying permissions"
> -chmod -R a+rX "$tmp"
> -
>  (cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
>  rm -rf "$tmp"
>  

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 04/46] tools/mkrpm: allow custom rpm package name
  2014-09-22 12:59 ` [PATCH 04/46] tools/mkrpm: allow custom rpm package name Olaf Hering
@ 2014-09-22 15:55   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 15:55 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 14:59 +0200, Olaf Hering wrote:
> Even if xen is configured and compiled with different --prefix= so that
> it operates entirely below $prefix, the resulting package from 'make
> rpmball' is always called "xen.rpm".
> 
> Use an environment name to give a different name.
> This can be used like this:
> 
> suffix=-bugN
> prefix=/opx/xen/staging${suffix}
> ./configure --prefix=${prefix}
> make rpmball PKG_SUFFIX=${suffix}
> 
> The result will be "xen-bugN.rpm" instead of "xen.rpm". The benefit is that
> many xen${suffix}.rpm packages can be installed at the same time.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  tools/misc/mkrpm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
> index a9aa5e2..9b8c6d9 100644
> --- a/tools/misc/mkrpm
> +++ b/tools/misc/mkrpm
> @@ -31,7 +31,7 @@ rm -rf rpm
>  mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
>  cat >rpm/SPECS/xen.spec <<EOF
>  Summary: Xen development build, version $version
> -Name: xen
> +Name: xen$PKG_SUFFIX
>  Version: $version
>  Release: $release
>  License: GPL

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 05/46] tools: remove obsolete path.py from tools/python
  2014-09-22 12:59 ` [PATCH 05/46] tools: remove obsolete path.py from tools/python Olaf Hering
@ 2014-09-22 15:55   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 15:55 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 14:59 +0200, Olaf Hering wrote:
> The directory tools/python/xen/util does not exist.
> Upcoming changes to genpath will fail if the rule persists.
> Nothing uses path.py (anymore?), so get rid it.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Shall I remove from .gitignore as I apply?

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 13/46] Config.mk: replace dependency to genpath with actual target
  2014-09-22 13:00 ` [PATCH 13/46] Config.mk: replace dependency to genpath with actual target Olaf Hering
@ 2014-09-22 15:59   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 15:59 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> genpath is a detail of buildmakevars2file. Replace the dependency to
> genpath with the actual buildmakevars2file target. This change by
> itself does not fix any bug. Upcoming changes will add dependencies to
> $(target), but no rule exist to create $(target).
> 
> To force a rebuild of the $(1) rule the target now depends on the
> existing .phony target. This dummy target is already used elsewhere in
> the code.
> 
> No change in behaviour is expected by this patch.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 14/46] Config.mk: add new macro buildmakevars2header
  2014-09-22 13:00 ` [PATCH 14/46] Config.mk: add new macro buildmakevars2header Olaf Hering
@ 2014-09-22 16:04   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 16:04 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> This macro is similar to buildmakevars2file, it just creates a C header
> file instead of shell style syntax. Upcoming changes will use this macro
> in libxl and libxc.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR
  2014-09-22 13:00 ` [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR Olaf Hering
@ 2014-09-22 16:13   ` Ian Campbell
  2014-09-23  9:46     ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 16:13 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Preserve existing behaviour: if the option was not given, set existing
> defaults for FreeBSD, Solaris and everything else.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Hopefully this does the right thing to XEN_CONFIG_DIR?

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-22 13:00 ` [PATCH 19/46] Add configure --with-initd-dir=DIR Olaf Hering
@ 2014-09-22 16:22   ` Ian Campbell
  2014-09-23 12:17     ` Olaf Hering
  2014-09-24 12:11     ` Olaf Hering
  0 siblings, 2 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 16:22 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Google suggests that this is more commonly --with-initddir and that
matches the existing --with-foodir options.

It also looks like they commonly default to just $sysconfdir/init.d
rather than detecting based on $host.

> diff --git a/docs/misc/distro_mapping.txt b/docs/misc/distro_mapping.txt
> index f849d07..a4dea45 100644
> --- a/docs/misc/distro_mapping.txt
> +++ b/docs/misc/distro_mapping.txt
> @@ -13,8 +13,7 @@ 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 path can be changed with configure --with-initd-dir=DIR

This only applies to one of the three variables discussed here, doesn't
it? While the other two are still configured via .config we should say
so (and long term we should aim to move those over too IMHO, ideally
this file becomes obsolete).

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 20/46] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
  2014-09-22 13:00 ` [PATCH 20/46] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
@ 2014-09-22 16:27   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 16:27 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> 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
> likely a typo introduced by 9f6d07bac9f14aaa8bafe38b4a217e61a3a57842
> ("tools: get rid of hardcoded config dirs")

Are you sure? It seems like a plausible place for some OS to want it.

Not sure how relevant that is though, SunOS.mk won't be used much these
days, and I'm not 100% sure it isn't already broken... If it becomes an
issue we can add --with-scriptdir

> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> tools/configure.ac                                       |  6 ++++++

Please do mention the need to rerun autogen.sh in the commit log for the
benefit of the committer, who might otherwise forget...

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 21/46] tools/configure.ac: sort AC_CONFIG_FILES
  2014-09-22 13:00 ` [PATCH 21/46] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
@ 2014-09-22 16:38   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-22 16:38 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 22/46] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  2014-09-22 13:00 ` [PATCH 22/46] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
@ 2014-09-23  9:23   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:23 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 23/46] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  2014-09-22 13:00 ` [PATCH 23/46] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
@ 2014-09-23  9:24   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:24 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Also remove DESTDIR from the path, this was most likely not intended.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 24/46] remove duplicate variables from config
  2014-09-22 13:00 ` [PATCH 24/46] remove duplicate variables from config Olaf Hering
@ 2014-09-23  9:25   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:25 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> ... 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.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

(note to committer: run autogen.sh)

> ---
>  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(-)
> 
> diff --git a/Config.mk b/Config.mk
> index fc2e312..75282d7 100644
> --- a/Config.mk
> +++ b/Config.mk
> @@ -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
> diff --git a/config/NetBSD.mk b/config/NetBSD.mk
> index 141de7c..21318d6 100644
> --- a/config/NetBSD.mk
> +++ b/config/NetBSD.mk
> @@ -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
> diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
> index 8daade8..2a87218 100644
> --- a/config/NetBSDRump.mk
> +++ b/config/NetBSDRump.mk
> @@ -3,8 +3,6 @@ include $(XEN_ROOT)/config/StdGNU.mk
>  DLOPEN_LIBS =
>  PTHREAD_LIBS =
>  
> -XEN_LOCK_DIR = /var/lib
> -
>  WGET = ftp
>  
>  XENSTORE_XENSTORED=n
> diff --git a/config/Paths.mk.in b/config/Paths.mk.in
> index c01d0ef..4bded93 100644
> --- a/config/Paths.mk.in
> +++ b/config/Paths.mk.in
> @@ -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@
> diff --git a/config/StdGNU.mk b/config/StdGNU.mk
> index 4cc3a01..dd6170c 100644
> --- a/config/StdGNU.mk
> +++ b/config/StdGNU.mk
> @@ -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 =
> diff --git a/config/SunOS.mk b/config/SunOS.mk
> index 1470514..92bde78 100644
> --- a/config/SunOS.mk
> +++ b/config/SunOS.mk
> @@ -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
>  
> diff --git a/m4/paths.m4 b/m4/paths.m4
> index d33a9e6..0255966 100644
> --- a/m4/paths.m4
> +++ b/m4/paths.m4
> @@ -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
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 25/46] Use configure --mandir=DIR to set MANDIR
  2014-09-22 13:00 ` [PATCH 25/46] Use configure --mandir=DIR to set MANDIR Olaf Hering
@ 2014-09-23  9:32   ` Ian Campbell
  2014-09-23  9:36     ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:32 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> diff --git a/m4/paths.m4 b/m4/paths.m4
> index 0255966..5e90eb4 100644
> --- a/m4/paths.m4
> +++ b/m4/paths.m4
> @@ -68,6 +68,10 @@ AC_SUBST(XEN_LIB_STORED)
>  SHAREDIR=$prefix/share
>  AC_SUBST(SHAREDIR)
>  
> +dnl double eval because default mandir includes datarootdir, which includes prefix
> +MANDIR=`eval eval echo $mandir`
> +AC_SUBST(MANDIR)

Would it be better to add datarootdir to the "expand these early" at the
top, something like
	datarootdir=`eval echo $datarootdir`
?

> +
>  PRIVATE_PREFIX=$LIBDIR/xen
>  AC_SUBST(PRIVATE_PREFIX)
>  

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 25/46] Use configure --mandir=DIR to set MANDIR
  2014-09-23  9:32   ` Ian Campbell
@ 2014-09-23  9:36     ` Ian Campbell
  2014-09-23 12:23       ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:36 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 10:32 +0100, Ian Campbell wrote:
> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > diff --git a/m4/paths.m4 b/m4/paths.m4
> > index 0255966..5e90eb4 100644
> > --- a/m4/paths.m4
> > +++ b/m4/paths.m4
> > @@ -68,6 +68,10 @@ AC_SUBST(XEN_LIB_STORED)
> >  SHAREDIR=$prefix/share
> >  AC_SUBST(SHAREDIR)
> >  
> > +dnl double eval because default mandir includes datarootdir, which includes prefix
> > +MANDIR=`eval eval echo $mandir`
> > +AC_SUBST(MANDIR)
> 
> Would it be better to add datarootdir to the "expand these early" at the
> top, something like
> 	datarootdir=`eval echo $datarootdir`
> ?

Similarly for the following few patches...

Ideally there would be an autoconf mechanism to allow us to expand all
of these vars before we got to the point of using them.

Maybe we are just using it wrong and we should be doing in Paths.mk.in:
        prefix=@prefix@
        datarootdir=@datarootdir@
        mandir=@mandir@
        ...
        MANDIR=\$mandir

(or even just switching our code to $mandir). Perhaps looking at what
automake would put in Makefile.in for a generic project would be
informative?

That would be a bigger change though and I'd be OK with deferring for
now.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-22 13:00 ` [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
@ 2014-09-23  9:45   ` Ian Campbell
  2014-09-23 12:34     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:45 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> 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 autotools configuration refers to libexec as a directory for
> executables and stuff which is called by other programs, not by the
> user.

IIRC that definition flows from either the FHS or the GNU coding
standards.

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

Is the end result of this that anything is moved by default? Please
state it here either way.

> An internal libxl function was removed. A single helper to retrieve
> LIBEXEC_BIN remains.
> 
> As suggested by the docs,

which docs?

> -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
> +if test "x$libexecdir" = 'x${exec_prefix}/libexec' ; then
> +    case "$host_os" in
> +         *netbsd*)
> +         libexecdir=$prefix/libexec
> +         ;;
> +         *)
> +         libexecdir=$prefix/lib
> +         ;;
> +    esac
> +fi

I'm wondering if we should just accept the autoconf default here.
Distros which differ from that default (Debian? I thought RPM distros
used libexec) are presumably used to passing ---with-libexecdir=.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR
  2014-09-22 16:13   ` Ian Campbell
@ 2014-09-23  9:46     ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23  9:46 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 17:13 +0100, Ian Campbell wrote:
> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Preserve existing behaviour: if the option was not given, set existing
> > defaults for FreeBSD, Solaris and everything else.
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

I've applied up to and including this point.

66f71ce stubdom: fix lwip compile
51f7272 tools/xenpaging: create dumpdir with mode 0700
4cd7463 install.sh: Preserve permissions from make install
b8ebc6b tools/mkrpm: allow custom rpm package name
dcf4dd2 tools: remove obsolete path.py from tools/python
63dcc68 tools/pygrub: store kernels in /var/run/xen/pygrub
7a5e21a tools/hotplug: create XEN_RUN_DIR at runtime
ffa86a8 tools/hotplug: create XEN_LOCK_DIR at runtime
c996572 tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
9c8dd4d tools/examples: remove obsolete install targets
0021ddc remove obsolete SUBSYS_DIR variable
c0f5ce5 Config.mk: move directory list into BUILD_MAKE_VARS
19a5856 Config.mk: replace dependency to genpath with actual target
e8a23cf Config.mk: add new macro buildmakevars2header
a25968b tools/libxl: use buildmakevars2header to create _paths.h
ad1f562 tools/libxc: provide variable paths to libxc
7538911 tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE
7d71477 Use configure --sysconfdir=DIR to set CONFIG_DIR

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 29/46] Use configure --prefix=DIR to set PREFIX
  2014-09-22 13:00 ` [PATCH 29/46] Use configure --prefix=DIR to set PREFIX Olaf Hering
@ 2014-09-23 10:14   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:14 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> PREFIX is set by configure --prefix=DIR, nothing outside
> tools,docs,stubdom is using this variable.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var
  2014-09-22 13:00 ` [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
@ 2014-09-23 10:18   ` Ian Campbell
  2014-09-23 12:37     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:18 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> This is helpful to test make uninstall with --prefix=/private/dir as
> unprivileged user. No change in behaviour is expected by this change.

It would be worth noting here that this is somewhere where we (already)
conciously decided to deviate from the default autoconf behaviour in
favour of the FHS location for this stuff (which is /var
not /usr/local/var). So this change preserves our chosen default while
now enabling the configure option to work.

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  m4/paths.m4 | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/m4/paths.m4 b/m4/paths.m4
> index d21850b..deb9196 100644
> --- a/m4/paths.m4
> +++ b/m4/paths.m4
> @@ -2,6 +2,9 @@ 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}

It might be worth reiterating some of what I said above in a comment
here too.

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

I've been continually surprised in this series that autoconf doesn't
just Do The Right Thing on different $host_os's. I thought that was the
point of it.

Oh well, not your fault here (or in the other places).

Apart from the commit message/comment additions the code here looks
correct to me.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 31/46] Add configure --enable-rpath
  2014-09-22 13:00 ` [PATCH 31/46] Add configure --enable-rpath Olaf Hering
@ 2014-09-23 10:23   ` Ian Campbell
  2014-09-23 10:37     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:23 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> This fixes the tools when xen is configured with --prefix=/odd/path
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  Config.mk                      |  3 +++
>  config/Tools.mk.in             |  2 ++
>  tools/Makefile                 | 15 +++++++++++++--
>  tools/configure.ac             |  1 +
>  tools/ocaml/xenstored/Makefile |  1 +
>  5 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/Config.mk b/Config.mk
> index c8dac4c..3947e85 100644
> --- a/Config.mk
> +++ b/Config.mk
> @@ -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)
> +APPEND_LDFLAGS += -Wl,-rpath,$(LIBDIR)
> +endif

I thought APPEND_* was for user supplied things? Shouldn't this be just
LDFLAGS-$(XEN_TOOLS_RPATH) += -Wl,....

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-22 13:00 ` [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
@ 2014-09-23 10:28   ` Ian Campbell
  2014-09-23 10:36     ` Olaf Hering
  2014-09-23 12:41     ` Olaf Hering
  0 siblings, 2 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:28 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> 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.

I think the change wrt which blktap modules are loaded deserves
mentioning here, since it is a functional change. It's almost worth
making that trivial sounding change separately, in case there are
knockon effects.

Yay to the lack of sed hackery though!

> +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`"

Why does this need to be laundered via eval? There's no sensible way a
user could want to pass in \$thing and expect it to expand to something
useful, is there?

> diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
> index dc98b67..ac20c76 100644
> --- a/tools/hotplug/Linux/systemd/Makefile
> +++ b/tools/hotplug/Linux/systemd/Makefile
> [...]
> +$(XEN_SYSTEMD_MODULES):
> +	for mod in $(LINUX_BACKEND_MODULES) ; do \
> +		echo $$mod ; \
> +		done > $@.tmp ; \
> +	$(call move-if-changed,$@.tmp,$@)

No need for "; \" before the call, I think.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 33/46] Add configure --with-bash_completion-dir=DIR
  2014-09-22 13:00 ` [PATCH 33/46] Add configure --with-bash_completion-dir=DIR Olaf Hering
@ 2014-09-23 10:32   ` Ian Campbell
  2014-09-23 12:49     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:32 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

I'm not so sure about this. If someone is installing things into $prefix
or $prefix/etc etc then $prefix/etc/bash_completion.d seems like the
right thing for us to do.

I worry that allowing people to say "install over here" and then to let
them micromanage all of the things which that entails (presumably to put
bits back where they normally go) is going to result in a plethora of
not very useful configure options, with the associated maintenance
overhead and potential for confusion.

e.g. in the case of bash_completion someone installing to a non-standard
prefix ought IMHO to expect to have to do
        ln -s $prefix/etc/bash_completion.d/* /etc/bash_complation.d/
or to add something to their .bashrc to search the new path too.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 34/46] Make XENFIRMWAREDIR a subdir of libexecdir
  2014-09-22 13:00 ` [PATCH 34/46] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
@ 2014-09-23 10:33   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:33 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> 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.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk
  2014-09-22 13:00 ` [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk Olaf Hering
@ 2014-09-23 10:33   ` Ian Campbell
  2014-09-23 12:52     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:33 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:

What is the distinction between the two and why do we prefer the caps
version?

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  m4/systemd.m4 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/m4/systemd.m4 b/m4/systemd.m4
> index 760bbad..9569f14 100644
> --- a/m4/systemd.m4
> +++ b/m4/systemd.m4
> @@ -65,7 +65,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
>  	    dnl files. It would also be best to just extend the upstream
>  	    dnl pkg-config  pkg.m4 with an AC_DEFUN() to do this neatly.
>  	    dnl SYSTEMD_DIR="`$PKG_CONFIG --define-variable=prefix=$PREFIX --variable=systemdsystemunitdir systemd`"
> -	    SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
> +	    SYSTEMD_DIR="\$(PREFIX)/lib/systemd/system/"
>  	], [])
>  
>  	AS_IF([test "x$SYSTEMD_DIR" = x], [
> @@ -74,7 +74,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
>  
>  	dnl There is no variable for this yet for some reason
>  	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
> -	    SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
> +	    SYSTEMD_MODULES_LOAD="\$(PREFIX)/lib/modules-load.d/"
>  	], [])
>  
>  	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 36/46] tools: remove private copies of includedir and libdir from libxenstat
  2014-09-22 13:00 ` [PATCH 36/46] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
@ 2014-09-23 10:34   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:34 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> They are wrong and unused.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-23 10:28   ` Ian Campbell
@ 2014-09-23 10:36     ` Olaf Hering
  2014-09-23 10:50       ` Ian Campbell
  2014-09-23 12:41     ` Olaf Hering
  1 sibling, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 10:36 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > 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.
> 
> I think the change wrt which blktap modules are loaded deserves
> mentioning here, since it is a functional change. It's almost worth
> making that trivial sounding change separately, in case there are
> knockon effects.

At least systemd would load blktap2 and blktap via xen.conf. And the
SUSE xencommons also loads both drivers. So I think they can coexist.
No sure what the intent of the initial "modprobe blktap2 || modprobe
blktap" was. I think doing it that way did not solve a real bug. The
comments in the discussion at that time did not provide a hint that a
bug was fixed.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 31/46] Add configure --enable-rpath
  2014-09-23 10:23   ` Ian Campbell
@ 2014-09-23 10:37     ` Olaf Hering
  0 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 10:37 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> I thought APPEND_* was for user supplied things? Shouldn't this be just
> LDFLAGS-$(XEN_TOOLS_RPATH) += -Wl,....

Good point. I will adjust this part in the next version.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build
  2014-09-22 13:00 ` [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build Olaf Hering
@ 2014-09-23 10:37   ` Ian Campbell
  2014-09-23 12:55     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:37 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Paths.mk contains just directories set by configure.
> Source this file first when building docs,stubdom or tools.

Is it important that this comes before something? (Config.mk?
$subsystem.mk?) or could we incorporate this include into $subsystem.mk?

Alternatively could $subsystem.mk be moved before Config.mk?

> Remove unused path variables from Paths.mk

I think you mean config/$subsystem.mk.in?

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 38/46] Move xenconsoled to libexec
  2014-09-22 13:00 ` [PATCH 38/46] Move xenconsoled to libexec Olaf Hering
@ 2014-09-23 10:40   ` Ian Campbell
  2014-09-23 12:56     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:40 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> xenconsoled is started by runlevel scripts, its not supposed to be
> called by admin.  So move it out of the way into LIBEXEC_BIN.

It's pretty normal/conventional for daemons to be in $sbin, I think.

I think the point is that although daemons might normally be started by
an initscript it is also allowable (and occasionally useful) to start
them by hand or via other means. In contrast to something like the
libxl-save-helper which is something which does belong in libexec.

I'd be reluctant to change this without a reference to something like
the FHS to back up why it should be in libexec.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 39/46] Move xenstored to libexec
  2014-09-22 13:00 ` [PATCH 39/46] Move xenstored " Olaf Hering
@ 2014-09-23 10:41   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:41 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> xenstored is started by runlevel scripts, its not supposed to be
> called by admin.  So move it out of the way into LIBEXEC_BIN.

Same comment as the previous patch (and again on the next one).

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  2014-09-22 13:00 ` [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
@ 2014-09-23 10:41   ` Ian Campbell
  2014-09-23 12:58     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:41 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  Config.mk                                               | 2 +-
>  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 +-

Does tools/ocaml/xenstore need a similar change?

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen
  2014-09-22 13:00 ` [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
@ 2014-09-23 10:44   ` Ian Campbell
  2014-09-23 13:01     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:44 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Also remove duplicate XEN_RUN_DIR from m4/paths.m4.
> Fix XEN_RUN_DIR expansion in toplevel Makefile
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  Makefile                                                          | 2 +-
>  m4/paths.m4                                                       | 3 ---
>  tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 2 +-
>  3 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 7558262..b0742cf 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -221,7 +221,7 @@ uninstall:
>  	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*
> +	rm -rf $(D)$(XEN_RUN_DIR)/* $(D)/var/lib/xen*

This would previous have removed XEN_RUN_DIR itself and not just the
contents. It would also have historically also cleaned up
$(XEN_RUN_DIR)d (i.e. xend...)!

Perhaps just add an rmdir to follow this, globbing the dir is indeed
pretty skanky (and probably annoies e.g. the xenomai maintainers!)

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 43/46] Move systemd paths to Paths.mk
  2014-09-22 13:00 ` [PATCH 43/46] Move systemd paths to Paths.mk Olaf Hering
@ 2014-09-23 10:44   ` Ian Campbell
  2014-09-23 13:03     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:44 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Every path should be in Paths.mk.

XEN_SYSTEMD_MODULES_LOAD is a path?

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  config/Paths.mk.in | 3 +++
>  config/Tools.mk.in | 2 --
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/config/Paths.mk.in b/config/Paths.mk.in
> index 0d5972d..093d317 100644
> --- a/config/Paths.mk.in
> +++ b/config/Paths.mk.in
> @@ -41,3 +41,6 @@ XENFIRMWAREDIR           := @LIBEXEC_BOOT@
>  
>  XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
>  XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
> +
> +XEN_SYSTEMD_DIR          := @SYSTEMD_DIR@
> +XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> index e90578b..7000699 100644
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -61,8 +61,6 @@ CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@
>  CONFIG_SYSTEMD      := @systemd@
>  SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
>  SYSTEMD_LIBS        := @SYSTEMD_LIBS@
> -XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
> -XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
>  
>  LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
>  

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall
  2014-09-22 13:00 ` [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall Olaf Hering
@ 2014-09-23 10:47   ` Ian Campbell
  2014-09-23 13:05     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:47 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> make uninstall references various variable paths.

> If they are not set it may wipe /*.

Urk!

I think the uninstall run may need some sort of sanity check to ensure
you have run configure then.

tools/Rules.mk has:

        ifeq (,$(findstring clean,$(MAKECMDGOALS)))
        $(XEN_ROOT)/config/Tools.mk:
                $(error You have to run ./configure before building or installing the tools)
        endif

which could perhaps be adapted. Alternatively splitting uninstall into
uninstall-$subsystem and having the non-Xen subsystems start with a
check that PREFIX (or some suitable variable) is non-empty?

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 45/46] Move MAN1DIR and MAN8DIR to Paths.mk
  2014-09-22 13:00 ` [PATCH 45/46] Move MAN1DIR and MAN8DIR to Paths.mk Olaf Hering
@ 2014-09-23 10:47   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:47 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 46/46] rerun autogen.sh
  2014-09-22 13:00 ` [PATCH 46/46] rerun autogen.sh Olaf Hering
@ 2014-09-23 10:48   ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:48 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:

This should be done in the individual patches not all at once (or else
bisectability goes out the window). As I mentioned as I came across
those patches it's best if you mention the need to rerun autogen.sh in
the commit message as a reminder to the committer. (This is irrespective
of whether you choose to include changes to the generated files in your
patches).

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-23 10:36     ` Olaf Hering
@ 2014-09-23 10:50       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 10:50 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 12:36 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > 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.
> > 
> > I think the change wrt which blktap modules are loaded deserves
> > mentioning here, since it is a functional change. It's almost worth
> > making that trivial sounding change separately, in case there are
> > knockon effects.
> 
> At least systemd would load blktap2 and blktap via xen.conf. And the
> SUSE xencommons also loads both drivers. So I think they can coexist.
> No sure what the intent of the initial "modprobe blktap2 || modprobe
> blktap" was. I think doing it that way did not solve a real bug. The
> comments in the discussion at that time did not provide a hint that a
> bug was fixed.

That's fine, and the sort of thing I'd like to see the commit message
say so we know in 6 months time why this was subtly changed in the midst
of another change.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 03/46] install.sh: Preserve permissions from make install
  2014-09-22 15:54   ` Ian Campbell
@ 2014-09-23 12:14     ` Olaf Hering
  2014-09-23 12:36       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:14 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, Sep 22, Ian Campbell wrote:

> On Mon, 2014-09-22 at 14:59 +0200, Olaf Hering wrote:
> Although, do you suppose that the tar unpack right above it ought to use
> -p/--preserve-permissions ?

At least the tar I use preserves permissions automatically.
I wonder what the removed chmod tried to fix anyway.

Olaf

> > +++ b/install.sh
> > @@ -27,9 +27,6 @@ tmp="`mktemp -d`"
> >  echo "Installing Xen from '$src' to '$dst'..."
> >  (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
> >  
> > -echo " - modifying permissions"
> > -chmod -R a+rX "$tmp"
> > -
> >  (cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
> >  rm -rf "$tmp"
> >  
> 
> 

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-22 16:22   ` Ian Campbell
@ 2014-09-23 12:17     ` Olaf Hering
  2014-09-24 12:11     ` Olaf Hering
  1 sibling, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:17 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, Sep 22, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Google suggests that this is more commonly --with-initddir and that
> matches the existing --with-foodir options.
> 
> It also looks like they commonly default to just $sysconfdir/init.d
> rather than detecting based on $host.

I will check how others solved this part. My intent was to preserve
existing behaviour.
Will update the patch.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 25/46] Use configure --mandir=DIR to set MANDIR
  2014-09-23  9:36     ` Ian Campbell
@ 2014-09-23 12:23       ` Olaf Hering
  2014-09-23 12:36         ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:23 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> Maybe we are just using it wrong and we should be doing in Paths.mk.in:
>         prefix=@prefix@
>         datarootdir=@datarootdir@
>         mandir=@mandir@
>         ...
>         MANDIR=\$mandir
> 
> (or even just switching our code to $mandir). Perhaps looking at what
> automake would put in Makefile.in for a generic project would be
> informative?
> 
> That would be a bigger change though and I'd be OK with deferring for
> now.

With automake the resulting variables are all lowercase. Perhaps thats
the reason why configure uses also lowercase. Just xen uses uppercase
for all variables.

So my options are either: expand to lowercase variables and assign to
existing uppercase variables later in that file. Or do a treewide
conversion from upper to lowercase.

Looks like the simplest change would be to expand all variables from
configure in Paths.mk and assign them later to existing variables.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-23  9:45   ` Ian Campbell
@ 2014-09-23 12:34     ` Olaf Hering
  2014-09-23 12:38       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:34 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > The autotools configuration refers to libexec as a directory for
> > executables and stuff which is called by other programs, not by the
> > user.
> IIRC that definition flows from either the FHS or the GNU coding
> standards.

The above sentence should have been "autotools documentation".

> > 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.
> > 
> > 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.
> 
> Is the end result of this that anything is moved by default? Please
> state it here either way.

No change in paths is expected by this change.

> > As suggested by the docs,
> 
> which docs?

The autoconf docs, they suggest $libexec/$package_name as target dir.
Will update the commit msg to make this clear.

> > -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
> > +if test "x$libexecdir" = 'x${exec_prefix}/libexec' ; then
> > +    case "$host_os" in
> > +         *netbsd*)
> > +         libexecdir=$prefix/libexec
> > +         ;;
> > +         *)
> > +         libexecdir=$prefix/lib
> > +         ;;
> > +    esac
> > +fi
> 
> I'm wondering if we should just accept the autoconf default here.
> Distros which differ from that default (Debian? I thought RPM distros
> used libexec) are presumably used to passing ---with-libexecdir=.

At least SUSE uses /usr/lib as libexec. Also the rpm %configure macro
uses %prefix/lib. So its up to the configure scripts to append "package
name". I will check what other packages do, but I think my change is
correct in that part.

Regarding libexec/ vs. lib/: it would change existing behaviour. In the
end it would most likely not matter because the tools find the binaries
anyway. Stuff will just end up in different directories. Existing
domU.cfg files, which refer to a hardcoded path to qemu, hvmloader or
whatever will need an update. Perhaps the offending line can be removed
altogether from domU.cfg.

So if you want, the hunk above can be changed to a plain LIBEXEC=$libexecdir/xen

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 03/46] install.sh: Preserve permissions from make install
  2014-09-23 12:14     ` Olaf Hering
@ 2014-09-23 12:36       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 12:36 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:14 +0200, Olaf Hering wrote:
> On Mon, Sep 22, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 14:59 +0200, Olaf Hering wrote:
> > Although, do you suppose that the tar unpack right above it ought to use
> > -p/--preserve-permissions ?
> 
> At least the tar I use preserves permissions automatically.

Only for root I expect, if yours is anything like my manpage:
     -p, --preserve-permissions, --same-permissions
           extract information about file permissions (default for superuser)

> I wonder what the removed chmod tried to fix anyway.

No idea...

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 25/46] Use configure --mandir=DIR to set MANDIR
  2014-09-23 12:23       ` Olaf Hering
@ 2014-09-23 12:36         ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 12:36 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:23 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > Maybe we are just using it wrong and we should be doing in Paths.mk.in:
> >         prefix=@prefix@
> >         datarootdir=@datarootdir@
> >         mandir=@mandir@
> >         ...
> >         MANDIR=\$mandir
> > 
> > (or even just switching our code to $mandir). Perhaps looking at what
> > automake would put in Makefile.in for a generic project would be
> > informative?
> > 
> > That would be a bigger change though and I'd be OK with deferring for
> > now.
> 
> With automake the resulting variables are all lowercase. Perhaps thats
> the reason why configure uses also lowercase. Just xen uses uppercase
> for all variables.
> 
> So my options are either: expand to lowercase variables and assign to
> existing uppercase variables later in that file. Or do a treewide
> conversion from upper to lowercase.
> 
> Looks like the simplest change would be to expand all variables from
> configure in Paths.mk and assign them later to existing variables.

Ack.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var
  2014-09-23 10:18   ` Ian Campbell
@ 2014-09-23 12:37     ` Olaf Hering
  2014-09-23 12:39       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:37 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> >  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 ;;
> 
> I've been continually surprised in this series that autoconf doesn't
> just Do The Right Thing on different $host_os's. I thought that was the
> point of it.

I'm not sure what you mean. autoconf has no knowledge of a lockdir
AFAICS. Its just that BSD puts the locks in /var/lib instead of
/var/lock, so there has to be a place to describe that.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-23 12:34     ` Olaf Hering
@ 2014-09-23 12:38       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 12:38 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:34 +0200, Olaf Hering wrote:
> > > -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
> > > +if test "x$libexecdir" = 'x${exec_prefix}/libexec' ; then
> > > +    case "$host_os" in
> > > +         *netbsd*)
> > > +         libexecdir=$prefix/libexec
> > > +         ;;
> > > +         *)
> > > +         libexecdir=$prefix/lib
> > > +         ;;
> > > +    esac
> > > +fi
> > 
> > I'm wondering if we should just accept the autoconf default here.
> > Distros which differ from that default (Debian? I thought RPM distros
> > used libexec) are presumably used to passing ---with-libexecdir=.
> 
> At least SUSE uses /usr/lib as libexec.

I stand corrected then.

> So its up to the configure scripts to append "package
> name". I will check what other packages do, but I think my change is
> correct in that part.

Yes I agree, it was the prefix bit I was wondering about.

> Regarding libexec/ vs. lib/: it would change existing behaviour. In the
> end it would most likely not matter because the tools find the binaries
> anyway. Stuff will just end up in different directories. Existing
> domU.cfg files, which refer to a hardcoded path to qemu, hvmloader or
> whatever will need an update. Perhaps the offending line can be removed
> altogether from domU.cfg.
> 
> So if you want, the hunk above can be changed to a plain LIBEXEC=$libexecdir/xen

We certainly shouldn't change it at the same time as this change. If at
all it should be done as a separate change of the default. Perhaps we
should revisit all the places where we deviate from/override the
autoconf defaults after 4.5 instead of doing it now?

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var
  2014-09-23 12:37     ` Olaf Hering
@ 2014-09-23 12:39       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 12:39 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Ian Jackson, Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:37 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > >  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 ;;
> > 
> > I've been continually surprised in this series that autoconf doesn't
> > just Do The Right Thing on different $host_os's. I thought that was the
> > point of it.
> 
> I'm not sure what you mean. autoconf has no knowledge of a lockdir
> AFAICS.

Right, and since this is something which varies between systems this
surprises me...

>  Its just that BSD puts the locks in /var/lib instead of
> /var/lock, so there has to be a place to describe that.

Understood, I just wonder why autoconf doesn't do it for us (not just
here but most place that check $host_os)

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-23 10:28   ` Ian Campbell
  2014-09-23 10:36     ` Olaf Hering
@ 2014-09-23 12:41     ` Olaf Hering
  2014-09-23 12:44       ` Ian Campbell
  1 sibling, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:41 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > +LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
> 
> Why does this need to be laundered via eval? There's no sensible way a
> user could want to pass in \$thing and expect it to expand to something
> useful, is there?

I decided to use a multiline assignment to make futher patches to the
content easier to read. If the variable is expanded it will appear as is
in the Makefile, resulting in syntax errors. Maybe a single echo would
work as well. 
Will check if this can be improved. But I fear there is not much that
can be done to achieve "\$thing".

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-23 12:41     ` Olaf Hering
@ 2014-09-23 12:44       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 12:44 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:41 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > +LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
> > 
> > Why does this need to be laundered via eval? There's no sensible way a
> > user could want to pass in \$thing and expect it to expand to something
> > useful, is there?
> 
> I decided to use a multiline assignment to make futher patches to the
> content easier to read. If the variable is expanded it will appear as is
> in the Makefile, resulting in syntax errors.

Ah, so you are just trying to fold the \n, ok.

> Maybe a single echo would work as well. 

I would expect so.

It's possible that the application of some more "s (e..g in the
initscript itself) might also work.

> Will check if this can be improved. But I fear there is not much that
> can be done to achieve "\$thing".

Oh, we don't actually want that, I just thought that was what you were
trying to do for some reason.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 33/46] Add configure --with-bash_completion-dir=DIR
  2014-09-23 10:32   ` Ian Campbell
@ 2014-09-23 12:49     ` Olaf Hering
  0 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:49 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> I'm not so sure about this. If someone is installing things into $prefix
> or $prefix/etc etc then $prefix/etc/bash_completion.d seems like the
> right thing for us to do.

I'm fine with using a hardcoded path, based on $sysconfdir.
Will update the patch.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk
  2014-09-23 10:33   ` Ian Campbell
@ 2014-09-23 12:52     ` Olaf Hering
  2014-09-23 12:59       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:52 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> What is the distinction between the two and why do we prefer the caps
> version?

$prefix comes from autoconf/automake, PREFIX is used in xen source.
Since the variable SYSTEMD_DIR= is expanded, $(prefix)/something would
expand to /something because prefix= does not exist anymore once this
whole series is applied.

But as stated in an earier reply, maybe we expand to lowercase variables
in Paths.mk and assign to our uppercase variables as needed. Then this
patch can be dropped.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build
  2014-09-23 10:37   ` Ian Campbell
@ 2014-09-23 12:55     ` Olaf Hering
  0 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:55 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Paths.mk contains just directories set by configure.
> > Source this file first when building docs,stubdom or tools.
> 
> Is it important that this comes before something? (Config.mk?
> $subsystem.mk?) or could we incorporate this include into $subsystem.mk?
> 
> Alternatively could $subsystem.mk be moved before Config.mk?

Right now docs and stubdom have a different order than tools. The reason
is most likely that Tools.mk wants to know about XEN_OS to catch the
rump kernel. 

I will see what has to be done to make the order of inclusion
consistent.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 38/46] Move xenconsoled to libexec
  2014-09-23 10:40   ` Ian Campbell
@ 2014-09-23 12:56     ` Olaf Hering
  2014-09-23 13:01       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:56 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > xenconsoled is started by runlevel scripts, its not supposed to be
> > called by admin.  So move it out of the way into LIBEXEC_BIN.
> 
> It's pretty normal/conventional for daemons to be in $sbin, I think.
> 
> I think the point is that although daemons might normally be started by
> an initscript it is also allowable (and occasionally useful) to start
> them by hand or via other means. In contrast to something like the
> libxl-save-helper which is something which does belong in libexec.
> 
> I'd be reluctant to change this without a reference to something like
> the FHS to back up why it should be in libexec.

Is it possible to restart the daemons which I move to libexec? I think
at least xenstored can not be restarted. So it does not make much sense
to have it in $sbin, because its a run once thing.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  2014-09-23 10:41   ` Ian Campbell
@ 2014-09-23 12:58     ` Olaf Hering
  2014-09-23 13:01       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 12:58 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > ---
> >  Config.mk                                               | 2 +-
> >  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 +-
> 
> Does tools/ocaml/xenstore need a similar change?

No, only the files above hardcode /var/lib/xenstored instead of using
the existing XEN_LIB_STORED variable.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk
  2014-09-23 12:52     ` Olaf Hering
@ 2014-09-23 12:59       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 12:59 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:52 +0200, Olaf Hering wrote:
> prefix= does not exist anymore once this whole series is applied.

That's the bit which wasn't clear to me when I reached this point...

> But as stated in an earier reply, maybe we expand to lowercase variables
> in Paths.mk and assign to our uppercase variables as needed. Then this
> patch can be dropped.

I think it is worth trying that approach (i.e. closer to the
autoconf/automake norm).

Whether we then take this a step further and start using the standard
names throughout the code base (rather than just in Paths.mk) is a
question for 4.6 I think.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  2014-09-23 12:58     ` Olaf Hering
@ 2014-09-23 13:01       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 13:01 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:58 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > > ---
> > >  Config.mk                                               | 2 +-
> > >  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 +-
> > 
> > Does tools/ocaml/xenstore need a similar change?
> 
> No, only the files above hardcode /var/lib/xenstored instead of using
> the existing XEN_LIB_STORED variable.

Great!

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen
  2014-09-23 10:44   ` Ian Campbell
@ 2014-09-23 13:01     ` Olaf Hering
  2014-09-23 13:06       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 13:01 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Also remove duplicate XEN_RUN_DIR from m4/paths.m4.
> > Fix XEN_RUN_DIR expansion in toplevel Makefile
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > ---
> >  Makefile                                                          | 2 +-
> >  m4/paths.m4                                                       | 3 ---
> >  tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 2 +-
> >  3 files changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 7558262..b0742cf 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -221,7 +221,7 @@ uninstall:
> >  	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*
> > +	rm -rf $(D)$(XEN_RUN_DIR)/* $(D)/var/lib/xen*
> 
> This would previous have removed XEN_RUN_DIR itself and not just the
> contents. It would also have historically also cleaned up
> $(XEN_RUN_DIR)d (i.e. xend...)!
> 
> Perhaps just add an rmdir to follow this, globbing the dir is indeed
> pretty skanky (and probably annoies e.g. the xenomai maintainers!)

The uninstall target is indeed special. It leaves half of the make
install result on the system. And the globbing needs more work.

I will address this in the next version of the patch.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 38/46] Move xenconsoled to libexec
  2014-09-23 12:56     ` Olaf Hering
@ 2014-09-23 13:01       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 13:01 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 14:56 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > xenconsoled is started by runlevel scripts, its not supposed to be
> > > called by admin.  So move it out of the way into LIBEXEC_BIN.
> > 
> > It's pretty normal/conventional for daemons to be in $sbin, I think.
> > 
> > I think the point is that although daemons might normally be started by
> > an initscript it is also allowable (and occasionally useful) to start
> > them by hand or via other means. In contrast to something like the
> > libxl-save-helper which is something which does belong in libexec.
> > 
> > I'd be reluctant to change this without a reference to something like
> > the FHS to back up why it should be in libexec.
> 
> Is it possible to restart the daemons which I move to libexec? I think
> at least xenstored can not be restarted. So it does not make much sense
> to have it in $sbin, because its a run once thing.

I don't think run once vs restartable is a consideration here. Even the
first run might be manual. I don't think FHS makes a distinction like
this.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 43/46] Move systemd paths to Paths.mk
  2014-09-23 10:44   ` Ian Campbell
@ 2014-09-23 13:03     ` Olaf Hering
  2014-09-23 13:06       ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 13:03 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Every path should be in Paths.mk.
> 
> XEN_SYSTEMD_MODULES_LOAD is a path?

Yes, it contains various foo.conf files, with modules to load on boot.
m4/systemd.m4:77: SYSTEMD_MODULES_LOAD="\$(PREFIX)/lib/modules-load.d/"

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall
  2014-09-23 10:47   ` Ian Campbell
@ 2014-09-23 13:05     ` Olaf Hering
  0 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2014-09-23 13:05 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, Sep 23, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > make uninstall references various variable paths.
> 
> > If they are not set it may wipe /*.
> 
> Urk!
> 
> I think the uninstall run may need some sort of sanity check to ensure
> you have run configure then.

I will rework this patch.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 43/46] Move systemd paths to Paths.mk
  2014-09-23 13:03     ` Olaf Hering
@ 2014-09-23 13:06       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 13:06 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 15:03 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > Every path should be in Paths.mk.
> > 
> > XEN_SYSTEMD_MODULES_LOAD is a path?
> 
> Yes, it contains various foo.conf files, with modules to load on boot.
> m4/systemd.m4:77: SYSTEMD_MODULES_LOAD="\$(PREFIX)/lib/modules-load.d/"

Ah right.

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen
  2014-09-23 13:01     ` Olaf Hering
@ 2014-09-23 13:06       ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-23 13:06 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-23 at 15:01 +0200, Olaf Hering wrote:
> On Tue, Sep 23, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > Also remove duplicate XEN_RUN_DIR from m4/paths.m4.
> > > Fix XEN_RUN_DIR expansion in toplevel Makefile
> > > 
> > > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > > ---
> > >  Makefile                                                          | 2 +-
> > >  m4/paths.m4                                                       | 3 ---
> > >  tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 2 +-
> > >  3 files changed, 2 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/Makefile b/Makefile
> > > index 7558262..b0742cf 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -221,7 +221,7 @@ uninstall:
> > >  	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*
> > > +	rm -rf $(D)$(XEN_RUN_DIR)/* $(D)/var/lib/xen*
> > 
> > This would previous have removed XEN_RUN_DIR itself and not just the
> > contents. It would also have historically also cleaned up
> > $(XEN_RUN_DIR)d (i.e. xend...)!
> > 
> > Perhaps just add an rmdir to follow this, globbing the dir is indeed
> > pretty skanky (and probably annoies e.g. the xenomai maintainers!)
> 
> The uninstall target is indeed special. It leaves half of the make
> install result on the system. And the globbing needs more work.

To say the least.

> I will address this in the next version of the patch.

Just the wrinkle above? Feel free to ignore the larger Yakk for the time
bein ;-)

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-22 16:22   ` Ian Campbell
  2014-09-23 12:17     ` Olaf Hering
@ 2014-09-24 12:11     ` Olaf Hering
  2014-09-29 12:13       ` Ian Campbell
  1 sibling, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-24 12:11 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, Sep 22, Ian Campbell wrote:

> On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Google suggests that this is more commonly --with-initddir and that
> matches the existing --with-foodir options.
> 
> It also looks like they commonly default to just $sysconfdir/init.d
> rather than detecting based on $host.

Are you saying the detection should be removed, and configure --opt=dir
has to be specified on Fedora or BSD?

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-24 12:11     ` Olaf Hering
@ 2014-09-29 12:13       ` Ian Campbell
  2014-09-30 12:05         ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: Ian Campbell @ 2014-09-29 12:13 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Wed, 2014-09-24 at 14:11 +0200, Olaf Hering wrote:
> On Mon, Sep 22, Ian Campbell wrote:
> 
> > On Mon, 2014-09-22 at 15:00 +0200, Olaf Hering wrote:
> > > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > 
> > Google suggests that this is more commonly --with-initddir and that
> > matches the existing --with-foodir options.
> > 
> > It also looks like they commonly default to just $sysconfdir/init.d
> > rather than detecting based on $host.
> 
> Are you saying the detection should be removed, and configure --opt=dir
> has to be specified on Fedora or BSD?

It's something we could consider if we think that they are already
dealing with this (perhaps automatically) for the majority of things
which they package.

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-29 12:13       ` Ian Campbell
@ 2014-09-30 12:05         ` Olaf Hering
  2014-09-30 12:24           ` Ian Campbell
  0 siblings, 1 reply; 116+ messages in thread
From: Olaf Hering @ 2014-09-30 12:05 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, Sep 29, Ian Campbell wrote:

> On Wed, 2014-09-24 at 14:11 +0200, Olaf Hering wrote:
> > Are you saying the detection should be removed, and configure --opt=dir
> > has to be specified on Fedora or BSD?
> It's something we could consider if we think that they are already
> dealing with this (perhaps automatically) for the majority of things
> which they package.

"they" as in packagers at RHAT is different from people who compile xen
on their on.
Today everyone has to pass at least --libdir= for 64bit builds.

If the 4.5 release notes state clearly that building the tools slightly
changed compared to 4.4 I'm fine with removing the detection.

I plan to add documentation for configure to the README and the Wiki,
once my prefix series goes into 4.5.

Olaf

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 19/46] Add configure --with-initd-dir=DIR
  2014-09-30 12:05         ` Olaf Hering
@ 2014-09-30 12:24           ` Ian Campbell
  0 siblings, 0 replies; 116+ messages in thread
From: Ian Campbell @ 2014-09-30 12:24 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, George Dunlap,
	Tim Deegan, Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Tue, 2014-09-30 at 14:05 +0200, Olaf Hering wrote:
> On Mon, Sep 29, Ian Campbell wrote:
> 
> > On Wed, 2014-09-24 at 14:11 +0200, Olaf Hering wrote:
> > > Are you saying the detection should be removed, and configure --opt=dir
> > > has to be specified on Fedora or BSD?
> > It's something we could consider if we think that they are already
> > dealing with this (perhaps automatically) for the majority of things
> > which they package.
> 
> "they" as in packagers at RHAT is different from people who compile xen
> on their on.
> Today everyone has to pass at least --libdir= for 64bit builds.

"They" here would be both, since both cases would need to deal with this
regardless of who they are.

The important bit is "if we think that they are already dealing with
this" where "this" is "variation in initscript install dir between
distros". I don't know if that is the case. It depends on what the norm
among autoconf using projects is. TBH I would have expected there to be
a standard macro for this, if that's not the case then either projects
ignore this or they are all hand coding their own detection.

> If the 4.5 release notes state clearly that building the tools slightly
> changed compared to 4.4 I'm fine with removing the detection.
> 
> I plan to add documentation for configure to the README and the Wiki,
> once my prefix series goes into 4.5.

Excellent.

Have you raised this series with Konrad for a release ack (I can't
remember if I mentioned this already).

Ian.

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
  2014-09-22 12:59 ` [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
@ 2016-04-11 16:34   ` George Dunlap
  2016-04-12 16:18     ` Olaf Hering
  0 siblings, 1 reply; 116+ messages in thread
From: George Dunlap @ 2016-04-11 16:34 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Keir Fraser, David Scott, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Jan Beulich, Samuel Thibault

On Mon, Sep 22, 2014 at 1:59 PM, Olaf Hering <olaf@aepfle.de> wrote:
> Use XEN_LOCK_DIR because it is a compiletime setting.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  tools/hotplug/Linux/xendomains | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/tools/hotplug/Linux/xendomains b/tools/hotplug/Linux/xendomains
> index 0794bb9..c45f132 100644
> --- a/tools/hotplug/Linux/xendomains
> +++ b/tools/hotplug/Linux/xendomains
> @@ -49,12 +49,7 @@ if ! [ -e /proc/xen/privcmd ]; then
>         exit 0
>  fi
>
> -# See docs/misc/distro_mapping.txt
> -if [ -d /var/lock/subsys ]; then
> -       LOCKFILE=/var/lock/subsys/xendomains
> -else
> -       LOCKFILE=/var/lock/xendomains
> -fi
> +LOCKFILE=${XEN_LOCK_DIR}/xendomains

Unfortunately, this is wrong.

On RHEL-based systems, the sysv init system uses
/var/lock/subsys/${service} as an indicator of whether it should call
"${service} stop".  With this change, xendomains will no longer be run
on shutdown on RHEL-based systems, even if it successfully touched*
${LOCKFILE}.

I'm not 100% sure what a proper non-hardcoded fix would be.  Maybe
something like this?

if [ -d ${XEN_LOCK_DIR}/subsys ] ; then
    LOCKFILE=${XEN_LOCK_DIR}/subsys/xendomains
else
    LOCKFILE=${XEN_LOCK_DIR}/xendomains
fi

 -George

(* I say "successfully touched ${LOCKFILE}" because there's apparently
another bug on RHEL-based systems:
- "xendomains start" will only touch ${LOCKFILE} if it actually
started at least one domain
- As noted above, the sysv init will only call "xendomains stop" on
shutdown if the lockfile exists
- So "xendomains start" didn't create any VMs, running VMs won't be
saved when you reboot on RHEL-based systems

This patch just made things consistently never run at all.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 116+ messages in thread

* Re: [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
  2016-04-11 16:34   ` George Dunlap
@ 2016-04-12 16:18     ` Olaf Hering
  0 siblings, 0 replies; 116+ messages in thread
From: Olaf Hering @ 2016-04-12 16:18 UTC (permalink / raw)
  To: George Dunlap
  Cc: Stefano Stabellini, Ian Jackson, David Scott, Jan Beulich, xen-devel

On Mon, Apr 11, George Dunlap wrote:

> if [ -d ${XEN_LOCK_DIR}/subsys ] ; then
>     LOCKFILE=${XEN_LOCK_DIR}/subsys/xendomains
> else
>     LOCKFILE=${XEN_LOCK_DIR}/xendomains
> fi

This will probably work, yes.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 116+ messages in thread

end of thread, other threads:[~2016-04-12 16:18 UTC | newest]

Thread overview: 116+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 12:59 [PATCH 00/45 v3] tool changes to honor configure --prefix=DIR Olaf Hering
2014-09-22 12:59 ` [PATCH 01/46] stubdom: fix lwip compile Olaf Hering
2014-09-22 12:59 ` [PATCH 02/46] tools/xenpaging: create dumpdir with mode 0700 Olaf Hering
2014-09-22 15:52   ` Ian Campbell
2014-09-22 12:59 ` [PATCH 03/46] install.sh: Preserve permissions from make install Olaf Hering
2014-09-22 15:54   ` Ian Campbell
2014-09-23 12:14     ` Olaf Hering
2014-09-23 12:36       ` Ian Campbell
2014-09-22 12:59 ` [PATCH 04/46] tools/mkrpm: allow custom rpm package name Olaf Hering
2014-09-22 15:55   ` Ian Campbell
2014-09-22 12:59 ` [PATCH 05/46] tools: remove obsolete path.py from tools/python Olaf Hering
2014-09-22 15:55   ` Ian Campbell
2014-09-22 12:59 ` [PATCH 06/46] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
2014-09-22 15:29   ` Andrew Cooper
2014-09-22 15:36     ` Ian Campbell
2014-09-22 12:59 ` [PATCH 07/46] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
2014-09-22 12:59 ` [PATCH 08/46] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
2014-09-22 12:59 ` [PATCH 09/46] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
2016-04-11 16:34   ` George Dunlap
2016-04-12 16:18     ` Olaf Hering
2014-09-22 12:59 ` [PATCH 10/46] tools/examples: remove obsolete install targets Olaf Hering
2014-09-22 13:00 ` [PATCH 11/46] remove obsolete SUBSYS_DIR variable Olaf Hering
2014-09-22 13:00 ` [PATCH 12/46] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
2014-09-22 13:00 ` [PATCH 13/46] Config.mk: replace dependency to genpath with actual target Olaf Hering
2014-09-22 15:59   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 14/46] Config.mk: add new macro buildmakevars2header Olaf Hering
2014-09-22 16:04   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 15/46] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
2014-09-22 13:00 ` [PATCH 16/46] tools/libxc: provide variable paths to libxc Olaf Hering
2014-09-22 13:00 ` [PATCH 17/46] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
2014-09-22 13:00 ` [PATCH 18/46] Use configure --sysconfdir=DIR to set CONFIG_DIR Olaf Hering
2014-09-22 16:13   ` Ian Campbell
2014-09-23  9:46     ` Ian Campbell
2014-09-22 13:00 ` [PATCH 19/46] Add configure --with-initd-dir=DIR Olaf Hering
2014-09-22 16:22   ` Ian Campbell
2014-09-23 12:17     ` Olaf Hering
2014-09-24 12:11     ` Olaf Hering
2014-09-29 12:13       ` Ian Campbell
2014-09-30 12:05         ` Olaf Hering
2014-09-30 12:24           ` Ian Campbell
2014-09-22 13:00 ` [PATCH 20/46] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
2014-09-22 16:27   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 21/46] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
2014-09-22 16:38   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 22/46] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
2014-09-23  9:23   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 23/46] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
2014-09-23  9:24   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 24/46] remove duplicate variables from config Olaf Hering
2014-09-23  9:25   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 25/46] Use configure --mandir=DIR to set MANDIR Olaf Hering
2014-09-23  9:32   ` Ian Campbell
2014-09-23  9:36     ` Ian Campbell
2014-09-23 12:23       ` Olaf Hering
2014-09-23 12:36         ` Ian Campbell
2014-09-22 13:00 ` [PATCH 26/46] Use configure --docdir=DIR to set DOCDIR Olaf Hering
2014-09-22 13:00 ` [PATCH 27/46] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
2014-09-22 13:00 ` [PATCH 28/46] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
2014-09-23  9:45   ` Ian Campbell
2014-09-23 12:34     ` Olaf Hering
2014-09-23 12:38       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 29/46] Use configure --prefix=DIR to set PREFIX Olaf Hering
2014-09-23 10:14   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 30/46] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
2014-09-23 10:18   ` Ian Campbell
2014-09-23 12:37     ` Olaf Hering
2014-09-23 12:39       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 31/46] Add configure --enable-rpath Olaf Hering
2014-09-23 10:23   ` Ian Campbell
2014-09-23 10:37     ` Olaf Hering
2014-09-22 13:00 ` [PATCH 32/46] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
2014-09-23 10:28   ` Ian Campbell
2014-09-23 10:36     ` Olaf Hering
2014-09-23 10:50       ` Ian Campbell
2014-09-23 12:41     ` Olaf Hering
2014-09-23 12:44       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 33/46] Add configure --with-bash_completion-dir=DIR Olaf Hering
2014-09-23 10:32   ` Ian Campbell
2014-09-23 12:49     ` Olaf Hering
2014-09-22 13:00 ` [PATCH 34/46] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
2014-09-23 10:33   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 35/46] Use just PREFIX to reference the path in Paths.mk Olaf Hering
2014-09-23 10:33   ` Ian Campbell
2014-09-23 12:52     ` Olaf Hering
2014-09-23 12:59       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 36/46] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
2014-09-23 10:34   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 37/46] Use Paths.mk for docs, stubdom and tools build Olaf Hering
2014-09-23 10:37   ` Ian Campbell
2014-09-23 12:55     ` Olaf Hering
2014-09-22 13:00 ` [PATCH 38/46] Move xenconsoled to libexec Olaf Hering
2014-09-23 10:40   ` Ian Campbell
2014-09-23 12:56     ` Olaf Hering
2014-09-23 13:01       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 39/46] Move xenstored " Olaf Hering
2014-09-23 10:41   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 40/46] Move xenwatchdogd " Olaf Hering
2014-09-22 13:00 ` [PATCH 41/46] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
2014-09-23 10:41   ` Ian Campbell
2014-09-23 12:58     ` Olaf Hering
2014-09-23 13:01       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 42/46] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
2014-09-23 10:44   ` Ian Campbell
2014-09-23 13:01     ` Olaf Hering
2014-09-23 13:06       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 43/46] Move systemd paths to Paths.mk Olaf Hering
2014-09-23 10:44   ` Ian Campbell
2014-09-23 13:03     ` Olaf Hering
2014-09-23 13:06       ` Ian Campbell
2014-09-22 13:00 ` [PATCH 44/46] Include Paths.mk in toplevel Makefile to fix uninstall Olaf Hering
2014-09-23 10:47   ` Ian Campbell
2014-09-23 13:05     ` Olaf Hering
2014-09-22 13:00 ` [PATCH 45/46] Move MAN1DIR and MAN8DIR to Paths.mk Olaf Hering
2014-09-23 10:47   ` Ian Campbell
2014-09-22 13:00 ` [PATCH 46/46] rerun autogen.sh Olaf Hering
2014-09-23 10:48   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).