[Pkg-xen-changes] r86 - in trunk: . xen-unstable xen-unstable/debian

Bastian Blank waldi at costa.debian.org
Tue Mar 7 11:23:16 UTC 2006


Author: waldi
Date: 2006-03-07 11:23:14 +0000 (Tue, 07 Mar 2006)
New Revision: 86

Added:
   trunk/xen-unstable/
   trunk/xen-unstable/debian/
   trunk/xen-unstable/debian/changelog
   trunk/xen-unstable/debian/compat
   trunk/xen-unstable/debian/control
   trunk/xen-unstable/debian/copyright
   trunk/xen-unstable/debian/diff
   trunk/xen-unstable/debian/libxen3.0-unstable-dev.install
   trunk/xen-unstable/debian/libxen3.0-unstable-python.install
   trunk/xen-unstable/debian/libxen3.0-unstable.install
   trunk/xen-unstable/debian/rules
   trunk/xen-unstable/debian/xen-utils-unstable.install
   trunk/xen-unstable/debian/xen-utils-unstable.xend.init
   trunk/xen-unstable/debian/xen-utils-unstable.xendomains.default
   trunk/xen-unstable/debian/xen-utils-unstable.xendomains.init
Log:
Import xen-unstable.


Added: trunk/xen-unstable/debian/changelog
===================================================================
--- trunk/xen-unstable/debian/changelog	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/changelog	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,5 @@
+xen-unstable (head.8954-1) UNRELEASED; urgency=low
+
+  * Initial release.
+
+ -- Bastian Blank <waldi at debian.org>  Thu, 23 Feb 2006 22:39:01 +0100

Added: trunk/xen-unstable/debian/compat
===================================================================
--- trunk/xen-unstable/debian/compat	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/compat	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1 @@
+4

Added: trunk/xen-unstable/debian/control
===================================================================
--- trunk/xen-unstable/debian/control	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/control	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,93 @@
+Source: xen-unstable
+Section: misc
+Priority: extra
+Maintainer: Debian Kernel Team <debian-kernel at lists.debian.org>
+Uploaders: Bastian Blank <waldi at debian.org>
+Build-Depends: debhelper (>= 4), libncurses5-dev, libz-dev, python-dev
+Build-Depends-Indep: gs-common, perl, tetex-extra
+Standards-Version: 3.6.2.2
+
+Package: xen-hypervisor-unstable-amd64
+Section: misc
+Architecture: amd64 i386
+Depends: ${shlibs:Depends}
+Provides: xen-hypervisor, xen-hypervisor-unstable, xen-hypervisor-amd64
+Description: The Xen Hypervisor (x86_64)
+ The hypervisor is the "core" for XEN itself. It gets booted by the boot loader
+ and controls cpu and memory, sharing them between your administrative domain
+ (Domain 0) and the virtual guest systems.
+ .
+ In order to boot a XEN system along with this package you also need a kernel
+ specifically crafted to work as the Domain 0, mediating hardware access for
+ XEN itself. An example config file for this kernel and documentation on how
+ to build it can be found in the xen-docs package.
+
+Package: xen-hypervisor-unstable-i386
+Section: misc
+Architecture: i386
+Depends: ${shlibs:Depends}
+Provides: xen-hypervisor, xen-hypervisor-unstable, xen-hypervisor-i386
+Description: The Xen Hypervisor
+ The hypervisor is the "core" for XEN itself. It gets booted by the boot loader
+ and controls cpu and memory, sharing them between your administrative domain
+ (Domain 0) and the virtual guest systems.
+ .
+ In order to boot a XEN system along with this package you also need a kernel
+ specifically crafted to work as the Domain 0, mediating hardware access for
+ XEN itself. An example config file for this kernel and documentation on how
+ to build it can be found in the xen-docs package.
+
+Package: xen-hypervisor-unstable-i386-pae
+Section: misc
+Architecture: i386
+Depends: ${shlibs:Depends}
+Provides: xen-hypervisor, xen-hypervisor-unstable, xen-hypervisor-i386-pae
+Description: The Xen Hypervisor (pae enabled version)
+ The hypervisor is the "core" for XEN itself. It gets booted by the boot loader
+ and controls cpu and memory, sharing them between your administrative domain
+ (Domain 0) and the virtual guest systems.
+ .
+ In order to boot a XEN system along with this package you also need a kernel
+ specifically crafted to work as the Domain 0, mediating hardware access for
+ XEN itself. An example config file for this kernel and documentation on how
+ to build it can be found in the xen-docs package.
+
+Package: xen-utils-unstable
+Section: misc
+Architecture: amd64 i386
+Depends: ${shlibs:Depends}, ${python:Depends}, xen-hypervisor-unstable, libxen3.0-unstable-python, iproute, udev
+Recommends: bridge-utils
+Provides: xen-utils
+Conflicts: xen-utils
+Description: XEN administrative tools
+ The userspace tools to manage a system virtualized through the XEN virtual
+ machine monitor.
+
+Package: libxen3.0-unstable
+Section: libs
+Architecture: amd64 i386
+Depends: ${shlibs:Depends}
+Conflicts: xen-docs (<= 1.2), libxen2.0, libxen3.0
+Description: control library for XEN, a Virtual Machine Monitor
+ Library to control the XEN microkernel.  Contains functions for creating,
+ starting, stopping, saving, virtual instances.
+
+Package: libxen3.0-unstable-dev
+Section: libdevel
+Architecture: amd64 i386
+Depends: libxen3.0-unstable (= ${Source-Version})
+Conflicts: libxen3.0-dev
+Description: development files for the control library for XEN
+ Users wishing to develop their own tools for interfaces to the underlying
+ XEN kernel should install this package.
+
+Package: libxen3.0-unstable-python
+Section: python
+Architecture: amd64 i386
+Depends: ${shlibs:Depends}, ${python:Depends}
+Conflicts: libxen3.0-python
+Description: python wrapper around libxc, the control library for XEN
+ This python library wraps the C library, and provides a nice OO interface
+ to the low-level system calls.  It also provides some higher-level config
+ file parsing.
+

