File tmp_build.patch of Package xen
Note: During the make process we can't have both xenstore and
domu-xenstore linking the sub command files from /usr/bin.
For example,
xen-tools: /usr/bin/xenstore-ls -> xenstore
xen-tools-domU: /usr/bin/xenstore-ls -> domu-xenstore
The last thing to create this link overwrites the previous link
and breaks the packaging. For this reason this patch puts domu-xenstore
with its links in /bin so as to not interfere with the regular xenstore
links.
---
tools/xenstore/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: xen-4.11.1-testing/tools/xenstore/Makefile
===================================================================
--- xen-4.11.1-testing.orig/tools/xenstore/Makefile
+++ xen-4.11.1-testing/tools/xenstore/Makefile
@@ -93,6 +93,7 @@ $(CLIENTS_DOMU): xenstore
xenstore: xenstore_client.o $(LIBXENSTORE)
$(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
+ $(CC) $< $(CFLAGS) $(LDFLAGS) -Wl,--build-id=sha1 -L. -lxenstore $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o domu-$@
xenstore-control: xenstore_control.o $(LIBXENSTORE)
$(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
@@ -172,10 +173,11 @@ endif
$(INSTALL_PROG) xenstore-control $(DESTDIR)$(bindir)
$(INSTALL_PROG) xenstore $(DESTDIR)$(bindir)
set -e ; for c in $(CLIENTS) ; do \
- ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \
+ ln -fs xenstore $(DESTDIR)$(bindir)/$${c} ; \
done
+ $(INSTALL_PROG) domu-xenstore $(DESTDIR)/bin
for client in $(CLIENTS_DOMU); do \
- $(INSTALL_PROG) $$client $(DESTDIR)$(bindir)/$${client/domu-}; \
+ ln -fs domu-xenstore $(DESTDIR)/bin/$${client/domu-} ; \
done
$(INSTALL_DIR) $(DESTDIR)$(libdir)
$(INSTALL_SHLIB) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)