Author: waldi Date: Wed Aug 23 10:45:08 2006 New Revision: 271 Added: trunk/xen-common/scripts/ trunk/xen-common/scripts/Makefile trunk/xen-common/scripts/xen-utils-wrapper Modified: trunk/xen-common/debian/rules trunk/xen-common/debian/xen-utils-common.install Log: * debian/rules - Don''t remove scripts dir. - Install scripts. * debian/xen-utils-common.install: Install scripts. * scripts: New directory. * scripts/Makefile, scripts/xen-utils-wrapper: Add. Modified: trunk/xen-common/debian/rules =============================================================================--- trunk/xen-common/debian/rules (original) +++ trunk/xen-common/debian/rules Wed Aug 23 10:45:08 2006 @@ -36,13 +36,14 @@ unpatch: clean maintainerclean: - rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*)) + rm -rf $(filter-out .svn debian scripts, $(wildcard * .[^.]*)) install: $(STAMPS_DIR)/source dh_testdir dh_testroot dh_clean -k $(MAKE) -C $(BUILD_DIR)/tools/examples install DESTDIR=$(CURDIR)/debian/tmp DISTDIR=$(CURDIR)/debian/tmp + $(MAKE) -C $(BUILD_DIR)/scripts install DESTDIR=$(CURDIR)/debian/tmp binary-indep: install dh_testdir Modified: trunk/xen-common/debian/xen-utils-common.install =============================================================================--- trunk/xen-common/debian/xen-utils-common.install (original) +++ trunk/xen-common/debian/xen-utils-common.install Wed Aug 23 10:45:08 2006 @@ -1,3 +1,5 @@ etc/udev/*.rules etc/xen/scripts etc/xen/xend* +usr/lib/xen-common +usr/sbin Added: trunk/xen-common/scripts/Makefile =============================================================================--- (empty file) +++ trunk/xen-common/scripts/Makefile Wed Aug 23 10:45:08 2006 @@ -0,0 +1,34 @@ +SCRIPTS = \ + cpuperf-perfcntr \ + cpuperf-xen \ + xend \ + xenperf \ + xenstore-chmod \ + xenstore-control \ + xenstore-exists \ + xenstore-list \ + xenstore-ls \ + xenstore-read \ + xenstore-rm \ + xenstore-write \ + xentop \ + xentrace \ + xentrace_format \ + xentrace_setmask \ + xentrace_setsize \ + xm + +WRAPPER = xen-utils-wrapper + +SCRIPTS_DIR = /usr/sbin +WRAPPER_DIR = /usr/lib/xen-common/bin + +install: + install -d $(DESTDIR)$(SCRIPTS_DIR) + install -d $(DESTDIR)$(WRAPPER_DIR) + @for i in $(SCRIPTS); do \ + echo ln -s $(WRAPPER_DIR)/$(WRAPPER) $(DESTDIR)$(SCRIPTS_DIR)/$$i; \ + ln -s $(WRAPPER_DIR)/$(WRAPPER) $(DESTDIR)$(SCRIPTS_DIR)/$$i || exit 1; \ + done + install $(WRAPPER) $(DESTDIR)$(WRAPPER_DIR) + Added: trunk/xen-common/scripts/xen-utils-wrapper =============================================================================--- (empty file) +++ trunk/xen-common/scripts/xen-utils-wrapper Wed Aug 23 10:45:08 2006 @@ -0,0 +1,16 @@ +#!/bin/bash + +version="$XEN_VERSION" +# TODO: real version detection +if [ -z "$version" ]; then + version="default" +fi + +root="/usr/lib/xen-$version" +if ! [ -d "$root" ]; then + echo "WARING! Can''t find $version of xen utils, fallback to default version!" >2 + root="/usr/lib/xen-default" +fi + +command="$(basename $0)" +exec "$root/bin/$command" "$@"