Added: trunk/xen-unstable/debian/copyright
===================================================================
--- trunk/xen-unstable/debian/copyright	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/copyright	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,33 @@
+This package was downloaded from http://xenbits.xensource.com/.
+
+License:
+
+GNU General Public License
+--------------------------
+
+Most files in this repository are licensed under the terms of the GNU
+General Public License (GPL), a copy of which is attached at the end
+of this notice. Note that the only valid version of the GPL as far as
+the files in this repository are concerned is _this_ particular
+version of the license (i.e., *only* v2, not v2.2 or v3.x or
+whatever), unless explicitly otherwise stated.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+Licensing Exceptions (the relaxed BSD-style license)
+----------------------------------------------------
+
+For the convenience of users and those who are porting OSes to run as
+Xen guests, certain files in this repository are not subject to the
+GPL when distributed separately or included in software packages
+outside this repository. Instead we specify a much more relaxed
+BSD-style license. Affected files include the Xen interface headers
+(xen/include/public/COPYING), and various drivers, support functions
+and header files within the Linux sparse source trees. In all such
+cases, license terms are stated at the top of the file or in a COPYING
+file in the same directory. Note that _any_ file that is modified and
+then distributed within a Linux kernel is still subject to the GNU GPL.
+
+ -- Keir Fraser (on behalf of the Xen team)
+

Added: trunk/xen-unstable/debian/diff
===================================================================
--- trunk/xen-unstable/debian/diff	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/diff	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,124 @@
+--- xen-3.0/debian/rules	2006-02-24 17:31:09.000000000 +0100
++++ xen-unstable/debian/rules	2006-02-24 02:43:26.000000000 +0100
+@@ -7,39 +7,36 @@
+ DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ srcver   := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
+ VERSION  := $(shell echo $(srcver) | sed -e 's,-[^-]*$$,,')
+ MAJOR    := unstable
+ BUILD_DIR = debian/build
+ STAMPS_DIR = debian/stamps
+ 
+ setup: $(STAMPS_DIR)/setup
+-$(STAMPS_DIR)/setup: $(BUILD_DIR) $(STAMPS_DIR) setup-docs setup-hypervisor setup-tools
++$(STAMPS_DIR)/setup: $(BUILD_DIR) $(STAMPS_DIR) setup-hypervisor setup-tools-check
+ 	dh_testdir
+ 	touch $@
+ 
+ srcfiles := $(filter-out debian, $(wildcard * .[^.]*))
+-$(STAMPS_DIR)/setup-patch:
+-	@rm -rf $(BUILD_DIR)/source
+-	mkdir $(BUILD_DIR)/source
+-	cp -a $(srcfiles) $(BUILD_DIR)/source
+-	touch $@
+-
+-$(STAMPS_DIR)/setup-docs: $(STAMPS_DIR)/setup-patch
++$(STAMPS_DIR)/setup-docs:
+ 	@rm -rf $(BUILD_DIR)/build-docs
+-	cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-docs
++	mkdir $(BUILD_DIR)/build-docs
++	cp -a $(srcfiles) $(BUILD_DIR)/build-docs
+ 	touch $@
+ 
+-$(STAMPS_DIR)/setup-hypervisor-%: $(STAMPS_DIR)/setup-patch
++$(STAMPS_DIR)/setup-hypervisor-%:
+ 	@rm -rf $(BUILD_DIR)/build-hypervisor-$*
+-	cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-hypervisor-$*
++	mkdir $(BUILD_DIR)/build-hypervisor-$*
++	cp -a $(srcfiles) $(BUILD_DIR)/build-hypervisor-$*
+ 	touch $@
+ 
+-$(STAMPS_DIR)/setup-tools: $(STAMPS_DIR)/setup-patch
++$(STAMPS_DIR)/setup-tools:
+ 	@rm -rf $(BUILD_DIR)/build-tools
+-	cp -a $(BUILD_DIR)/source/ $(BUILD_DIR)/build-tools
++	mkdir $(BUILD_DIR)/build-tools
++	cp -a $(srcfiles) $(BUILD_DIR)/build-tools
+ 	touch $@
+ 
+ build: $(STAMPS_DIR)/build
+-$(STAMPS_DIR)/build: $(BUILD_DIR) $(STAMPS_DIR) $(STAMPS_DIR)/setup build-hypervisor build-tools
++$(STAMPS_DIR)/build: $(BUILD_DIR) $(STAMPS_DIR) $(STAMPS_DIR)/setup build-hypervisor build-tools-check
+ 	dh_testdir
+ 	touch $@
+ 
+@@ -47,6 +44,10 @@
+ 
+ $(STAMPS_DIR)/build-%: DIR=$(BUILD_DIR)/$(@F)
+ 
++$(STAMPS_DIR)/build-docs: $(STAMPS_DIR)/setup-docs
++	#$(MAKE) -C $(DIR)/tools
++	touch $@
++
+ $(STAMPS_DIR)/build-hypervisor-amd64: $(STAMPS_DIR)/setup-hypervisor-amd64
+ 	$(MAKE) -C $(DIR)/xen XEN_TARGET_ARCH=x86_64
+ 	touch $@
+@@ -63,7 +64,6 @@
+ 	$(MAKE) -C $(DIR)/tools
+ 	touch $@
+ 
+-setup-docs:: $(STAMPS_DIR)/setup-docs
+ ifneq (,$(filter amd64 i386, $(DEB_HOST_ARCH)))
+ build-hypervisor:: $(STAMPS_DIR)/build-hypervisor-amd64
+ install-hypervisor:: install-hypervisor-amd64
+@@ -76,9 +76,9 @@
+ install-hypervisor:: install-hypervisor-i386-pae
+ setup-hypervisor:: $(STAMPS_DIR)/setup-hypervisor-i386-pae
+ endif
+-build-tools:: $(STAMPS_DIR)/build-tools
++build-tools-check:: $(STAMPS_DIR)/build-tools
+ install-tools-check:: install-tools
+-setup-tools:: $(STAMPS_DIR)/setup-tools
++setup-tools-check:: $(STAMPS_DIR)/setup-tools
+ endif
+ 
+ $(BUILD_DIR) $(STAMPS_DIR):
+@@ -104,17 +104,14 @@
+ 	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
+ 	dh_clean
+ 
+-install-arch: install-hypervisor install-tools-check
++install-arch: build install-hypervisor install-tools-check
+ 	dh_testdir
+ 	dh_testroot
+ 	dh_installdirs
+ 
+-install-indep: install-docs
++install-indep:
+ 
+-install-docs:
+-	$(MAKE) -C debian/build/build-docs/docs
+-
+-install-hypervisor-%:
++install-hypervisor-%: $(STAMPS_DIR)/build-hypervisor-%
+ 	dh_testdir
+ 	dh_testroot
+ 	dh_clean -k -pxen-hypervisor-$(MAJOR)-$*
+@@ -133,17 +130,15 @@
+ 	dh_install --sourcedir=debian/tmp
+ 
+ # Build architecture-independent files here.
+ binary-indep:
+ 
+ # Build architecture-dependent files here.
+-binary-arch: install-arch
++binary-arch: build install-arch
+ 	dh_testdir
+ 	dh_testroot
+ 	dh_installchangelogs -s
+ 	dh_installdocs -s
+ 	dh_installexamples -s
+-	dh_installinit -p xen-utils-$(MAJOR) --name xend -- 21 20
+-	dh_installinit -p xen-utils-$(MAJOR) --name xendomains -- 20 21
+ 	dh_installman -s
+ 	dh_link -s
+ 	dh_strip -s

