--- xen-tools-4.1.orig/debian/changelog
+++ xen-tools-4.1/debian/changelog
@@ -0,0 +1,544 @@
+xen-tools (4.1-1~bpo50+1) lenny-backports; urgency=low
+
+  * Rebuild for lenny-backports.
+
+ -- Jan Wagner <waja@cyconet.org>  Thu, 19 Feb 2009 03:02:11 +0100
+
+xen-tools (4.1-1) unstable; urgency=low
+
+  - New command line argument '--no-hosts' to avoid touching /etc/hosts
+    on dom0
+  - New command line argument '--pygrub' to setup a guest for pygrub use.
+  - Generated configuration file should work for --image-dev + --swap-dev
+    again.
+  - Always use /dev/pts for new images.
+
+ -- Steve Kemp <skx@debian.org>  Sun, 23 Nov 2008 13:06:01 +0000
+
+xen-tools (3.9-6) unstable; urgency=low
+
+  - Allow command line flags to be unset.
+    Thanks to Ruud Koolen for the patch.
+    (Closes: #484338)
+
+ -- Steve Kemp <skx@debian.org>  Tue, 14 Oct 2008 22:00:22 +0000
+
+xen-tools (3.9-5) unstable; urgency=medium
+
+  - Record the ARCH for RPM-based distros.
+    (Closes: #475125)
+  - Abort if the generated configuration file already exists.
+    (Closes: #499475)
+
+ -- Steve Kemp <skx@debian.org>  Mon, 13 Oct 2008 19:20:21 +0000
+
+xen-tools (3.9-4) unstable; urgency=high
+
+  * Changed two defaults in xen-tools.conf to conform
+    to the defaults used by the xen packages:
+      + serial_device: tty1 -> hvc0
+      + disk_device:   sda  -> xvda
+
+  * Priority High because of RC bug. (closes: #499282)
+
+ -- Radu Spineanu <radu@debian.org>  Tue, 30 Sep 2008 02:02:21 +0300
+
+xen-tools (3.9-3) unstable; urgency=medium
+
+  - Ensure that Fedora guests get /dev/pts mounted.
+    Thanks to  Giovanni Biscuolo (Closes: #474919)
+  - Add the new hostnames to /etc/hosts on the dom0 in the correct order.
+    Thanks to Wolfgang Karall (Closes: #477775)
+  - Ensure that packages are remoed non-interactively for scripted stuff.
+    Thanks to Wolfgang Karall (Closes: #477629)
+  - Correctly handle custom partitioning systems.
+    Thanks to Stéphane AICARDI (Closes: #477334)
+
+ -- Steve Kemp <skx@debian.org>  Wed, 20 Feb 2007 21:22:23 +0000
+
+xen-tools (3.9-2) unstable; urgency=high
+
+  - Ensure that the hook scripts which setup networking details for
+    Debian & Ubuntu guests will correctly setup teh broadcast address.
+
+ -- Steve Kemp <skx@debian.org>  Wed, 20 Feb 2007 21:22:23 +0000
+
+xen-tools (3.9-1) unstable; urgency=low
+
+  - general:
+    - Removed recommendation on perl-doc.  (Closes: #447715)
+    - Support fedora Core 8 (Closes: 450626)
+  - hooks:
+    - Update /etc/securetty upon new images to ensure that xvc0 + hvc0
+      are permitted.  (Closes: #442926)
+  - xen-delete-image:
+    - Show what has been deleted by default. (Closes: #452756)
+  - xen-create-image:
+    - Return exit status of 127 on any error.
+      (Closes: #455916)
+  - Debian:
+    - Moved homepage into control file, not description.
+    - Updated standards version to 3.7.3 (no changes).
+
+ -- Steve Kemp <skx@debian.org>  Fri, 1 Feb 2007 19:22:01 +0000
+
+xen-tools (3.8-1) unstable; urgency=low
+
+  [ Steve Kemp ]
+  * Allow the debootstrap command to be changed to cdebootstrap
+    via 'debootstrap-cmd = /usr/sbin/cdebootstrap'.
+    (Closes: #436480)
+  * Fix typo on pointopoint links.
+    (Closes: #436170)
+  * Avoid breaking command line completion when using aliased 'ls'.
+    (Closes: #439874)
+  * Correctly determine whether a Xen guest is running prior to deletion.
+    (Closes: #440664)
+  * Allow the user to specify which serial device should be used for
+    use by the 'xm console', via serial_device=/dev/xvc0 in xen-tools.conf
+    (Closes: #423389)
+  * Allow the user to specify which disk device should be used, via
+    disk_device=/dev/xvd[a-z] in xen-tools.conf
+    (Closes: #439233)
+  * Use 'apt-get remove' rather than 'dpkg --purge' when removing packages
+    in hooks.  (Closes: #441981)
+
+  [ Radu Spineanu ]
+  * debian/control: Roland Stigge and I switched maintainer places.
+  * debian/control: Added Steve Kemp to Uploaders.
+
+ -- Radu Spineanu <radu@debian.org>  Wed, 03 Oct 2007 00:39:58 +0300
+
+xen-tools (3.7-1) unstable; urgency=low
+
+  * Added dependency upon 'rinse'
+    - Support the installation of Fedora Core 4-7 & Centos 4 + 5.
+  * Better POD files
+  * Updated the example script 'setup-kernel-initrd' to work better.
+  * Mount /proc prior to running post-install scripts.
+  * Better handling for Ubuntu language packs.
+  * Generate MAC addresses for all new guests by default.
+
+ -- Steve Kemp <steve@steve.org.uk>  Tue, 10 Jul 2007 20:35:34 +0000
+
+xen-tools (3.6-1) unstable; urgency=low
+
+  * Added custom partitioning support.
+     - Added dependency upon libconfig-inifiles-perl.
+  * Better device creation in the creation of guests.
+  * Sanity checking of the network configuration of Xend.
+
+ -- Steve Kemp <steve@steve.org.uk>  Tue, 10 Jul 2007 20:35:34 +0000
+
+xen-tools (3.5-1) unstable; urgency=low
+
+  * Only add Debian sources for security.debian.org if enabled upon the host.
+  * Allow per-dist mirrors.  Which is useful when working with mixed
+    Debian + Ubuntu installations.
+  * Added support for Ubuntu Feisty + Gutsy
+  * Use "policy-rc.d" to prevent daemons from starting inside our
+    chroot().
+  * xen-update-image will now skip Xen guests which are running.
+
+ -- Steve Kemp <steve@steve.org.uk>  Sun, 16 Jun 2007 14:43:00 +0000
+
+xen-tools (3.4-1) unstable; urgency=low
+
+  [ Steve Kemp ]
+  * New upstream release v3.4
+    - Allows the expansion of backticks in configuration file(s).
+    - Generate locales for the new Xen guests to match the host machine.
+      (Closes: #423385)
+
+  [ Radu Spineanu ]
+    - Better kernel/initrd guessing in the configuration file(using uname -r).
+      Also added a note about this in README.Debian. (closes: #425019)
+
+ -- Radu Spineanu <radu@debian.org>  Tue, 29 May 2007 01:09:40 +0300
+
+xen-tools (3.3-1) unstable; urgency=low
+
+  [ Steve Kemp ]
+  * New upstream release v3.3
+    - Refuse to delete running guests.  (Closes: #419561)
+    - Updated the package "Recommends" (Closes: #421174)
+
+ -- Radu Spineanu <radu@debian.org>  Fri, 12 May 2007 19:09:09 +0200
+
+xen-tools (3.2-1) unstable; urgency=low
+
+  [ Steve Kemp ]
+  * New upstream release v3.2
+    - Installation argument changes so that --copy, --debootstrap, --rpmstrap,
+      and --tar have been replaced with --install-method.
+      Indirectly (closes: #404454, #411817)
+    - Updated bash completion scripts.
+    - New installation method, using an image-server.
+  * Added sample script in examples/ to update the xen-tools.conf
+    file, and all domains with the most current Xen kernel and initrd
+    image.  (closes: #401206)
+  * Setup correct security sources for apt-get.
+    (Closes: #407543)
+  * Automatically cleanup if installation fails.
+    (Closes: #383029)
+  * Auto-incrementing network addresses for new installations.
+  * Added 'xen-create-nfs' to create new NFS-Root Xen guests.
+  * Added the ability to install into a physical partition.
+    (Closes: #406212)
+
+ -- Radu Spineanu <radu@debian.org>  Sun, 25 Mar 2007 21:35:06 +0300
+
+xen-tools (3.1-1) unstable; urgency=low
+
+  [ Steve Kemp ]
+  * New upstream release v3.1.
+    - Installation of packages in hooks works. (Closes: #402889, #404518)
+    - Xen configuration files are not accidently trashed.  (Closes: #404443)
+    - Hooks are now optional.  (Closes: #404444)
+    - Better error handling of image creation. (Closes: #404455, #404516)
+    - Avoid copying needless kernel modules to guests.  (Closes: #404508)
+    - Fixed typo in error handling. (Closes: #404509)
+    - When copying user accounts copy groups too. (Closes: #404521)
+
+ -- Radu Spineanu <radu@debian.org>  Sun, 25 Mar 2007 21:35:04 +0300
+
+xen-tools (3.0-1) unstable; urgency=low
+
+  [ Steve Kemp ]
+  * New upstream release of 3.0
+    - Tests that config files exists.  (Closes: #402328)
+    - New option to create image but not install.  (Closes: #383057, #402315)
+    - Made "etch" the default target to install.  (Closes: #399705)
+
+ -- Radu Spineanu <radu@debian.org>  Wed,  13 Dec 2006 11:17:28 +0000
+
+xen-tools (3.0~beta1-2) unstable; urgency=low
+
+  * Remove old symlinks and directories during preinst. (closes: #401834)
+
+ -- Radu Spineanu <radu@debian.org>  Wed,  6 Dec 2006 15:58:44 +0200
+
+xen-tools (3.0~beta1-1) unstable; urgency=low
+
+  * Development snapshot
+  * Mention the --mac option in the man page.
+    (closes: #399708)
+  * Set the locale version to 'C' to avoid perl warnings.
+    (closes: #399778)
+
+ -- Radu Spineanu <radu@debian.org>  Mon,  4 Dec 2006 16:55:31 +0200
+
+xen-tools (2.8-2) unstable; urgency=low
+
+  * Support Upstart in hook 30-fix-inittab (Closes: #399153)
+  * hooks/common.sh: Applied Petter Reinholdtsen's
+       assert "$LINENO" ""
+    changes, the rest was already fixed in 2.8-1 (Closes: #399286)
+  * Only copy modules if newer in 80-install-modules (Closes: #399196)
+  * Fix installation of libc6-xen from right source (Closes: #397784)
+  * Activate hook disable-tls only if 32 bit architecture (Closes: #397933)
+  * Add hook disable-tls for Ubuntu (Closes: #399274)
+  * bin/xen-create-image: Fixed documentation: --untar => --tar
+    (Closes: #398769)
+  * debian/rules: Moved the cfengine hook to roles (Closes: #399152)
+
+ -- Roland Stigge <stigge@antcom.de>  Sun, 19 Nov 2006 13:48:46 +0100
+
+xen-tools (2.8-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Radu Spineanu <radu@debian.org>  Wed,  8 Nov 2006 00:35:40 +0200
+
+xen-tools (2.7-4) unstable; urgency=low
+
+  * debian/control: Priority: extra (because of debootstrap and
+    libtext-template-perl)
+
+ -- Roland Stigge <stigge@antcom.de>  Sat, 21 Oct 2006 17:21:05 +0200
+
+xen-tools (2.7-3) unstable; urgency=low
+
+  * debian/control:
+    - Priority: optional (following override, was: extra)
+    - Recommends: perl-doc (Closes: #393472)
+    - Recommends: xen-hypervisor
+
+ -- Roland Stigge <stigge@antcom.de>  Sat, 21 Oct 2006 14:58:28 +0200
+
+xen-tools (2.7-2) unstable; urgency=low
+
+  * Fixed 2.6-2 changelog entry.
+
+ -- Radu Spineanu <radu@debian.org>  Sat, 14 Oct 2006 02:21:25 +0300
+
+xen-tools (2.7-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Radu Spineanu <radu@debian.org>  Sat, 14 Oct 2006 02:16:20 +0300
+
+xen-tools (2.6-2) unstable; urgency=low
+
+  * New maintainer (Closes: #390904)
+  * Fixed sysvinit's /lib/init/rw being mounted on debootstrap, leading to the
+    deletion of the image content on creation (Closes: #391501)
+
+ -- Roland Stigge <stigge@antcom.de>  Sat,  7 Oct 2006 12:58:30 +0200
+
+xen-tools (2.6-1) unstable; urgency=low
+
+  * Allow the user to modify the commands used when installing with
+    --copy or --tar.
+  * Add --numeric-owner to the command used by --tar by default.
+    (Closes: #385024)
+
+ -- Steve Kemp <skx@debian.org>  Mon, 11 Sep 2006 17:00:21 +0000
+
+xen-tools (2.5-2) unstable; urgency=low
+
+  * Don't complation about /etc/xen-tools/role.d/ any more.
+
+ -- Steve Kemp <skx@debian.org>  Sun, 27 Aug 2006 22:39:45 +0000
+
+xen-tools (2.5-1) unstable; urgency=low
+
+  * Install roles system-wide into /etc/xen-tools/role.d/
+    This is certainly the last time this will move, since this is
+    the second time.  New command line argument '--roledir' allows
+    you to specify an alternative location.  (Also valid in the config file.)
+    (Closes: #383822)
+  * Correctly setup "${noswap}" for the hook scripts.
+
+ -- Steve Kemp <skx@debian.org>  Sun, 27 Aug 2006 22:33:20 +0000
+
+xen-tools (2.4-1) unstable; urgency=low
+
+  * New upstream release.
+    - Don't setup ramdisk in xm.tmpl if one isn't being used.
+      (Closes: #383703)
+    - xen-delete-image will not complain if a swap volume doesn't exist.
+      It will also remove the new installation logfile.
+      (Closes: #383736)
+    - Improved documentation on custom variables in the Xen configuration
+      file in the manpage for xt-create-xen-config
+    - Allow the MAC address to be set for the first network interface,
+      regardless of DHCP/static addressing.
+      (Closes: #383492)
+  * Added watch file.
+
+ -- Steve Kemp <skx@debian.org>  Tue, 22 Aug 2006 10:00:00 +0000
+
+xen-tools (2.3-1) unstable; urgency=high
+
+  * Urgency set to high because the software will not work correctly unless
+    using a specific version of debootstrap.
+    - Updated manpages to avoid word-wrapping.
+    - Updated --noswap option such that a LVM swap volume isn't created.
+    - Reverted the usage of '--keep-debootstrap-dir' since that is a
+      "recent" thing.  Will switch to keeping a global logfile for error
+      purposes.
+      (Closes: #383589)
+    - File given as '--template' argument must exist.
+    - Leave /etc/inittab terminal type alone.
+    - When running with --noswap the Xen configuration file is correct.
+    - --fs command line processing is now correct.
+  * Switched myself to maintainer, and Radu to be uploader after discussion.
+
+ -- Steve Kemp <skx@debian.org>  Fri, 18 Aug 2006 09:54:32 +0000
+
+xen-tools (2.3-0) unstable; urgency=low
+
+  * New upstream release:
+    - Better manpage for xen-create-image which longer displays internal functions. (Closes: #383032)
+    - Use a user-specified Xen configuration file template via "--template=xx"
+      (Closes: #383036)
+    - Allow new images to be created without swap via "--noswap".
+      (Closes: #383058)
+    - Preserve debootstrap error output in xt-install-image.
+      (Closes: #383037)
+    - Mount /proc more securely in new guests: nodev, noexec, nosuid.
+    - Allow command line installation method or installation type (dir/lvm)
+      to override the configuration file options.
+      (Closes: #383033)
+    - Allow "arch" to be specified and passed to rpmstrap/debootstrap.
+      (Closes: #383041)
+
+ -- Steve Kemp <skx@debian.org>  Mon, 14 Aug 2006 22:34:59 +0000
+
+xen-tools (2.2-2) unstable; urgency=low
+
+  * Applied upstream patches to ensure a suitable image-creation method
+    is specified to xen-create-image and improved the documentation for
+    that script.  (Closes: #379347)
+
+ -- Steve Kemp <skx@debian.org>  Sun, 23 Jul 2006 21:22:24 +0000
+
+xen-tools (2.2-1) unstable; urgency=high
+
+  * New upstream release, fixes several important bugs hence urgency=high.
+    - /etc/fstab creation generated correctly for reiserfs
+      (Closes: #379023) (Closes: #379096)
+    - --force works with xfs filesystems.
+      (Closes: #377684)
+    - Timezone configuration file copied over into new guest domains.
+      (Closes: #376846)
+    - Debian image creation works correctly.
+      (Closes: #378165)
+
+ -- Steve Kemp <skx@debian.org>  Sat, 22 Jul 2006 16:59:39 +0000
+
+xen-tools (2.1-2) unstable; urgency=high
+
+  * CVS snapshot to fix RC bugs and allow package into testing.
+    - Build from source with no test-case failures.
+      (Closes: #375267)
+    - Fixed several typos in the configuration file, and scripts.
+      (Closes: #375382)
+
+ -- Steve Kemp <skx@debian.org>  Thur, 29 Jun 2006 10:31:23 +0000
+
+xen-tools (2.1-1) unstable; urgency=high
+
+  * New upstream release:
+    - The --boot option works again.
+    - Accept the --mirror command line option.
+    - Accept the --fs command line option (Closes: #374987)
+    - Create swap for new images (Closes: #374989)
+    - Always create non-sparse images on LVM systems (Closes: #374988)
+    - Gentoo image customisation supported.
+  * Urgency set to high primarily because of the failure to create
+    swap devices.
+
+ -- Steve Kemp <skx@debian.org>  Thur, 23 Jun 2006 10:08:32 +0000
+
+xen-tools (2.0-1) unstable; urgency=low
+
+  * New upstream release
+     + Moves the hook directories from /etc/xen-tools to /usr/lib/xen-tools
+     + Adds explicit support for Ubuntu Dapper.
+     + Changed homepage links.
+  * Updated build-deps to include modules required for clean pass of test
+    suite.
+  * Added dependency for Text::Template, and removed obsolete Term::Size.
+  * Improved documentation relating to the LVM support.
+    Note: --volume becomes --lvm from 2.0 upwards.
+    (Closes: #368831)
+  * Installation on LVM partitions now works without error.
+    (Closes: #373800)
+
+ -- Steve Kemp <skx@debian.org>  Tue, 20 Jun 2006 09:57:45 +0000
+
+xen-tools (1.6-1) unstable; urgency=low
+
+  * New upstream release (closes: #368983)
+     + Install libc6-xen on sid/etch systems
+     + Don't update /etc/hosts on the host if there is already an
+       entry present for that given host.
+  * Added xen | xen-hypervisor-3.0 to depends again (closes: #370278)
+  * Updated Standards version
+  * Added missing 1.4-2 changelog entry
+
+ -- Radu Spineanu <radu@debian.org>  Sat, 10 Jun 2006 18:57:50 +0300
+
+xen-tools (1.5-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Radu Spineanu <radu@debian.org>  Tue, 30 May 2006 00:07:30 +0300
+
+xen-tools (1.4-2) unstable; urgency=medium
+
+  * Snapshot of CVS to close bugs.
+  * Consistently use SCSI / IDE style device names.
+    (Closes: #366252)
+  * Don't overwrite new images with xen-create-image, unless '--force'
+    is applied.  (Closes: #366403)
+  * Rather than recommending Xen (which is Xen 2.0) recommend either
+    xen or xen-hypervisor-3.0.  (Closes: #366459).
+  * Updated standards version to 3.7.2.  (No changes).
+  * Set the priority to "optional" not "extra".  Must remember to keep
+    this there this time..
+
+ -- Steve Kemp <skx@debian.org>  Mon, 22 May 2006 12:04:21 +0000
+
+xen-tools (1.4-1) unstable; urgency=low
+
+  *  Delete the /etc/xen-tools/xen-create-image.d directory if it's empty
+     or display a warning otherwise
+  *  Closed wrong bug number in the 1.3-1 upload
+  *  Allow files to be copied to all new instances via /etc/xen-tools/skel
+     (Closes: #363070)
+  *  Added new option --initrd to specify the initial ramdisk.
+     (Closes: #365500)
+
+ -- Steve Kemp <skx@debian.org>  Sun, 7 May 2006 14:43:43 +0000
+
+xen-tools (1.3-1) unstable; urgency=low
+
+  * New upstream release
+     + Ignore .dpkg-(new|old) files in the hooks directory
+       (closes: #357716)
+
+ -- Radu Spineanu <radu@debian.org>  Sat, 15 Apr 2006 13:44:36 +0300
+
+xen-tools (1.1-1) unstable; urgency=low
+
+  * New upstream release
+     + Disk devices are no longer created one unit bigger than asked
+       (closes: #353155)
+     + Populate /dev on the virtual server (closes: #352942)
+     + Added --use-ide flag in case people want ide style device names
+       (closes: #352937)
+     + xen.cfg is no longer broken when using LVM
+
+ -- Radu Spineanu <radu@debian.org>  Tue, 21 Feb 2006 01:28:28 +0200
+
+xen-tools (1.0-1) unstable; urgency=low
+
+  * New upstream release
+  * Changed priority from optional to extra because of debootstrap
+
+ -- Radu Spineanu <radu@debian.org>  Thu,  9 Feb 2006 00:25:41 +0200
+
+xen-tools (0.9-2) unstable; urgency=high
+
+  * BUGFIX:  Add "vif = ['']" to each configuration file created in
+    /etc/xen.  Without this networking of guest domains may fail in
+    Xen 3.0.1
+
+ -- Steve Kemp <skx@debian.org>  Sat,  4 Feb 2006 20:20:01 +0000
+
+xen-tools (0.9-1) unstable; urgency=low
+
+  * New upstream release.
+    Allows disabling of the .deb caching via "--cache=no" (Closes: #348721)
+
+ -- Steve Kemp <skx@debian.org>  Wed,  25 Jan 2006 09:19:21 +0000
+
+xen-tools (0.8.5-1) unstable; urgency=low
+
+  * New upstream release (closes: #345912)
+    (generated /etc/fstab broken)
+  * Fixes typo in description (closes: #346296)
+
+ -- Radu Spineanu <radu@debian.org>  Sun,  8 Jan 2006 21:57:17 +0200
+
+xen-tools (0.6-1) unstable; urgency=low
+
+  * New upstream release, featuring a collection of "hooks" to
+    do most of the processing.
+  * Build manpages at package creation time.
+  * Run the (minimal) test suite at package creation time.
+  * Added link to homepage in debian/control
+  * Added dependency upon libterm-size-perl so that the messages
+    may stretch the width of the console.
+
+ -- Steve Kemp <skx@debian.org>  Sun, 25 Dec 2005 15:01:38 +0000
+
+xen-tools (0.4-1) unstable; urgency=low
+
+  * Initial release (Closes: #344081)
+
+ -- Radu Spineanu <radu@debian.org>  Tue, 20 Dec 2005 02:21:05 +0200
+
--- xen-tools-4.1.orig/debian/dirs
+++ xen-tools-4.1/debian/dirs
@@ -0,0 +1,4 @@
+/etc/xen-tools
+/etc/xen-tools/role.d
+/etc/xen-tools/skel
+/usr/lib/xen-tools
\ No newline at end of file
--- xen-tools-4.1.orig/debian/control
+++ xen-tools-4.1/debian/control
@@ -0,0 +1,18 @@
+Source: xen-tools
+Section: utils
+Priority: extra
+Maintainer: Roland Stigge <stigge@antcom.de>
+Uploaders: Radu Spineanu <radu@debian.org>, Steve Kemp <skx@debian.org>, Jan Wagner <waja@cyconet.org>
+Build-Depends: debhelper (>= 4.0.0), libtest-pod-perl, libtext-template-perl
+Standards-Version: 3.8.0
+Homepage: http://xen-tools.org/software/xen-tools
+
+Package: xen-tools
+Architecture: all
+Depends: debootstrap, perl-modules, libtext-template-perl, libconfig-inifiles-perl
+Recommends: xen-hypervisor-amd64 | xen-hypervisor-i386 | xen-hypervisor-i386-pae, reiserfsprogs, xfsprogs, rinse, xen-shell, libexpect-perl
+Description: Tools to manage Debian XEN virtual servers
+ This package contains tools to manage Debian based XEN virtual servers.
+ .
+ Using the scripts you can easily create fully configured Xen guest
+ domains (domU) which can be listed, updated, or copied easily.
--- xen-tools-4.1.orig/debian/compat
+++ xen-tools-4.1/debian/compat
@@ -0,0 +1 @@
+4
--- xen-tools-4.1.orig/debian/watch
+++ xen-tools-4.1/debian/watch
@@ -0,0 +1,15 @@
+#
+#  Watchfile for xen-tools.
+#
+#
+#  uscan version number - not the version of the software.
+#
+version=3
+
+
+#
+#  The link to the download location, followed by the regular expression
+# to match release tarballs.
+#
+http://xen-tools.org/software/xen-tools/releases.html \
+   xen-tools-([\d\.]+)\.tar\.gz
--- xen-tools-4.1.orig/debian/copyright
+++ xen-tools-4.1/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Radu Spineanu <radu@debian.org> on
+Tue, 20 Dec 2005 02:21:05 +0200.
+
+It was downloaded from http://xen-tools.org/software/xen-tools/
+
+Copyright Holder: Steve Kemp <steve@steve.org.uk>
+
+License:
+
+This program is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+Perl is distributed under licenses:
+
+    a) the GNU General Public License as published by the Free Software
+       Foundation; either version 1, or (at your option) any later
+       version, or
+
+    b) the "Artistic License" which comes with Perl.
+
+    On Debian GNU/Linux systems, the complete text of the GNU General
+    Public License can be found in /usr/share/common-licenses/GPL' and
+    the Artistic Licence in /usr/share/common-licenses/Artistic'.
+
--- xen-tools-4.1.orig/debian/preinst
+++ xen-tools-4.1/debian/preinst
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+#
+# Skip, if we are not in "configure" state
+#
+
+if [ "$1" != "upgrade" ]; then
+        exit 0
+fi
+
+#
+# 2.x -> 3.x
+#
+if [ -L "/usr/lib/xen-tools/dapper.d" ]; then
+        rm /usr/lib/xen-tools/dapper.d
+fi
+if [ -L "/usr/lib/xen-tools/edgy.d" ]; then
+        rm /usr/lib/xen-tools/edgy.d
+fi
+if [ -d "/usr/lib/xen-tools/ubuntu.d" ]; then
+	rm -r /usr/lib/xen-tools/ubuntu.d
+fi
+
+#DEBHELPER#
+exit 0
--- xen-tools-4.1.orig/debian/rules
+++ xen-tools-4.1/debian/rules
@@ -0,0 +1,55 @@
+#!/usr/bin/make -f
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	make clean
+	rm -f build-stamp configure-stamp
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+
+	make manpages
+	make install prefix=`pwd`/debian/xen-tools
+
+	dh_installdirs
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_install
+	dh_installexamples debian/examples/setup-kernel-initrd debian/examples/update-modules
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- xen-tools-4.1.orig/debian/README.Debian
+++ xen-tools-4.1/debian/README.Debian
@@ -0,0 +1,35 @@
+README
+======
+
+Kernel/initrd guessing
+======================
+
+In xen-tools 3.4-1 a new feature was added which allows using 
+backtick expressions in xen-tools.conf.
+
+Using this feature you can improve kernel/initrd guessing by 
+changing/adding the following options in xen-tools.conf:
+
+   kernel      = /boot/vmlinuz-`uname -r`
+   ramdisk     = /boot/initrd.img-`uname -r`
+
+
+Upgrading Existing kernel/initrd paths
+--------------------------------------
+
+The kernel, and initrd, settings which are included in the xen-tools
+(either statically or dynamically with `uname -r`) are only applied
+when the new guest domains are created.
+
+If you upgrade your kernel you will be left with existing xen
+guest domains which :
+
+  -  Have the wrong paths setup in /etc/xen/*.cfg
+  -  Have incorrect modules stored within their disk images.
+
+Both of these can be updated via the helper scripts located
+in:
+
+   /usr/share/doc/xen-tools/examples/
+
+
--- xen-tools-4.1.orig/debian/docs
+++ xen-tools-4.1/debian/docs
@@ -0,0 +1,5 @@
+AUTHORS
+README
+SUPPORT
+BUGS
+TODO
\ No newline at end of file
--- xen-tools-4.1.orig/debian/postinst
+++ xen-tools-4.1/debian/postinst
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+#
+# Skip, if we are not in "configure" state
+#
+if [ "$1" != "configure" ]; then
+        echo "I: Skipping configuration"
+        exit 0
+fi
+
+#
+#  Handle obsolete directories.
+#
+if [ -d "/etc/xen-tools/xen-create-image.d" ]; then
+	rmdir "/etc/xen-tools/xen-create-image.d" 2>/dev/null || 
+	         echo "The directory /etc/xen-tools/xen-create-image.d is no longer used. You can safely remove it."
+fi
+
+#
+#  1.x -> 2.x
+#
+if [ -d "/etc/xen-tools/hook.d" ]; then
+	rmdir "/etc/xen-tools/hook.d" 2>/dev/null || 
+	         echo "The directory /etc/xen-tools/hook.d is no longer used. You can safely remove it."
+fi
+
+#DEBHELPER#
+exit 0
--- xen-tools-4.1.orig/debian/examples/update-modules
+++ xen-tools-4.1/debian/examples/update-modules
@@ -0,0 +1,233 @@
+#!/usr/bin/perl
+#
+#  This code is intended to update the modules installed within each
+# Xen guest domain to the named version.
+#
+#  It should be fairly safe, but I make no promises - hence why this
+# is an example.
+#
+# Steve
+# --
+#
+
+use strict;
+use warnings;
+
+use File::Path qw/ rmtree  /;
+use File::Temp qw/ tempdir /;
+
+
+my $modules = shift;
+if ( ! defined( $modules ) )
+{
+    print <<EOF;
+
+ Usage: $0 <modules>
+
+  eg: $0 2.6.18.xx|/usr/lib/modules/nn.nn.nn-xen
+
+EOF
+  exit;
+}
+
+
+#
+#  Make sure the path is fully qualified.
+#
+if ( $modules !~ /^[\/\\]/ )
+{
+    $modules = "/lib/modules/" . $modules;
+}
+
+
+#
+#  Make sure the module directory exists.
+#
+if ( ! -d $modules )
+{
+    print "The modules directory $modules doesn't exist.\n";
+    exit;
+}
+
+
+#
+#  OK now we have the modules so we need to:
+#
+#  0.  Read our configuration file.
+#  1.  Find each xen guest.
+#  2.  Ensure it isn't running (TODO)
+#  3.  Mount the disk image.
+#  4.  Remove existing modules, and copy in the specified ones.
+#
+#
+
+
+my %CONFIG;
+readConfigurationFile( "/etc/xen-tools/xen-tools.conf" );
+
+
+foreach my $guest ( findGuests() )
+{
+    print "Attempting to update guest: $guest\n";
+
+    #
+    #  Create a temporary directory to mount the disk upon.
+    #
+    my $tmp = tempdir( CLEANUP => 1 );
+
+    #
+    # Mount the disk.
+    #
+    if ( $CONFIG{'dir'} )
+    {
+        # The loopback image.
+        my $img =  $CONFIG{'dir'} . "/domains/" . $guest . "/disk.img";
+        system( "mount -o loop $img $tmp" );
+    }
+    elsif ( $CONFIG{'lvm'} )
+    {
+        # The LVM volume
+        my $img = "/dev/" . $CONFIG{'lvm'} . "/$guest-disk";
+        system( "mount $img $tmp" );
+    }
+    else
+    {
+        print "Unhandled disk format - can't mount\n";
+        next;
+    }
+
+
+    #
+    #  We've got it mounted.
+    #
+    print "\tMounted disk image.\n";
+
+    # make sure we have a directory
+    if ( ! -d $tmp . "/lib/modules" )
+    {
+        print "\tMissing modules.  Skipping\n";
+        next;
+    }
+    #
+    #  Remove the existing module directories.
+    #
+    `rm -rf  $tmp/lib/modules`;
+    mkdir $tmp . "/lib/modules";
+    print "\tRemoved existing modules\n";
+
+    #
+    #  Copy existing directory.
+    #
+    if ( -d $tmp . "/lib/modules" )
+    {
+        `cp -R $modules $tmp/lib/modules/`;
+        print "\tCopied over $modules\n";
+    }
+    else
+    {
+        print "No module directory .. weirdness\n";
+    }
+
+    #
+    #  Unmount
+    #
+    system( "umount $tmp" );
+    print "\tUnmounted disk image.\n\n";
+}
+
+
+
+
+=begin doc
+
+  Find each xen guest upon the system.
+
+=end doc
+
+=cut
+
+sub findGuests
+{
+    my @results;
+
+    #
+    #  Assume xen-tools.
+    #
+    foreach my $file ( glob( "/etc/xen/*.cfg" ) )
+    {
+        #
+        #  Find the name.
+        #
+        open( INPUT, "<" , $file );
+        foreach my $line ( <INPUT> )
+        {
+            chomp( $line );
+            if ( $line =~ /name\s*=\s*['"]([^'"]+)["']/ )
+            {
+                push @results, $1;
+            }
+        }
+        close( INPUT );
+    }
+    return( sort( @results ) );
+}
+
+
+
+
+=begin doc
+
+  Read the configuration file specified.
+
+=end doc
+
+=cut
+
+sub readConfigurationFile
+{
+    my ($file) = ( @_ );
+
+    open( FILE, "<", $file ) or die "Cannot read file '$file' - $!";
+
+    my $line       = "";
+
+    while (defined($line = <FILE>) )
+    {
+        chomp $line;
+        if ($line =~ s/\\$//)
+        {
+            $line .= <FILE>;
+            redo unless eof(FILE);
+        }
+
+        # Skip lines beginning with comments
+        next if ( $line =~ /^([ \t]*)\#/ );
+
+        # Skip blank lines
+        next if ( length( $line ) < 1 );
+
+        # Strip trailing comments.
+        if ( $line =~ /(.*)\#(.*)/ )
+        {
+            $line = $1;
+        }
+
+        # Find variable settings
+        if ( $line =~ /([^=]+)=([^\n]+)/ )
+        {
+            my $key = $1;
+            my $val = $2;
+
+            # Strip leading and trailing whitespace.
+            $key =~ s/^\s+//;
+            $key =~ s/\s+$//;
+            $val =~ s/^\s+//;
+            $val =~ s/\s+$//;
+
+            # Store value.
+            $CONFIG{ $key } = $val;
+        }
+    }
+
+    close( FILE );
+}
--- xen-tools-4.1.orig/debian/examples/setup-kernel-initrd
+++ xen-tools-4.1/debian/examples/setup-kernel-initrd
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+#  This script is designed to setup the kernel and ramdisk inside
+# the xen-tools configuration file; and also update any stored values
+# in any pre-generated Xen guests.
+#
+#  This is useful if you have upgraded your Xen kernel.
+#
+# Steve
+# --
+#
+
+
+
+
+#
+#  Find the kernel to use, and the ramdisk, unless they are specified
+# in the environment.
+#
+if [ -z "${kernel}" ]; then
+    kernel=`ls -1 /boot| grep ^vm| grep -v syms| grep xen | sort -r| head -n 1`
+    kernel="/boot/${kernel}"
+fi
+if [ -z "${ramdisk}" ]; then
+    ramdisk=`ls -1 /boot| grep ^init| grep xen| sort -r| head -n 1`
+    ramdisk="/boot/${ramdisk}"
+fi
+
+
+#
+#  Abort if we didn't find a kernel / ramdisk
+#
+if [ -z "${kernel}" ]; then
+    echo "Failed to find Xen kernel."
+    exit
+fi
+if [ -z "${ramdisk}" ]; then
+    echo "Failed to find Xen ramdisk."
+    exit
+fi
+
+
+#
+#  Show what we're going to do - and prompt for confirmation.
+#
+cat <<EOF
+
+  Updating xen-tools configuration file, and all Xen guests with:
+
+    kernel  : ${kernel}
+    ramdisk : ${ramdisk}
+
+  Press enter to continue, or Ctrl-c to abort.
+
+EOF
+read
+
+
+
+#
+#  Update the xen-tools configuration file.
+#
+perl -pi -e "s|^\s*kernel\s*=(.*)|kernel = ${kernel}|" /etc/xen-tools/xen-tools.conf
+perl -pi -e "s|^\s*initrd\s*=(.*)|initrd = ${ramdisk}|" /etc/xen-tools/xen-tools.conf
+
+
+
+
+
+#
+#  Now modify each of the Xen guest configuration files beneath /etc/xen.
+#
+for i in /etc/xen/*.cfg; do
+    
+    # test that the file exists - ie. glob succeeded.
+    if [ -e $i ]; then
+                
+        #
+        #  Upgrade kernel + ramdisk
+        #
+        perl -pi -e "s|^\s*kernel\s*=(.*)|kernel = '${kernel}'|" $i
+        perl -pi -e "s|^\s*ramdisk\s*=(.*)|ramdisk = '${ramdisk}'|" $i
+
+    fi
+
+done
+
