Tidy up installation paths
PATCH 1/1 Tidy up installation paths
The following patch changes the installation locations of most of the xen executables to fit Ian's Tidy up request. This means that anything that isn't directly used by a user gets installed into /usr/lib/xen/
I've done some regression testing and nothing appears to have broken. Be warned though that anyone who has scripts that depend on the location of things in tools (especially tools/misc) will have to update those scripts.
Regards,
Anthony Liguori
# HG changeset patch
# User [email protected]
# Node ID d381f3270b5d4bb3aced269056ae980258de0537 # Parent 28a10ec0fd6b6043f019beded0c99401315bfe93 Change installation paths for tools.
Move almost everything into /usr/lib/xen/bin and get rid of a couple programs that shouldn't really be installed.
tools/console/Makefile +2 -2
@@ -2,8 +2,8 @@ XEN_ROOT=../.. include $(XEN_ROOT)/tools/Rules.mk -DAEMON_INSTALL_DIR = /usr/sbin -CLIENT_INSTALL_DIR = /usr/libexec/xen +DAEMON_INSTALL_DIR = /usr/lib/xen/bin +CLIENT_INSTALL_DIR = /usr/lib/xen/bin INSTALL = install INSTALL_PROG = $(INSTALL) -m0755
tools/libxc/Makefile +1 -0
@@ -98,6 +98,7 @@ $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR) ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR) ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so + $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include .PHONY: TAGS clean rpm install all
tools/misc/Makefile +6 -6
@@ -13,10 +13,10 @@ HDRS = $(wildcard *.h) -TARGETS = xenperf xc_shadow +TARGETS = xc_shadow -INSTALL_BIN = $(TARGETS) xencons -INSTALL_SBIN = netfix xm xend xenperf +INSTALL_BIN = xencons +INSTALL_SBIN = xm xend all: build build: $(TARGETS)
@@ -28,9 +28,9 @@ $(MAKE) -C lomount install: build - [ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin - [ -d $(DESTDIR)/usr/sbin ] || $(INSTALL_DIR) $(DESTDIR)/usr/sbin - $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin + $(INSTALL_DIR) $(DESTDIR)/usr/lib/xen/bin + $(INSTALL_DIR) $(DESTDIR)/usr/sbin + $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/lib/xen/bin $(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin $(MAKE) -C cpuperf install $(MAKE) -C lomount install
tools/misc/cpuperf/Makefile +2 -2
@@ -23,7 +23,7 @@ SRCS = $(wildcard *.c) OBJS = $(patsubst %.c,%.o,$(SRCS)) -TARGETS = cpuperf-xen cpuperf-perfcntr +TARGETS = cpuperf-xen INSTALL_BIN = $(TARGETS)
@@ -43,7 +43,7 @@ $(CC) $(CFLAGS) -DPERFCNTR -o $@ $< install: all - $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin + $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/lib/xen/bin # End of $RCSfile: Makefile,v $
tools/misc/xend +2 -2
@@ -118,14 +118,14 @@ def start_xenstored(): XENSTORED_TRACE = os.getenv("XENSTORED_TRACE") - cmd = "/usr/sbin/xenstored --pid-file=/var/run/xenstore.pid" + cmd = "/usr/lib/xen/bin/xenstored --pid-file=/var/run/xenstore.pid" if XENSTORED_TRACE: cmd += " -T /var/log/xenstored-trace.log" s,o = commands.getstatusoutput(cmd) def start_consoled(): if os.fork() == 0: - os.execvp('/usr/sbin/xenconsoled', ['/usr/sbin/xenconsoled']) + os.execvp('/usr/lib/xen/bin/xenconsoled', ['/usr/lib/xen/bin/xenconsoled']) def main(): try:
tools/python/xen/xend/XendCheckpoint.py +2 -2
@@ -18,8 +18,8 @@ from XendLogging import log SIGNATURE = "LinuxGuestRecord" -PATH_XC_SAVE = "/usr/libexec/xen/xc_save" -PATH_XC_RESTORE = "/usr/libexec/xen/xc_restore" +PATH_XC_SAVE = "/usr/lib/xen/bin/xc_save" +PATH_XC_RESTORE = "/usr/lib/xen/bin/xc_restore" sizeof_int = calcsize("i") sizeof_unsigned_long = calcsize("L")
tools/python/xen/xm/create.py +2 -2
@@ -835,8 +835,8 @@ dom = make_domain(opts, config) if opts.vals.console_autoconnect: - cmd = "/usr/libexec/xen/xenconsole %d" % dom - os.execvp('/usr/libexec/xen/xenconsole', cmd.split()) + cmd = "/usr/lib/xen/bin/xenconsole %d" % dom + os.execvp('/usr/lib/xen/bin/xenconsole', cmd.split()) if __name__ == '__main__': main(sys.argv)
tools/python/xen/xm/main.py +3 -3
@@ -460,12 +460,12 @@ from xen.xend.XendClient import server info = server.xend_domain(dom) domid = int(sxp.child_value(info, 'id', '-1')) - cmd = "/usr/libexec/xen/xenconsole %d" % domid - os.execvp('/usr/libexec/xen/xenconsole', cmd.split()) + cmd = "/usr/lib/xen/bin/xenconsole %d" % domid + os.execvp('/usr/lib/xen/bin/xenconsole', cmd.split()) console = sxp.child(info, "console") def xm_top(args): - os.execv('/usr/sbin/xentop', ['/usr/sbin/xentop']) + os.execv('/usr/lib/xen/bin/xentop', ['/usr/lib/xen/bin/xentop']) def xm_dmesg(args):
tools/xcutils/Makefile +1 -1
@@ -15,7 +15,7 @@ XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Rules.mk -PROGRAMS_INSTALL_DIR = /usr/libexec/xen +PROGRAMS_INSTALL_DIR = /usr/lib/xen/bin INCLUDES += -I $(XEN_LIBXC)
tools/xenstat/xentop/Makefile +1 -1
@@ -24,7 +24,7 @@ prefix=/usr mandir=$(prefix)/share/man man1dir=$(mandir)/man1 -sbindir=$(prefix)/sbin +sbindir=$(prefix)/lib/xen/bin CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT) LDFLAGS += -L$(XEN_LIBXENSTAT)
tools/xenstore/Makefile +2 -2
@@ -124,9 +124,9 @@ $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored $(INSTALL_DIR) -p $(DESTDIR)/usr/bin - $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin + $(INSTALL_DIR) -p $(DESTDIR)/usr/lib/xen/bin $(INSTALL_DIR) -p $(DESTDIR)/usr/include - $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin + $(INSTALL_PROG) xenstored $(DESTDIR)/usr/lib/xen/bin $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR) $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
tools/xentrace/Makefile +4 -6
@@ -23,12 +23,10 @@ build: $(BIN) install: build - [ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin - [ -d $(DESTDIR)/usr/share/man/man1 ] || \ - $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man1 - [ -d $(DESTDIR)/usr/share/man/man8 ] || \ - $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man8 - $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin + $(INSTALL_DIR) $(DESTDIR)/usr/lib/xen/bin + $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man1 + $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man8 + $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/lib/xen/bin $(INSTALL_DATA) $(MAN1) $(DESTDIR)/usr/share/man/man1 $(INSTALL_DATA) $(MAN8) $(DESTDIR)/usr/share/man/man8
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 8 lines · Anthony Liguori
The following patch changes the installation locations of most of the xen executables to fit Ian's Tidy up request. This means that anything that isn't directly used by a user gets installed into
/usr/lib/xen/I've done some regression testing and nothing appears to have broken. Be warned though that anyone who has scripts that depend on the location of things in tools (especially
tools/misc) will have to update those scripts.
Why does this patch move xentop? Unlike several of the binaries being moved by this patch (helper binaries and daemons), xentop is intended to be directly executed by a user, and should be in a directory expected to be in $PATH. The relevant sections of the patch are:
Quoted 3 lines
diff -r
28a10ec0fd6b-rd381f3270b5dtools/python/xen/xm/main.pytools/python/xen/xm/main.py +0
-0
[...]
Quoted 8 lines
console =
sxp.child(info, "console")def
xm_top(args):tools/python/xen/xm/main.py +1
-1- os.execv('/usr/sbin/xentop', ['/usr/sbin/xentop']) + os.execv('/usr/lib/xen/bin/xentop', ['/usr/lib/xen/bin/xentop']) def xm_dmesg(args):
[...]
tools/xenstat/xentop/Makefile line 30
Quoted 12 lines
diff -r
28a10ec0fd6b-rd381f3270b5dtools/xenstat/xentop/Makefiletools/xenstat/xentop/Makefile +1
-1@@ -24,7 +24,7 @@ prefix=/usr mandir=$(prefix)/share/man man1dir=$(mandir)/man1 -sbindir=$(prefix)/sbin +sbindir=$(prefix)/lib/xen/bin CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT) LDFLAGS += -L$(XEN_LIBXENSTAT)
If it would help, I would be glad to provide a modified version of the patch which omits these sections.
Also, if xentop *were* to be moved, then there are two issues that would need to be resolved first:
1) Please don't just change the value of the "sbindir" variable in the makefile; those variables are intended to mirror the naming structure of autotools' destination directory variables, so the variable should be renamed to libexecdir. Despite the name, libexecdir is typically set to a package-specific directory under /usr/lib/ , on systems which don't use libexec directories (meaning pretty much anything other than GNU/Hurd).
2) The "xm top" interface needs to be changed to pass through command line arguments, while somehow avoiding the fact that "xm top --help" would refer to itself as "xentop". (I planned to do this anyway, but if you're going to move xentop, then this needs to be done first to avoid losing functionality.)
- Josh Triplett
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 4 lines · Josh Triplett
Why does this patch move xentop? Unlike several of the binaries being moved by this patch (helper binaries and daemons), xentop is intended to be directly executed by a user, and should be in a directory expected to be in $PATH. The relevant sections of the patch are:
The purpose of the cleanup is to avoid cluttering $PATH with things that are executable in another way. Since xentop is executable via xm top, this redundancy seemed unnecessary.
It's up to Ian or Christian. I can go either way.
Quoted 6 lines
1) Please don't just change the value of the "sbindir" variable in the makefile; those variables are intended to mirror the naming structure of autotools' destination directory variables, so the variable should be renamed to libexecdir. Despite the name, libexecdir is typically set to a package-specific directory under
/usr/lib/, on systems which don't use libexec directories (meaning pretty much anything other than GNU/Hurd).
We're not following the standard GNUisms. One thing that is really needed is more commonality between the tools build files. I'm sure a patch to cleanup all of the tools Makefiles would be appreciated.
Quoted 5 lines
2) The "xm top" interface needs to be changed to pass through command line arguments, while somehow avoiding the fact that "xm top --help" would refer to itself as "xentop". (I planned to do this anyway, but if you're going to move xentop, then this needs to be done first to avoid losing functionality.
The first round of the patch is strictly changing install paths. Smaller patches are easier to review. Feel free to submit additional patches to enhance the xm top interface though.
Regards,
Anthony Liguori
Quoted 1 line
- Josh Triplett