Added: trunk/xen-unstable/debian/libxen3.0-unstable-dev.install
===================================================================
--- trunk/xen-unstable/debian/libxen3.0-unstable-dev.install	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/libxen3.0-unstable-dev.install	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,4 @@
+usr/include
+usr/lib/*.a
+usr/lib/libxenctrl.so
+usr/lib/libxenguest.so

Added: trunk/xen-unstable/debian/libxen3.0-unstable-python.install
===================================================================
--- trunk/xen-unstable/debian/libxen3.0-unstable-python.install	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/libxen3.0-unstable-python.install	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1 @@
+usr/lib/python*

Added: trunk/xen-unstable/debian/libxen3.0-unstable.install
===================================================================
--- trunk/xen-unstable/debian/libxen3.0-unstable.install	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/libxen3.0-unstable.install	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,4 @@
+usr/lib/*.so.*
+usr/lib/libxenstore.so
+usr/lib/xen/bin
+usr/lib/xen/boot

Added: trunk/xen-unstable/debian/rules
===================================================================
--- trunk/xen-unstable/debian/rules	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/rules	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,161 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_HOST_ARCH  := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+srcver   := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
+VERSION  := $(shell echo $(srcver) | sed -e 's,-[^-]*$$,,')
+MAJOR    := unstable
+BUILD_DIR = debian/build
+STAMPS_DIR = debian/stamps
+
+srcfiles := $(filter-out debian, $(wildcard * .[^.]*))
+$(STAMPS_DIR)/source:
+	@rm -rf $(BUILD_DIR)/source
+	mkdir $(BUILD_DIR)/source
+	cp -a $(srcfiles) $(BUILD_DIR)/source
+	touch $@
+
+setup: $(STAMPS_DIR)/setup
+$(STAMPS_DIR)/setup: $(BUILD_DIR) $(STAMPS_DIR) setup-hypervisor setup-tools
+	dh_testdir
+	touch $@
+
+$(STAMPS_DIR)/setup-docs: $(STAMPS_DIR)/source
+	@rm -rf $(BUILD_DIR)/build-docs
+	cp -a $(BUILD_DIR)/source $(BUILD_DIR)/build-docs
+	touch $@
+
+$(STAMPS_DIR)/setup-hypervisor-%: $(STAMPS_DIR)/source
+	@rm -rf $(BUILD_DIR)/build-hypervisor-$*
+	cp -a $(BUILD_DIR)/source $(BUILD_DIR)/build-hypervisor-$*
+	touch $@
+
+$(STAMPS_DIR)/setup-tools: $(STAMPS_DIR)/source
+	@rm -rf $(BUILD_DIR)/build-tools
+	cp -a $(BUILD_DIR)/source $(BUILD_DIR)/build-tools
+	touch $@
+
+build: $(STAMPS_DIR)/build
+$(STAMPS_DIR)/build: $(BUILD_DIR) $(STAMPS_DIR) $(STAMPS_DIR)/setup build-hypervisor build-tools
+	dh_testdir
+	touch $@
+
+build-indep:
+
+$(STAMPS_DIR)/build-%: DIR=$(BUILD_DIR)/$(@F)
+
+$(STAMPS_DIR)/build-hypervisor-amd64: $(STAMPS_DIR)/setup-hypervisor-amd64
+	$(MAKE) -C $(DIR)/xen XEN_TARGET_ARCH=x86_64
+	touch $@
+
+$(STAMPS_DIR)/build-hypervisor-i386: $(STAMPS_DIR)/setup-hypervisor-i386
+	$(MAKE) -C $(DIR)/xen XEN_TARGET_ARCH=x86_32
+	touch $@
+
+$(STAMPS_DIR)/build-hypervisor-i386-pae: $(STAMPS_DIR)/setup-hypervisor-i386-pae
+	$(MAKE) -C $(DIR)/xen XEN_TARGET_ARCH=x86_32 XEN_TARGET_X86_PAE=y
+	touch $@
+
+$(STAMPS_DIR)/build-tools: $(STAMPS_DIR)/setup-tools
+	$(MAKE) -C $(DIR)/tools
+	touch $@
+
+setup-docs:: $(STAMPS_DIR)/setup-docs
+ifneq (,$(filter amd64 i386, $(DEB_HOST_ARCH)))
+build-hypervisor:: $(STAMPS_DIR)/build-hypervisor-amd64
+install-hypervisor:: install-hypervisor-amd64
+setup-hypervisor:: $(STAMPS_DIR)/setup-hypervisor-amd64
+ifneq (,$(filter i386, $(DEB_HOST_ARCH)))
+build-hypervisor:: $(STAMPS_DIR)/build-hypervisor-i386
+install-hypervisor:: install-hypervisor-i386
+setup-hypervisor:: $(STAMPS_DIR)/setup-hypervisor-i386
+build-hypervisor:: $(STAMPS_DIR)/build-hypervisor-i386-pae
+install-hypervisor:: install-hypervisor-i386-pae
+setup-hypervisor:: $(STAMPS_DIR)/setup-hypervisor-i386-pae
+endif
+build-tools:: $(STAMPS_DIR)/build-tools
+install-tools-check:: install-tools
+setup-tools:: $(STAMPS_DIR)/setup-tools
+endif
+
+$(BUILD_DIR) $(STAMPS_DIR):
+	@[ -d $@ ] || mkdir $@
+
+orig: ../orig/xen-$(MAJOR)-$(VERSION)
+	rsync --delete --exclude debian --exclude .svn --link-dest=../orig/xen-$(MAJOR)-$(VERSION)/ -av ../orig/xen-$(MAJOR)-$(VERSION)/ .
+
+../orig/xen-$(MAJOR)-$(VERSION):
+	if [ -f "../xen-$(MAJOR)_$(VERSION).orig.tar.gz" ]; then \
+	        mkdir -p ../orig; \
+	        tar -C ../orig -xzf ../xen-$(MAJOR)_$(VERSION).orig.tar.gz; \
+	else \
+	        echo "Can't find orig tarball." >&2; \
+	        exit 1; \
+	fi
+
+maintainerclean:
+	rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*))
+
+clean:
+	dh_testdir
+	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
+	dh_clean
+
+install-arch: install-hypervisor install-tools-check
+	dh_testdir
+	dh_testroot
+	dh_installdirs
+
+install-indep: install-docs
+
+install-docs:
+	$(MAKE) -C debian/build/build-docs/docs
+
+install-hypervisor-%:
+	dh_testdir
+	dh_testroot
+	dh_clean -k -pxen-hypervisor-$(MAJOR)-$*
+
+	mkdir debian/xen-hypervisor-$(MAJOR)-$*/boot -p
+	cp $(BUILD_DIR)/build-hypervisor-$*/xen/xen.gz debian/xen-hypervisor-$(MAJOR)-$*/boot/xen-$(MAJOR)-$*.gz
+	#cp $(BUILD_DIR)/build-hypervisor-$*/xen/xen-syms debian/xen-hypervisor-$(MAJOR)-$*/boot/xen-$(MAJOR)-$*.gz
+
+install-tools: export DH_OPTIONS = -plibxen3.0-unstable -plibxen3.0-unstable-dev -plibxen3.0-unstable-python -pxen-utils-unstable
+install-tools:
+	dh_testdir
+	dh_testroot
+	dh_clean
+
+	$(MAKE) -C $(BUILD_DIR)/build-tools/tools install XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=$(CURDIR)/debian/tmp LIBDIR=lib
+	dh_install --sourcedir=debian/tmp
+
+# Build architecture-independent files here.
+binary-indep:
+
+# Build architecture-dependent files here.
+binary-arch: build install-arch
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs -s
+	dh_installdocs -s
+	dh_installexamples -s
+	dh_installinit -p xen-utils-$(MAJOR) --name xend -- defaults 20 21
+	dh_installinit -p xen-utils-$(MAJOR) --name xendomains -- defaults 21 20
+	dh_installman -s
+	dh_link -s
+	dh_strip -s
+	dh_compress -s
+	dh_fixperms -s
+	dh_python -s
+	dh_makeshlibs -s
+	dh_installdeb -s
+	dh_shlibdeps -s -L libxen3.0-unstable
+	dh_gencontrol -s
+	dh_md5sums -s
+	dh_builddeb -s
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install


