All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Cc: Olaf Hering <olaf@aepfle.de>, Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
Date: Wed,  1 Oct 2014 18:41:07 +0200	[thread overview]
Message-ID: <1412181690-19609-6-git-send-email-olaf@aepfle.de> (raw)
In-Reply-To: <1412181690-19609-1-git-send-email-olaf@aepfle.de>

Helper scripts get installed into XEN_SCRIPT_DIR, but initscripts,
helper scripts and udev rules still refer to the hardcoded location
/etc/xen/scripts/. Update scripts, rules and Makefile to refer to
@XEN_SCRIPT_DIR@ instead.

Update configure.ac to substitute the path in files using
XEN_SCRIPT_DIR. Remove XEN_SCRIPT_DIR from StdGNU.mk and SunOS.mk, its
already in Paths.mk.

Note: In SunOS.mk it refered to PRIVATE_PREFIX, which was introduced by
9f6d07bac9f14aaa8bafe38b4a217e61a3a57842 ("tools: get rid of hardcoded
config dirs").

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 .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 67ed7cb..4344c52 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 cfa4dd6..cb77811 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"

  parent reply	other threads:[~2014-10-01 16:41 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
2014-10-01 16:41 ` [PATCH 01/28] tools: fix make uninstall Olaf Hering
2014-10-02 14:11   ` Ian Campbell
2014-10-01 16:41 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
2014-10-06 13:48   ` Konrad Rzeszutek Wilk
2014-10-01 16:41 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
2014-10-01 16:41 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
2014-10-01 16:41 ` Olaf Hering [this message]
2014-10-01 16:41 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
2014-10-01 16:41 ` [PATCH 07/28] tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
2014-10-01 16:41 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
2014-10-01 16:41 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
2014-10-01 16:41 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
2014-10-01 16:41 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
2014-10-06 15:40   ` Ian Campbell
2014-10-06 15:53     ` [PATCH] QEMU_TAG update FOR FOLDING INTO LIBEXEC PATCH Ian Jackson
2014-10-07  6:52     ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
2014-10-01 16:41 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
2014-10-01 16:41 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
2014-10-01 16:41 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
2014-10-01 16:41 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
2014-10-01 16:41 ` [PATCH 20/28] Move variable to set bash_completion.d to Paths.mk Olaf Hering
2014-10-01 16:41 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
2014-10-01 16:41 ` [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
2014-10-01 16:41 ` [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
2014-10-01 16:41 ` [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build Olaf Hering
2014-10-01 16:41 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
2014-10-01 16:41 ` [PATCH 26/28] tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
2014-10-01 16:41 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
2014-10-01 21:51   ` Daniel De Graaf
2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
2014-10-02  7:26   ` Jan Beulich
2014-10-02  8:00     ` Olaf Hering
2014-10-02  8:06       ` Jan Beulich
2014-10-02  9:52         ` Tim Deegan
2014-10-02 10:27           ` Jan Beulich
2014-10-02 16:52             ` Andrew Cooper
2014-10-06  7:31               ` Jan Beulich
2014-10-06  7:40                 ` Olaf Hering
2014-10-02 10:45         ` Olaf Hering
2014-10-02 14:15   ` Ian Campbell
2014-10-06  8:55   ` [PATCH v2] " Olaf Hering
2014-10-06  9:03     ` Jan Beulich
2014-10-08 12:45       ` Ian Campbell
2014-10-08 12:55         ` Olaf Hering
2014-10-08 13:18           ` Olaf Hering
2014-10-06 14:05 ` [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Konrad Rzeszutek Wilk
2014-10-06 16:32 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2014-09-25 15:19 [PATCH 00/28 v4] " Olaf Hering
2014-09-25 15:20 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412181690-19609-6-git-send-email-olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.