* [PATCH 00/13 v2] tools changes to honor --prefix=
@ 2014-07-28 9:05 Olaf Hering
2014-07-28 9:05 ` [PATCH 01/13] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
` (12 more replies)
0 siblings, 13 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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 series contains also two unrelated cleanup changes at the end.
This is a resend of the same series with the comments incorporated:
http://lists.xenproject.org/archives/html/xen-devel/2014-04/msg03240.html
Huge CC list due to changes in Config.mk.
Olaf
Olaf Hering (13):
Config.mk: move directory list into BUILD_MAKE_VARS
Config.mk: replace dependency to genpath with actual targe
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
tools/pygrub: store kernels in /var/run/xen/pygrub
tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
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
.gitignore | 9 +++++
Config.mk | 30 +++++++++++-----
docs/misc/distro_mapping.txt | 1 -
stubdom/Makefile | 16 ++++-----
tools/examples/Makefile | 21 +-----------
tools/hotplug/Linux/Makefile | 40 +++++++++++++++++++---
.../Linux/init.d/{xen-watchdog => xen-watchdog.in} | 2 +-
.../Linux/init.d/{xencommons => xencommons.in} | 5 +--
.../Linux/init.d/{xendomains => xendomains.in} | 2 +-
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} | 2 +-
tools/hotplug/Linux/{xendomains => xendomains.in} | 9 ++---
tools/hotplug/common/Makefile | 2 +-
tools/libxc/Makefile | 9 +++++
tools/libxc/xc_private.h | 1 +
tools/libxc/xc_suspend.c | 2 +-
tools/libxl/Makefile | 7 +---
tools/pygrub/src/pygrub | 9 ++++-
tools/python/Makefile | 2 +-
20 files changed, 113 insertions(+), 74 deletions(-)
rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%)
rename tools/hotplug/Linux/init.d/{xencommons => xencommons.in} (98%)
rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (97%)
rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (60%)
rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (60%)
rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (98%)
rename tools/hotplug/Linux/{xendomains => xendomains.in} (98%)
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH 01/13] Config.mk: move directory list into BUILD_MAKE_VARS
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 02/13] Config.mk: replace dependency to genpath with actual target Olaf Hering
` (11 subsequent siblings)
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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 5370e23..2408fa6 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] 31+ messages in thread
* [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
2014-07-28 9:05 ` [PATCH 01/13] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-08-26 20:00 ` Ian Campbell
2014-09-17 10:02 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 03/13] Config.mk: add new macro buildmakevars2header Olaf Hering
` (10 subsequent siblings)
12 siblings, 2 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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).
No change in behaviour is expected by this patch.
Note: target.tmp ($(1).tmp) is not marked as .PHONY because
move-if-changed in the target rule will remove target.tmp by renaming
it to target. As a result make will always attempt to rebuild it.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
Config.mk | 9 +++++----
stubdom/Makefile | 16 ++++++++--------
tools/hotplug/common/Makefile | 2 +-
tools/libxl/Makefile | 2 +-
tools/python/Makefile | 2 +-
5 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/Config.mk b/Config.mk
index 2408fa6..28e9930 100644
--- a/Config.mk
+++ b/Config.mk
@@ -172,11 +172,12 @@ BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR \
buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
define buildmakevars2file-closure
- .PHONY: genpath
- genpath:
- rm -f $(1).tmp; \
+ $(1).tmp:
+ rm -f $(1).newtmp; \
$(foreach var, $(BUILD_MAKE_VARS), \
- echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
+ echo "$(var)=\"$($(var))\"" >>$(1).newtmp;) \
+ $(call move-if-changed,$(1).newtmp,$(1).tmp)
+ $(1): $(1).tmp
$(call move-if-changed,$(1).tmp,$(1))
endef
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 6bea68b..333112c 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
##############
@@ -449,9 +449,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 bd0db3b..a3a25ac 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -159,7 +159,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,$@)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index c914332..7b25291 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -10,7 +10,7 @@ genpath-target = $(call buildmakevars2file,$(XENPATH))
$(eval $(genpath-target))
.PHONY: build
-build: genpath genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
+build: $(XENPATH) 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 \
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 03/13] Config.mk: add new macro buildmakevars2header
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
2014-07-28 9:05 ` [PATCH 01/13] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
2014-07-28 9:05 ` [PATCH 02/13] Config.mk: replace dependency to genpath with actual target Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-08-26 20:02 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 04/13] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
` (9 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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.
Note: if target ($(1)) is marked as .PHONY everything that depends on
target will be constantly rebuild. The reason for that seems to be that
make will internally drop target. As a result target is non-existant,
which triggers a rebuild. With the intermediate target.tmp this will not
happen because target changes only if target.tmp really changes.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
Config.mk | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/Config.mk b/Config.mk
index 28e9930..92c0567 100644
--- a/Config.mk
+++ b/Config.mk
@@ -181,6 +181,17 @@ define buildmakevars2file-closure
$(call move-if-changed,$(1).tmp,$(1))
endef
+buildmakevars2header = $(eval $(call buildmakevars2header-closure,$(1)))
+define buildmakevars2header-closure
+ $(1).tmp:
+ rm -f $(1).newtmp; \
+ $(foreach var, $(BUILD_MAKE_VARS), \
+ echo "#define $(var) \"$($(var))\"" >>$(1).newtmp;) \
+ $(call move-if-changed,$(1).newtmp,$(1).tmp)
+ $(1): $(1).tmp
+ $(call move-if-changed,$(1).tmp,$(1))
+endef
+
ifeq ($(debug_symbols),y)
CFLAGS += -g
endif
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 04/13] tools/libxl: use buildmakevars2header to create _paths.h
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (2 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 03/13] Config.mk: add new macro buildmakevars2header Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 05/13] tools/libxc: provide variable paths to libxc Olaf Hering
` (8 subsequent siblings)
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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 a3a25ac..1991661 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -146,7 +146,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
@@ -159,11 +159,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] 31+ messages in thread
* [PATCH 05/13] tools/libxc: provide variable paths to libxc
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (3 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 04/13] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 06/13] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
` (7 subsequent siblings)
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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 fefe13c..685df89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -306,6 +306,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 22eef8e..741053e 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 c50a7c9..e7a3422 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] 31+ messages in thread
* [PATCH 06/13] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (4 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 05/13] tools/libxc: provide variable paths to libxc Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 07/13] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
` (6 subsequent siblings)
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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] 31+ messages in thread
* [PATCH 07/13] tools/pygrub: store kernels in /var/run/xen/pygrub
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (5 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 06/13] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-08-26 20:04 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
` (5 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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>
---
tools/pygrub/src/pygrub | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 2618e11..9d8c5a1 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -14,6 +14,7 @@
#
import os, sys, string, struct, tempfile, re, traceback
+import errno
import copy
import logging
import platform
@@ -778,7 +779,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 +830,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] 31+ messages in thread
* [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (6 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 07/13] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-08-26 20:07 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 09/13] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
` (4 subsequent siblings)
12 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
.gitignore | 8 +++++
tools/hotplug/Linux/Makefile | 40 +++++++++++++++++++---
.../Linux/init.d/{xen-watchdog => xen-watchdog.in} | 2 +-
.../Linux/init.d/{xencommons => xencommons.in} | 2 +-
.../Linux/init.d/{xendomains => xendomains.in} | 2 +-
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} | 2 +-
tools/hotplug/Linux/{xendomains => xendomains.in} | 2 +-
9 files changed, 57 insertions(+), 19 deletions(-)
rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%)
rename tools/hotplug/Linux/init.d/{xencommons => xencommons.in} (99%)
rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (97%)
rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (60%)
rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (60%)
rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (98%)
rename tools/hotplug/Linux/{xendomains => xendomains.in} (99%)
diff --git a/.gitignore b/.gitignore
index 685df89..cf2febe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -159,6 +159,14 @@ 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/xencommons
+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/hotplug/Linux/_used_path.sh
tools/include/xen/*
tools/include/xen-foreign/*.(c|h|size)
tools/include/xen-foreign/checker
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index d5de9e6..fb9f1e6 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -32,18 +32,47 @@ XEN_SCRIPT_DATA += block-common.sh
UDEV_RULES_DIR = $(CONFIG_DIR)/udev
UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
+USED_PATH = "_used_path.sh"
+genpath-target = $(call buildmakevars2file,$(USED_PATH))
+$(eval $(genpath-target))
+
+XEN_SCRIPT_DIR_INPUTS := \
+ init.d/xen-watchdog.in \
+ init.d/xencommons.in \
+ init.d/xendomains.in \
+ vif-setup.in \
+ xen-backend.rules.in \
+ xen-hotplug-common.sh.in \
+ xendomains.in
+
+.SUFFIXES:
+XEN_SCRIPT_DIR_OUTPUTS := $(patsubst %.in,%,$(XEN_SCRIPT_DIR_INPUTS))
+%: %.in
+ set -e; \
+ rm -f $@.new ; \
+ sed 's|@@XEN_SCRIPT_DIR@@|$(XEN_SCRIPT_DIR)|g' $< >$@.new ; \
+ $(call move-if-changed,$@.new,$@)
+
+init.d/%: init.d/%.in
+ set -e; \
+ rm -f $@.new ; \
+ sed 's|@@XEN_SCRIPT_DIR@@|$(XEN_SCRIPT_DIR)|g' $< >$@.new ; \
+ $(call move-if-changed,$@.new,$@)
+
+$(XEN_SCRIPT_DIR_OUTPUTS): $(USED_PATH)
+
.PHONY: all
-all:
+all: build
.PHONY: build
-build:
+build: $(XEN_SCRIPT_DIR_OUTPUTS)
.PHONY: install
install: all install-initd install-scripts install-udev
# See docs/misc/distro_mapping.txt for INITD_DIR location
.PHONY: install-initd
-install-initd:
+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)
@@ -55,7 +84,7 @@ install-initd:
$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
.PHONY: install-scripts
-install-scripts:
+install-scripts: all
[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
set -e; for i in $(XEN_SCRIPTS); \
@@ -68,7 +97,7 @@ install-scripts:
done
.PHONY: install-udev
-install-udev:
+install-udev: all
[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
set -e; for i in $(UDEV_RULES); \
@@ -78,3 +107,4 @@ install-udev:
.PHONY: clean
clean:
+ rm -f $(XEN_SCRIPT_DIR_OUTPUTS)
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..d0d7966 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 b/tools/hotplug/Linux/init.d/xencommons.in
similarity index 99%
rename from tools/hotplug/Linux/init.d/xencommons
rename to tools/hotplug/Linux/init.d/xencommons.in
index 4ebd636..c62bdb8 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -18,7 +18,7 @@
# Description: Starts and stops the daemons neeeded for xl/xend
### END INIT INFO
-. /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 d0122fc..8eb7e6e 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 60%
rename from tools/hotplug/Linux/vif-setup
rename to tools/hotplug/Linux/vif-setup.in
index bcc462e..ce1ba56 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 60%
rename from tools/hotplug/Linux/xen-backend.rules
rename to tools/hotplug/Linux/xen-backend.rules.in
index a0d409e..8e01533 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..8128b9e 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 0794bb9..0882ef6 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] 31+ messages in thread
* [PATCH 09/13] tools/hotplug: create XEN_RUN_DIR at runtime
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (7 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 10/13] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
` (3 subsequent siblings)
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index c62bdb8..2326a9c 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -72,7 +72,7 @@ do_start () {
modprobe pciback 2>/dev/null
modprobe xen-acpi-processor 2>/dev/null
modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
- 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] 31+ messages in thread
* [PATCH 10/13] tools/hotplug: create XEN_LOCK_DIR at runtime
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (8 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 09/13] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 11/13] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
` (2 subsequent siblings)
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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 | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 2326a9c..0b14568 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -73,6 +73,7 @@ do_start () {
modprobe xen-acpi-processor 2>/dev/null
modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
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] 31+ messages in thread
* [PATCH 11/13] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (9 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 10/13] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-08-26 20:08 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 12/13] tools/examples: remove obsolete install targets Olaf Hering
2014-07-28 9:05 ` [PATCH 13/13] remove obsolete SUBSYS_DIR variable Olaf Hering
12 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
Use XEN_LOCK_DIR because it is a compiletime setting.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/hotplug/Linux/xendomains.in | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/tools/hotplug/Linux/xendomains.in b/tools/hotplug/Linux/xendomains.in
index 0882ef6..792b755 100644
--- a/tools/hotplug/Linux/xendomains.in
+++ b/tools/hotplug/Linux/xendomains.in
@@ -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] 31+ messages in thread
* [PATCH 12/13] tools/examples: remove obsolete install targets
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (10 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 11/13] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 13/13] remove obsolete SUBSYS_DIR variable Olaf Hering
12 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
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] 31+ messages in thread
* [PATCH 13/13] remove obsolete SUBSYS_DIR variable
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
` (11 preceding siblings ...)
2014-07-28 9:05 ` [PATCH 12/13] tools/examples: remove obsolete install targets Olaf Hering
@ 2014-07-28 9:05 ` Olaf Hering
2014-08-26 20:08 ` Ian Campbell
12 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-07-28 9:05 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Ian Campbell, Stefano Stabellini,
Tim Deegan, Ian Jackson, Jan Beulich, Samuel Thibault
/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>
---
Config.mk | 1 -
docs/misc/distro_mapping.txt | 1 -
2 files changed, 2 deletions(-)
diff --git a/Config.mk b/Config.mk
index 92c0567..18dbd4a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -75,7 +75,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] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-07-28 9:05 ` [PATCH 02/13] Config.mk: replace dependency to genpath with actual target Olaf Hering
@ 2014-08-26 20:00 ` Ian Campbell
2014-08-27 8:36 ` Olaf Hering
2014-09-17 10:02 ` Olaf Hering
1 sibling, 1 reply; 31+ messages in thread
From: Ian Campbell @ 2014-08-26 20:00 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering wrote:
Sorry for the delay in looking into this, I've been on vacation and
travel.
> 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).
>
> No change in behaviour is expected by this patch.
>
> Note: target.tmp ($(1).tmp) is not marked as .PHONY because
> move-if-changed in the target rule will remove target.tmp by renaming
> it to target. As a result make will always attempt to rebuild it.
Does the scheme you've got here end up differing from:
$(1):
rm -f $(1).tmp; \
$(foreach var, $(BUILD_MAKE_VARS), \
echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
$(call move-if-changed,$(1).tmp,$(1))
(i.e. avoiding the $(1).tmp rule)
Ian.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 03/13] Config.mk: add new macro buildmakevars2header
2014-07-28 9:05 ` [PATCH 03/13] Config.mk: add new macro buildmakevars2header Olaf Hering
@ 2014-08-26 20:02 ` Ian Campbell
0 siblings, 0 replies; 31+ messages in thread
From: Ian Campbell @ 2014-08-26 20:02 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Mon, 2014-07-28 at 11:05 +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.
>
> Note: if target ($(1)) is marked as .PHONY everything that depends on
> target will be constantly rebuild. The reason for that seems to be that
> make will internally drop target. As a result target is non-existant,
"existent"
> which triggers a rebuild. With the intermediate target.tmp this will not
> happen because target changes only if target.tmp really changes.
Similar to the previous patch do you really need $(1).tmp as a target as
well as a (non-.PHONY) $(1) target?
Ian.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 07/13] tools/pygrub: store kernels in /var/run/xen/pygrub
2014-07-28 9:05 ` [PATCH 07/13] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
@ 2014-08-26 20:04 ` Ian Campbell
0 siblings, 0 replies; 31+ messages in thread
From: Ian Campbell @ 2014-08-26 20:04 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Mon, 2014-07-28 at 11:05 +0200, 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>
> ---
> tools/pygrub/src/pygrub | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index 2618e11..9d8c5a1 100644
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -14,6 +14,7 @@
> #
>
> import os, sys, string, struct, tempfile, re, traceback
> +import errno
Isn't this unused? If so then with it removed:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
If it is used then the ack applies to the patch unchanged ;-)
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
2014-07-28 9:05 ` [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
@ 2014-08-26 20:07 ` Ian Campbell
2014-08-27 8:42 ` Olaf Hering
0 siblings, 1 reply; 31+ messages in thread
From: Ian Campbell @ 2014-08-26 20:07 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Mon, 2014-07-28 at 11:05 +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.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
> .gitignore | 8 +++++
> tools/hotplug/Linux/Makefile | 40 +++++++++++++++++++---
> .../Linux/init.d/{xen-watchdog => xen-watchdog.in} | 2 +-
> .../Linux/init.d/{xencommons => xencommons.in} | 2 +-
> .../Linux/init.d/{xendomains => xendomains.in} | 2 +-
> 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} | 2 +-
> tools/hotplug/Linux/{xendomains => xendomains.in} | 2 +-
> 9 files changed, 57 insertions(+), 19 deletions(-)
> rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%)
> rename tools/hotplug/Linux/init.d/{xencommons => xencommons.in} (99%)
> rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (97%)
> rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (60%)
> rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (60%)
> rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (98%)
> rename tools/hotplug/Linux/{xendomains => xendomains.in} (99%)
>
> diff --git a/.gitignore b/.gitignore
> index 685df89..cf2febe 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -159,6 +159,14 @@ 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/xencommons
> +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/hotplug/Linux/_used_path.sh
> tools/include/xen/*
> tools/include/xen-foreign/*.(c|h|size)
> tools/include/xen-foreign/checker
> diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> index d5de9e6..fb9f1e6 100644
> --- a/tools/hotplug/Linux/Makefile
> +++ b/tools/hotplug/Linux/Makefile
> @@ -32,18 +32,47 @@ XEN_SCRIPT_DATA += block-common.sh
> UDEV_RULES_DIR = $(CONFIG_DIR)/udev
> UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
>
> +USED_PATH = "_used_path.sh"
> +genpath-target = $(call buildmakevars2file,$(USED_PATH))
> +$(eval $(genpath-target))
I can't see where _used_path.sh is consumed.
> +%: %.in
> + set -e; \
> + rm -f $@.new ; \
> + sed 's|@@XEN_SCRIPT_DIR@@|$(XEN_SCRIPT_DIR)|g' $< >$@.new ; \
> + $(call move-if-changed,$@.new,$@)
Can you make these substitutions directly from tools/configure.ac? I
think Luis did something similar for the systemd stuff?
If not then you should remove all the "; \" bits and treat this as three
consecutive things in the normal way (the set -e becomes redundant
then).
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 11/13] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path
2014-07-28 9:05 ` [PATCH 11/13] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
@ 2014-08-26 20:08 ` Ian Campbell
0 siblings, 0 replies; 31+ messages in thread
From: Ian Campbell @ 2014-08-26 20:08 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering 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>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 13/13] remove obsolete SUBSYS_DIR variable
2014-07-28 9:05 ` [PATCH 13/13] remove obsolete SUBSYS_DIR variable Olaf Hering
@ 2014-08-26 20:08 ` Ian Campbell
0 siblings, 0 replies; 31+ messages in thread
From: Ian Campbell @ 2014-08-26 20:08 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering wrote:
> /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>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-08-26 20:00 ` Ian Campbell
@ 2014-08-27 8:36 ` Olaf Hering
2014-08-28 17:34 ` Ian Campbell
0 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-08-27 8:36 UTC (permalink / raw)
To: Ian Campbell
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Tue, Aug 26, Ian Campbell wrote:
> On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering wrote:
>
> Sorry for the delay in looking into this, I've been on vacation and
> travel.
>
> > 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).
> >
> > No change in behaviour is expected by this patch.
> >
> > Note: target.tmp ($(1).tmp) is not marked as .PHONY because
> > move-if-changed in the target rule will remove target.tmp by renaming
> > it to target. As a result make will always attempt to rebuild it.
>
> Does the scheme you've got here end up differing from:
>
> $(1):
> rm -f $(1).tmp; \
> $(foreach var, $(BUILD_MAKE_VARS), \
> echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
> $(call move-if-changed,$(1).tmp,$(1))
>
> (i.e. avoiding the $(1).tmp rule)
In my testing make did always rebuild the targets depending on _paths.h
for example. The reason is that _paths.h is .PHONY, which cause make to
drop _paths.h and see it as new, even if the content did not change.
With _paths.h.tmp being .PHONY _paths.h remains the same for make.
Not sure why that happens, perhaps thats how .PHONY works.
Olaf
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
2014-08-26 20:07 ` Ian Campbell
@ 2014-08-27 8:42 ` Olaf Hering
0 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-08-27 8:42 UTC (permalink / raw)
To: Ian Campbell
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Tue, Aug 26, Ian Campbell wrote:
> On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering wrote:
> > +++ b/tools/hotplug/Linux/Makefile
> > @@ -32,18 +32,47 @@ XEN_SCRIPT_DATA += block-common.sh
> > UDEV_RULES_DIR = $(CONFIG_DIR)/udev
> > UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
> >
> > +USED_PATH = "_used_path.sh"
> > +genpath-target = $(call buildmakevars2file,$(USED_PATH))
> > +$(eval $(genpath-target))
> I can't see where _used_path.sh is consumed.
I will add a comment, has something todo with the need to rerun the
rules if the PATHS do change.
> > +%: %.in
> > + set -e; \
> > + rm -f $@.new ; \
> > + sed 's|@@XEN_SCRIPT_DIR@@|$(XEN_SCRIPT_DIR)|g' $< >$@.new ; \
> > + $(call move-if-changed,$@.new,$@)
>
> Can you make these substitutions directly from tools/configure.ac? I
> think Luis did something similar for the systemd stuff?
Maybe, what I remmeber is that sed is used as well now.
I have to rebase my series to staging and see how the result looks like.
Olaf
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-08-27 8:36 ` Olaf Hering
@ 2014-08-28 17:34 ` Ian Campbell
2014-08-29 6:33 ` Olaf Hering
0 siblings, 1 reply; 31+ messages in thread
From: Ian Campbell @ 2014-08-28 17:34 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Wed, 2014-08-27 at 10:36 +0200, Olaf Hering wrote:
> On Tue, Aug 26, Ian Campbell wrote:
>
> > On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering wrote:
> >
> > Sorry for the delay in looking into this, I've been on vacation and
> > travel.
> >
> > > 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).
> > >
> > > No change in behaviour is expected by this patch.
> > >
> > > Note: target.tmp ($(1).tmp) is not marked as .PHONY because
> > > move-if-changed in the target rule will remove target.tmp by renaming
> > > it to target. As a result make will always attempt to rebuild it.
> >
> > Does the scheme you've got here end up differing from:
> >
> > $(1):
> > rm -f $(1).tmp; \
> > $(foreach var, $(BUILD_MAKE_VARS), \
> > echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
> > $(call move-if-changed,$(1).tmp,$(1))
> >
> > (i.e. avoiding the $(1).tmp rule)
>
> In my testing make did always rebuild the targets depending on _paths.h
> for example. The reason is that _paths.h is .PHONY, which cause make to
> drop _paths.h and see it as new, even if the content did not change.
It seems that the bug here is that _paths.h is .PHONY then. Without that
the use of move-if-changed would prevent the output file changing
unnecessarily and make would not bother to rebuild the dependents.
> With _paths.h.tmp being .PHONY _paths.h remains the same for make.
>
> Not sure why that happens, perhaps thats how .PHONY works.
It essentially indicates to make that the target is not an actual file
(it is in some sense "virtual") so make never checks for an existing
file.
Ian.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-08-28 17:34 ` Ian Campbell
@ 2014-08-29 6:33 ` Olaf Hering
2014-09-03 10:28 ` Ian Campbell
0 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-08-29 6:33 UTC (permalink / raw)
To: Ian Campbell
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Thu, Aug 28, Ian Campbell wrote:
> It seems that the bug here is that _paths.h is .PHONY then. Without that
> the use of move-if-changed would prevent the output file changing
> unnecessarily and make would not bother to rebuild the dependents.
It has to be checked every time to catch possible changes in the
variables. How would that be checked without a .PHONY target, $(1) in
this case?
Olaf
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-08-29 6:33 ` Olaf Hering
@ 2014-09-03 10:28 ` Ian Campbell
2014-09-03 10:43 ` Olaf Hering
0 siblings, 1 reply; 31+ messages in thread
From: Ian Campbell @ 2014-09-03 10:28 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Fri, 2014-08-29 at 08:33 +0200, Olaf Hering wrote:
> On Thu, Aug 28, Ian Campbell wrote:
>
> > It seems that the bug here is that _paths.h is .PHONY then. Without that
> > the use of move-if-changed would prevent the output file changing
> > unnecessarily and make would not bother to rebuild the dependents.
>
> It has to be checked every time to catch possible changes in the
> variables. How would that be checked without a .PHONY target, $(1) in
> this case?
Sounds like we need something similar to the FORCE target used by both
the xen subtree and Linux etc. See xen/Rules.mk.
Ian.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-09-03 10:28 ` Ian Campbell
@ 2014-09-03 10:43 ` Olaf Hering
0 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-09-03 10:43 UTC (permalink / raw)
To: Ian Campbell
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Wed, Sep 03, Ian Campbell wrote:
> Sounds like we need something similar to the FORCE target used by both
> the xen subtree and Linux etc. See xen/Rules.mk.
Thanks for the suggestion. I will have a look at this in about two weeks from now.
Olaf
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-07-28 9:05 ` [PATCH 02/13] Config.mk: replace dependency to genpath with actual target Olaf Hering
2014-08-26 20:00 ` Ian Campbell
@ 2014-09-17 10:02 ` Olaf Hering
2014-09-17 16:53 ` Ian Campbell
1 sibling, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-09-17 10:02 UTC (permalink / raw)
To: xen-devel
Cc: Keir Fraser, Ian Campbell, Stefano Stabellini, Tim Deegan,
Ian Jackson, Jan Beulich, Samuel Thibault
A question related to the change below:
How are the make variables supposed to be changed? Right now this can be
done either with rerunning configure (untested by me) and by calling
something like 'make SBINDIR=/x/y XEN_RUN_DIR=/a/b' (used as testcase).
I think we should arrange the code such that a new configure run is
required to change their value.
Olaf
On Mon, Jul 28, 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).
>
> No change in behaviour is expected by this patch.
>
> Note: target.tmp ($(1).tmp) is not marked as .PHONY because
> move-if-changed in the target rule will remove target.tmp by renaming
> it to target. As a result make will always attempt to rebuild it.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
> Config.mk | 9 +++++----
> stubdom/Makefile | 16 ++++++++--------
> tools/hotplug/common/Makefile | 2 +-
> tools/libxl/Makefile | 2 +-
> tools/python/Makefile | 2 +-
> 5 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/Config.mk b/Config.mk
> index 2408fa6..28e9930 100644
> --- a/Config.mk
> +++ b/Config.mk
> @@ -172,11 +172,12 @@ BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR \
>
> buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
> define buildmakevars2file-closure
> - .PHONY: genpath
> - genpath:
> - rm -f $(1).tmp; \
> + $(1).tmp:
> + rm -f $(1).newtmp; \
> $(foreach var, $(BUILD_MAKE_VARS), \
> - echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
> + echo "$(var)=\"$($(var))\"" >>$(1).newtmp;) \
> + $(call move-if-changed,$(1).newtmp,$(1).tmp)
> + $(1): $(1).tmp
> $(call move-if-changed,$(1).tmp,$(1))
> endef
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-09-17 10:02 ` Olaf Hering
@ 2014-09-17 16:53 ` Ian Campbell
2014-09-18 8:09 ` Olaf Hering
0 siblings, 1 reply; 31+ messages in thread
From: Ian Campbell @ 2014-09-17 16:53 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Wed, 2014-09-17 at 12:02 +0200, Olaf Hering wrote:
> A question related to the change below:
>
> How are the make variables supposed to be changed? Right now this can be
> done either with rerunning configure (untested by me) and by calling
> something like 'make SBINDIR=/x/y XEN_RUN_DIR=/a/b' (used as testcase).
>
> I think we should arrange the code such that a new configure run is
> required to change their value.
I think we've been moving (and should be moving) in the direction of
configuring these things via configure, so that would be ok by me. (I'm
assuming these don't affect the hypervisor build/install, which isn't
configure driven)
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-09-17 16:53 ` Ian Campbell
@ 2014-09-18 8:09 ` Olaf Hering
2014-09-18 17:44 ` Ian Campbell
0 siblings, 1 reply; 31+ messages in thread
From: Olaf Hering @ 2014-09-18 8:09 UTC (permalink / raw)
To: Ian Campbell
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Wed, Sep 17, Ian Campbell wrote:
> On Wed, 2014-09-17 at 12:02 +0200, Olaf Hering wrote:
> > A question related to the change below:
> >
> > How are the make variables supposed to be changed? Right now this can be
> > done either with rerunning configure (untested by me) and by calling
> > something like 'make SBINDIR=/x/y XEN_RUN_DIR=/a/b' (used as testcase).
> >
> > I think we should arrange the code such that a new configure run is
> > required to change their value.
>
> I think we've been moving (and should be moving) in the direction of
> configuring these things via configure, so that would be ok by me. (I'm
> assuming these don't affect the hypervisor build/install, which isn't
> configure driven)
Unfortunately, m4/paths.m4 shows that configure will change just prefix
and libdir. Other parts of config/Paths.mk.in are kind of hardcoded.
I will see how to implement a knob for at least CONFIG_DIR and INITD_DIR.
Olaf
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-09-18 8:09 ` Olaf Hering
@ 2014-09-18 17:44 ` Ian Campbell
2014-09-19 6:55 ` Olaf Hering
0 siblings, 1 reply; 31+ messages in thread
From: Ian Campbell @ 2014-09-18 17:44 UTC (permalink / raw)
To: Olaf Hering
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Thu, 2014-09-18 at 10:09 +0200, Olaf Hering wrote:
> On Wed, Sep 17, Ian Campbell wrote:
>
> > On Wed, 2014-09-17 at 12:02 +0200, Olaf Hering wrote:
> > > A question related to the change below:
> > >
> > > How are the make variables supposed to be changed? Right now this can be
> > > done either with rerunning configure (untested by me) and by calling
> > > something like 'make SBINDIR=/x/y XEN_RUN_DIR=/a/b' (used as testcase).
> > >
> > > I think we should arrange the code such that a new configure run is
> > > required to change their value.
> >
> > I think we've been moving (and should be moving) in the direction of
> > configuring these things via configure, so that would be ok by me. (I'm
> > assuming these don't affect the hypervisor build/install, which isn't
> > configure driven)
>
> Unfortunately, m4/paths.m4 shows that configure will change just prefix
> and libdir. Other parts of config/Paths.mk.in are kind of hardcoded.
> I will see how to implement a knob for at least CONFIG_DIR and INITD_DIR.
I think there is an existing autoconf name for CONFIG_DIR (sysconfdir?)
which I suppose we aren't properly using.
Not sure how INITD_DIR is dealt with in autofoo world, I suppose the
default is $sysconfdir/init.d? Does it ever get set to anything else?
Ian.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/13] Config.mk: replace dependency to genpath with actual target
2014-09-18 17:44 ` Ian Campbell
@ 2014-09-19 6:55 ` Olaf Hering
0 siblings, 0 replies; 31+ messages in thread
From: Olaf Hering @ 2014-09-19 6:55 UTC (permalink / raw)
To: Ian Campbell
Cc: Keir Fraser, Stefano Stabellini, Tim Deegan, Ian Jackson,
xen-devel, Jan Beulich, Samuel Thibault
On Thu, Sep 18, Ian Campbell wrote:
> On Thu, 2014-09-18 at 10:09 +0200, Olaf Hering wrote:
> > Unfortunately, m4/paths.m4 shows that configure will change just prefix
> > and libdir. Other parts of config/Paths.mk.in are kind of hardcoded.
> > I will see how to implement a knob for at least CONFIG_DIR and INITD_DIR.
> I think there is an existing autoconf name for CONFIG_DIR (sysconfdir?)
> which I suppose we aren't properly using.
Once I resend this series it will include also additional changes to set a few
important paths via configure.
Olaf
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2014-09-19 6:55 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-28 9:05 [PATCH 00/13 v2] tools changes to honor --prefix= Olaf Hering
2014-07-28 9:05 ` [PATCH 01/13] Config.mk: move directory list into BUILD_MAKE_VARS Olaf Hering
2014-07-28 9:05 ` [PATCH 02/13] Config.mk: replace dependency to genpath with actual target Olaf Hering
2014-08-26 20:00 ` Ian Campbell
2014-08-27 8:36 ` Olaf Hering
2014-08-28 17:34 ` Ian Campbell
2014-08-29 6:33 ` Olaf Hering
2014-09-03 10:28 ` Ian Campbell
2014-09-03 10:43 ` Olaf Hering
2014-09-17 10:02 ` Olaf Hering
2014-09-17 16:53 ` Ian Campbell
2014-09-18 8:09 ` Olaf Hering
2014-09-18 17:44 ` Ian Campbell
2014-09-19 6:55 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 03/13] Config.mk: add new macro buildmakevars2header Olaf Hering
2014-08-26 20:02 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 04/13] tools/libxl: use buildmakevars2header to create _paths.h Olaf Hering
2014-07-28 9:05 ` [PATCH 05/13] tools/libxc: provide variable paths to libxc Olaf Hering
2014-07-28 9:05 ` [PATCH 06/13] tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE Olaf Hering
2014-07-28 9:05 ` [PATCH 07/13] tools/pygrub: store kernels in /var/run/xen/pygrub Olaf Hering
2014-08-26 20:04 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 08/13] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
2014-08-26 20:07 ` Ian Campbell
2014-08-27 8:42 ` Olaf Hering
2014-07-28 9:05 ` [PATCH 09/13] tools/hotplug: create XEN_RUN_DIR at runtime Olaf Hering
2014-07-28 9:05 ` [PATCH 10/13] tools/hotplug: create XEN_LOCK_DIR " Olaf Hering
2014-07-28 9:05 ` [PATCH 11/13] tools/hotplug: use XEN_LOCK_DIR instead of hardcoded path Olaf Hering
2014-08-26 20:08 ` Ian Campbell
2014-07-28 9:05 ` [PATCH 12/13] tools/examples: remove obsolete install targets Olaf Hering
2014-07-28 9:05 ` [PATCH 13/13] remove obsolete SUBSYS_DIR variable Olaf Hering
2014-08-26 20:08 ` 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).