Property changes on: trunk/xen-unstable/debian/rules
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/xen-unstable/debian/xen-utils-unstable.install
===================================================================
--- trunk/xen-unstable/debian/xen-utils-unstable.install	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/xen-utils-unstable.install	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,6 @@
+etc/xen/auto
+etc/xen/scripts
+etc/xen/xend*
+usr/bin/xen*
+usr/sbin/xen*
+usr/sbin/xm

Added: trunk/xen-unstable/debian/xen-utils-unstable.xend.init
===================================================================
--- trunk/xen-unstable/debian/xen-utils-unstable.xend.init	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/xen-utils-unstable.xend.init	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,52 @@
+#! /bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/xend
+NAME=xend
+DESC=XEN
+
+test -x $DAEMON || exit 0
+test -e /proc/xen/privcmd || exit 0
+
+# Wait for Xend to be up
+await_daemons_up () {
+	i=1
+	rets=10
+	xend status
+	while [ $? -ne 0 -a $i -lt $rets ]; do
+		sleep 1
+		echo -n .
+		i=$(($i + 1))
+		xend status
+	done
+}
+
+
+set -e
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	xend start
+	await_daemons_up
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	xend stop
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	echo -n "Restarting $DESC: "
+	xend restart
+	await_daemons_up
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/xen-utils
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0

Added: trunk/xen-unstable/debian/xen-utils-unstable.xendomains.default
===================================================================
--- trunk/xen-unstable/debian/xen-utils-unstable.xendomains.default	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/xen-utils-unstable.xendomains.default	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,137 @@
+## Path: System/xen
+## Description: xen domain start/stop on boot
+## Type: string
+## Default: 
+#
+# The xendomains script can send SysRq requests to domains on shutdown.
+# If you don't want to MIGRATE, SAVE, or SHUTDOWN, this may be a possibility
+# to do a quick and dirty shutdown ("s e i u o") or at least sync the disks
+# of the domains ("s").
+#
+XENDOMAINS_SYSRQ=""
+
+## Type: integer 
+## Default: 100000
+#
+# If XENDOMAINS_SYSRQ is set, this variable determines how long to wait
+# (in microseconds) after each SysRq, so the domain has a chance to react.
+# If you want to a quick'n'dirty shutdown via SysRq, you may want to set
+# it to a relatively high value (1200000).
+#
+XENDOMAINS_USLEEP=100000
+
+## Type: integer
+## Default: 5000000
+#
+# When creating a guest domain, it is sensible to allow a little time for it
+# to get started before creating another domain or proceeding through the
+# boot process.  Without this, the booting guests will thrash the disk as they
+# start up.  This timeout (in microseconds) specifies the delay after guest
+# domain creation.
+#
+XENDOMAINS_CREATE_USLEEP=5000000
+
+## Type: string
+## Default: ""
+#
+# Set this to a non-empty string if you want to migrate virtual machines
+# on shutdown. The string will be passed to the xm migrate DOMID command
+# as is: It should contain the target IP address of the physical machine
+# to migrate to and optionally parameters like --live. Leave empty if
+# you don't want to try virtual machine relocation on shutdown.
+# If migration succeeds, neither SAVE nor SHUTDOWN will be executed for
+# that domain.
+#
+XENDOMAINS_MIGRATE=""
+
+## Type: string
+## Default: /var/lib/xen/save
+#
+# Directory to save running domains to when the system (dom0) is
+# shut down. Will also be used to restore domains from if # XENDOMAINS_RESTORE
+# is set (see below). Leave empty to disable domain saving on shutdown 
+# (e.g. because you rather shut domains down).
+# If domain saving does succeed, SHUTDOWN will not be executed.
+#
+XENDOMAINS_SAVE=/var/lib/xen/save
+
+## Type: string
+## Default: "--halt --wait"
+#
+# If neither MIGRATE nor SAVE were enabled or if they failed, you can
+# try to shut down a domain by sending it a shutdown request. To do this,
+# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting
+# for the domain to be really down. Leave empty to skip domain shutdown.
+#
+XENDOMAINS_SHUTDOWN="--halt --wait"
+
+## Type: string
+## Default: "--all --halt --wait"
+#
+# After we have gone over all virtual machines (resp. all automatically
+# started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq,
+# migrated, saved and/or shutdown according to the settings above, we
+# might want to shutdown the virtual machines that are still running
+# for some reason or another. To do this, set this variable to
+# "--all --halt --wait", it will be passed to xm shutdown.
+# Leave it empty not to do anything special here.
+# (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY
+# is set.)
+# 
+XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait"
+
+## Type: boolean
+## Default: true
+#
+# This variable determines whether saved domains from XENDOMAINS_SAVE
+# will be restored on system startup. 
+#
+XENDOMAINS_RESTORE=true
+
+## Type: string
+## Default: /etc/xen/auto
+#
+# This variable sets the directory where domains configurations
+# are stored that should be started on system startup automatically.
+# Leave empty if you don't want to start domains automatically
+# (or just don't place any xen domain config files in that dir).
+# Note that the script tries to be clever if both RESTORE and AUTO are 
+# set: It will first restore saved domains and then only start domains
+# in AUTO which are not running yet. 
+# Note that the name matching is somewhat fuzzy.
+#
+XENDOMAINS_AUTO=/etc/xen/auto
+
+## Type: boolean
+## Default: false
+# 
+# If this variable is set to "true", only the domains started via config 
+# files in XENDOMAINS_AUTO will be treated according to XENDOMAINS_SYSRQ,
+# XENDOMAINS_MIGRATE, XENDOMAINS_SAVE, XENDMAINS_SHUTDOWN; otherwise
+# all running domains will be. 
+# Note that the name matching is somewhat fuzzy.
+# 
+XENDOMAINS_AUTO_ONLY=false
+
+## Type: integer
+## Default: 300
+#
+# On xendomains stop, a number of xm commands (xm migrate, save, shutdown,
+# shutdown --all) may be executed. In the worst case, these commands may
+# stall forever, which will prevent a successful shutdown of the machine.
+# If this variable is non-zero, the script will set up a watchdog timer
+# for every of these xm commands and time it out after the number of seconds
+# specified by this variable.
+# Note that SHUTDOWN_ALL will not be called if no virtual machines or only
+# zombies are still running, so you don't need to enable this timeout just
+# for the zombie case.
+# The setting should be large enough to make sure that migrate/save/shutdown
+# can succeed. If you do live migrations, keep in mind that live migration
+# of a 1GB machine over Gigabit ethernet may actually take something like
+# 100s (assuming that live migration uses 10% of the network # bandwidth).
+# Depending on the virtual machine, a shutdown may also require a significant
+# amount of time. So better setup this variable to a huge number and hope the
+# watchdog never fires.
+#
+XENDOMAINS_STOP_MAXWAIT=300
+

Added: trunk/xen-unstable/debian/xen-utils-unstable.xendomains.init
===================================================================
--- trunk/xen-unstable/debian/xen-utils-unstable.xendomains.init	2006-03-07 11:22:40 UTC (rev 85)
+++ trunk/xen-unstable/debian/xen-utils-unstable.xendomains.init	2006-03-07 11:23:14 UTC (rev 86)
@@ -0,0 +1,473 @@
+#!/bin/bash
+#
+# /etc/init.d/xendomains
+# Start / stop domains automatically when domain 0 boots / shuts down.
+#
+# chkconfig: 345 99 00
+# description: Start / stop Xen domains.
+#
+# This script offers fairly basic functionality.  It should work on Redhat
+# but also on LSB-compliant SuSE releases and on Debian with the LSB package
+# installed.  (LSB is the Linux Standard Base)
+#
+# Based on the example in the "Designing High Quality Integrated Linux
+# Applications HOWTO" by Avi Alkalay
+# <http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/>
+#
+### BEGIN INIT INFO
+# Provides:          xendomains
+# Required-Start:    $syslog $remote_fs xend
+# Should-Start:
+# Required-Stop:     $syslog $remote_fs xend
+# Should-Stop:
+# Default-Start:     3 4 5
+# Default-Stop:      0 1 2 6
+# Default-Enabled:   yes
+# Short-Description: Start/stop secondary xen domains
+# Description:       Start / stop domains automatically when domain 0 
+#                    boots / shuts down.
+### END INIT INFO
+
+# Correct exit code would probably be 5, but it's enough 
+# if xend complains if we're not running as privileged domain
+if ! [ -e /proc/xen/privcmd ]; then
+	exit 0
+fi
+
+LOCKFILE=/var/lock/xendomains
+XENDOM_CONFIG=/etc/default/xendomains
+
+test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
+	if [ "$1" = "stop" ]; then exit 0;
+	else exit 6; fi; }
+
+. $XENDOM_CONFIG
+
+_cmd=$1
+declare -a _SMSG
+if test "${_cmd}" = "status"; then
+    _SMSG=(running dead dead unused unknown)
+    _RC_UNUSED=3
+else
+    _SMSG=(done failed failed missed failed skipped unused failed failed)
+    _RC_UNUSED=6
+fi
+. /lib/lsb/init-functions
+echo_rc()
+{
+    if test ${_RC_RV} = 0; then
+	log_success_msg "  [${_SMSG[${_RC_RV}]}] "
+    else
+	log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
+    fi
+}
+rc_reset() { _RC_RV=0; }
+rc_failed()
+{
+    if test -z "$1"; then 
+	_RC_RV=1;
+    elif test "$1" != "0"; then 
+	_RC_RV=$1; 
+    fi
+    return ${_RC_RV}
+}
+rc_check()
+{
+    return rc_failed $?
+}	
+rc_status()
+{
+    rc_failed $?
+    if test "$1" = "-r"; then _RC_RV=0; shift; fi
+    if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
+    if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
+    if test "$1" = "-v"; then echo_rc; shift; fi
+    if test "$1" = "-r"; then _RC_RV=0; shift; fi
+    return ${_RC_RV}
+}
+rc_exit() { exit ${_RC_RV}; }
+rc_active() 
+{
+    if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
+    if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
+    return 1
+}
+
+if ! which usleep >&/dev/null
+then
+  usleep()
+  {
+    if [ -n "$1" ]
+    then
+      sleep $(( $1 / 1000000 ))
+    fi
+  }
+fi
+
+# Reset status of this service
+rc_reset
+
+##
+# Returns 0 (success) if the given parameter names a directory, and that
+# directory is not empty.
+#
+contains_something()
+{
+  if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ]
+  then
+    return 0
+  else
+    return 1
+  fi
+}
+
+# read name from xen config file
+rdname()
+{
+    NM=$(xm create --quiet --dryrun --defconfig "$1" |
+         sed -n 's/^.*(name \(.*\))$/\1/p')
+}
+
+rdnames()
+{
+    NAMES=
+    if ! contains_something "$XENDOMAINS_AUTO"
+    then 
+	return
+    fi
+    for dom in $XENDOMAINS_AUTO/*; do
+	rdname $dom
+	if test -z $NAMES; then 
+	    NAMES=$NM; 
+	else
+	    NAMES="$NAMES|$NM"
+	fi
+    done
+}
+
+parseln()
+{
+    name=`echo "$1" | cut -c0-17`
+    name=${name%% *}
+    rest=`echo "$1" | cut -c18- `
+    read id mem cpu vcpu state tm < <(echo "$rest")
+}
+
+is_running()
+{
+    rdname $1
+    RC=1
+    while read LN; do
+	parseln "$LN"
+	if test $id = 0; then continue; fi
+	case $name in 
+	    ($NM)
+		RC=0
+		;;
+	esac
+    done < <(xm list | grep -v '^Name')
+    return $RC
+}
+
+start() 
+{
+    if [ -f $LOCKFILE ]; then 
+	echo -n "xendomains already running (lockfile exists)"
+	return; 
+    fi
+
+    if [ "$XENDOMAINS_RESTORE" = "true" ] &&
+       contains_something "$XENDOMAINS_SAVE"
+    then
+        mkdir -p $(dirname "$LOCKFILE")
+	touch $LOCKFILE
+	echo -n "Restoring Xen domains:"
+	for dom in $XENDOMAINS_SAVE/*; do
+	    echo -n " ${dom##*/}"
+	    xm restore $dom
+	    if [ $? -ne 0 ]; then
+		rc_failed $?
+		echo -n '!'
+	    else
+		# mv $dom ${dom%/*}/.${dom##*/}
+		rm $dom
+	    fi
+	done
+	echo .
+    fi
+
+    if contains_something "$XENDOMAINS_AUTO"
+    then
+	touch $LOCKFILE
+	echo -n "Starting auto Xen domains:"
+	# We expect config scripts for auto starting domains to be in
+	# XENDOMAINS_AUTO - they could just be symlinks to files elsewhere
+
+	# Create all domains with config files in XENDOMAINS_AUTO.
+	# TODO: We should record which domain name belongs 
+	# so we have the option to selectively shut down / migrate later
+	for dom in $XENDOMAINS_AUTO/*; do
+	    echo -n " ${dom##*/}"
+	    if is_running $dom; then
+		echo -n "(skip)"
+	    else
+		xm create --quiet --defconfig $dom
+		if [ $? -ne 0 ]; then
+		    rc_failed $?
+		    echo -n '!'
+		else
+		    usleep $XENDOMAINS_CREATE_USLEEP
+		fi
+	    fi
+	done
+    fi	
+}
+
+all_zombies()
+{
+    while read LN; do
+	parseln "$LN"
+	if test $id = 0; then continue; fi
+	if test "$state" != "-b---d" -a "$state" != "-----d"; then
+	    return 1;
+	fi
+    done < <(xm list | grep -v '^Name')
+    return 0
+}
+
+# Wait for max $XENDOMAINS_STOP_MAXWAIT for xm $1 to finish;
+# if it has not exited by that time kill it, so the init script will
+# succeed within a finite amount of time; if $2 is nonnull, it will
+# kill the command as well as soon as no domain (except for zombies)
+# are left (used for shutdown --all).
+watchdog_xm()
+{
+    if test -z "$XENDOMAINS_STOP_MAXWAIT" -o "$XENDOMAINS_STOP_MAXWAIT" = "0"; then
+	exit
+    fi
+    usleep 20000
+    for no in `seq 0 $XENDOMAINS_STOP_MAXWAIT`; do
+	# exit if xm save/migrate/shutdown is finished
+	PSAX=`ps axlw | grep "xm $1" | grep -v grep`
+	if test -z "$PSAX"; then exit; fi
+	echo -n "."; sleep 1
+	# go to kill immediately if there's only zombies left
+	if all_zombies && test -n "$2"; then break; fi
+    done
+    sleep 1
+    read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
+    # kill xm $1
+    kill $PSPID >/dev/null 2>&1
+}
+
+stop()
+{
+    # Collect list of domains to shut down
+    if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
+	rdnames
+    fi
+    echo -n "Shutting down Xen domains:"
+    while read LN; do
+	parseln "$LN"
+	if test $id = 0; then continue; fi
+	echo -n " $name"
+	if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
+	    case $name in
+		($NAMES)
+		    # nothing
+		    ;;
+		(*)
+		    echo -n "(skip)"
+		    continue
+		    ;;
+	    esac
+	fi
+	# XENDOMAINS_SYSRQ chould be something like just "s" 
+	# or "s e i u" or even "s e s i u o"
+	# for the latter, you should set XENDOMAINS_USLEEP to 1200000 or so
+	if test -n "$XENDOMAINS_SYSRQ"; then
+	    for sysrq in $XENDOMAINS_SYSRQ; do
+		echo -n "(SR-$sysrq)"
+		xm sysrq $id $sysrq
+		if test $? -ne 0; then
+		    rc_failed $?
+		    echo -n '!'
+		fi
+		# usleep just ignores empty arg
+		usleep $XENDOMAINS_USLEEP
+	    done
+	fi
+	if test "$state" = "-b---d" -o "$state" = "-----d"; then
+	    echo -n "(zomb)"
+	    continue
+	fi
+	if test -n "$XENDOMAINS_MIGRATE"; then
+	    echo -n "(migr)"
+	    watchdog_xm migrate &
+	    WDOG_PID=$!
+	    xm migrate $id $XENDOMAINS_MIGRATE
+	    if test $? -ne 0; then
+		rc_failed $?
+		echo -n '!'
+		kill $WDOG_PID >/dev/null 2>&1
+	    else
+		kill $WDOG_PID >/dev/null 2>&1
+		continue
+	    fi
+	fi
+	if test -n "$XENDOMAINS_SAVE"; then
+	    echo -n "(save)"
+	    watchdog_xm save &
+	    WDOG_PID=$!
+	    mkdir -p "$XENDOMAINS_SAVE"
+	    xm save $id $XENDOMAINS_SAVE/$name
+	    if test $? -ne 0; then
+		rc_failed $?
+		echo -n '!'
+		kill $WDOG_PIG >/dev/null 2>&1
+	    else
+		kill $WDOG_PIG >/dev/null 2>&1
+		continue
+	    fi
+	fi
+	if test -n "$XENDOMAINS_SHUTDOWN"; then
+	    # XENDOMAINS_SHUTDOWN should be "--halt --wait"
+	    echo -n "(shut)"
+	    watchdog_xm shutdown &
+	    WDOG_PID=$!
+	    xm shutdown $id $XENDOMAINS_SHUTDOWN
+	    if test $? -ne 0; then
+		rc_failed $?
+		echo -n '!'
+	    fi
+	    kill $WDOG_PIG >/dev/null 2>&1
+	fi
+    done < <(xm list | grep -v '^Name')
+
+    # NB. this shuts down ALL Xen domains (politely), not just the ones in
+    # AUTODIR/*
+    # This is because it's easier to do ;-) but arguably if this script is run
+    # on system shutdown then it's also the right thing to do.
+    if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then
+	# XENDOMAINS_SHUTDOWN_ALL should be "--all --halt --wait"
+	echo -n " SHUTDOWN_ALL "
+	watchdog_xm shutdown 1 &
+	WDOG_PID=$!
+	xm shutdown $XENDOMAINS_SHUTDOWN_ALL
+	if test $? -ne 0; then
+	    rc_failed $?
+	    echo -n '!'
+	fi
+	kill $WDOG_PID >/dev/null 2>&1
+    fi
+
+    # Unconditionally delete lock file
+    rm -f $LOCKFILE
+}
+
+check_domain_up()
+{
+    while read LN; do
+	parseln "$LN"
+	if test $id = 0; then continue; fi
+	case $name in 
+	    ($1)
+		return 0
+		;;
+	esac
+    done < <(xm list | grep -v "^Name")
+    return 1
+}
+
+check_all_auto_domains_up()
+{
+    if ! contains_something "$XENDOMAINS_AUTO"
+    then
+      return 0
+    fi
+    missing=
+    for nm in $XENDOMAINS_AUTO/*; do
+	rdname $nm
+	found=0
+	if check_domain_up "$NM"; then 
+	    echo -n " $name"
+	else 
+	    missing="$missing $NM"
+	fi
+    done
+    if test -n "$missing"; then
+	echo -n " MISS AUTO:$missing"
+	return 1
+    fi
+    return 0
+}
+
+check_all_saved_domains_up()
+{
+    if ! contains_something "$XENDOMAINS_SAVE" 
+    then
+      return 0
+    fi
+    missing=`/bin/ls $XENDOMAINS_SAVE`
+    echo -n " MISS SAVED: " $missing
+    return 1
+}
+
+# This does NOT necessarily restart all running domains: instead it
+# stops all running domains and then boots all the domains specified in
+# AUTODIR.  If other domains have been started manually then they will
+# not get restarted.
+# Commented out to avoid confusion!
+
+restart()
+{
+    stop
+    start
+}
+
+reload()
+{
+    restart
+}
+
+
+case "$1" in
+    start)
+	start
+	rc_status
+	if test -f $LOCKFILE; then rc_status -v; fi
+	;;
+
+    stop)
+	stop
+	rc_status -v
+	;;
+
+    restart)
+	restart
+	;;
+    force-reload|reload)
+	reload
+	;;
+
+    status)
+	echo -n "Checking for xendomains:" 
+	if test ! -f $LOCKFILE; then 
+	    rc_failed 3
+	else
+	    check_all_auto_domains_up
+	    rc_status
+	    check_all_saved_domains_up
+	    rc_status
+	fi
+	rc_status -v
+	;;
+
+    *)
+	echo "Usage: $0 {start|stop|restart|reload|status}"
+	rc_failed 3
+	rc_status -v
+	;;
+esac
+
+rc_exit




More information about the Pkg-xen-changes mailing list