Group :: Emulators
RPM: xen-tools
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: xen-tools-4.4-alt3.patch
Download
Download
AUTHORS | 16 ++++++
Makefile | 1 +
README.markdown | 3 +-
TODO.markdown | 8 +++
bin/xen-create-image | 102 ++---------------------------------
bin/xen-delete-image | 5 +-
bin/xt-customize-image | 22 +++++++-
debian/changelog | 17 ++++++
debian/control | 3 +-
debian/dirs | 3 +-
etc/xen-tools.conf | 5 +-
hooks/common/20-setup-yum | 2 +-
hooks/common/40-setup-networking-deb | 1 -
hooks/debian/80-install-kernel | 13 ++++-
lib/Xen/Tools/Common.pm | 5 +-
t/perl-syntax.t | 3 ++
t/xen-delete-image.t | 2 +-
17 files changed, 99 insertions(+), 112 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 36f64ac..26c76a4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -34,9 +34,15 @@ Contributions
Vagrant Cascadian <vagrant [at] org.debian>
- Less redundant SSH key generation
+ Adrian C. (anrxc) <anrxc [at] org.sysphere>
+ - Hook overrides
+
Edd Dumbill <edd [at] com.usefulinc>
- Contributed APT sources.list file for Ubuntu's Dapper release.
+ Lionel FÉLICITÉ <lfelicite [at] com clever-age>
+ - Bugfix for Centos 6 installation
+
Kevin Fullerton <kevin.fullerton [at] uk.co.shotgun-suicide>
- Fixup for gentoos revised networking scripts. (dhcp)
@@ -65,6 +71,9 @@ Contributions
- Improved binary detection and good suggestions.
- Better portability for non-bash shells.
+ Daniel Lintott <daniel [at] uk.co.serverb>
+ - Bugfix for Jessie and newer installations
+
Jorge Armando Medina <jmedina [at] com.e-compugraf>
- Fix for backward compatibility with xvc0 serial consoles
@@ -97,6 +106,9 @@ Contributions
- CentOS 6 support
- CentOS 5 fixes
+ Patryk Ściborek <patryk [at] com.sciborek>
+ - Ubuntu-related bugfix
+
Radu Spineanu <radu [at] org.debian>
- Supplied many small tweaks, bugfixes, and suggestions.
- Radu is also one of the former Debian package maintainers.
@@ -116,5 +128,9 @@ Contributions
Ward Vandewege <ward [at] be.pong>
- Made several updates for Ubuntu support.
+ Joan <aseques [at] com.gmail>
+ - Bugfix for password interaction
+ - maxmem option
+
xstasi on Launchpad
- Proper upstart handling in the chroot
diff --git a/Makefile b/Makefile
index 32819b4..99580a6 100644
--- a/Makefile
+++ b/Makefile
@@ -203,6 +203,7 @@ install-hooks:
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d raring.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d saucy.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d trusty.d
+ -cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d utopic.d
cp hooks/common.sh ${prefix}/usr/share/xen-tools
cp -r hooks/common ${prefix}/usr/share/xen-tools
diff --git a/README.markdown b/README.markdown
index 8868933..d43d31d 100644
--- a/README.markdown
+++ b/README.markdown
@@ -56,7 +56,8 @@ known to work reliably, i.e.:
* Quantal Quetzal 12.10
* Raring Ringtail 13.04
* Saucy Salamander 13.10
-* Trusty Tahr 14.04 (LTS, under development)
+* Trusty Tahr 14.04 (LTS)
+* Utopic Unicorn 14.10 (under development)
[1]: http://bugs.debian.org/659360
"debootstrap in Wheezy can no more build Ubuntu Edgy or earlier"
diff --git a/TODO.markdown b/TODO.markdown
index ac53045..f78b985 100644
--- a/TODO.markdown
+++ b/TODO.markdown
@@ -195,6 +195,14 @@ Bugs to fix and features to add for 5.0
mount commands in `xen-update-image`. The calls to uname or
lsb_release should be fine.)
+* Make default source installation work on non-debianesk systems, e.g.
+ either don't use xt-guess-suite-and-mirror in xen-tools.conf or make
+ it work with e.g. Fedora.
+
+* Error messages triggered by xenRunning should rather say something
+ about "known to the Xen system" instead of "running". See
+ https://bugs.debian.org/703606
+
Stuff from Steve's TODO list / Generic TODOs
--------------------------------------------
diff --git a/bin/xen-create-image b/bin/xen-create-image
index c52a37a..a3f9d08 100755
--- a/bin/xen-create-image
+++ b/bin/xen-create-image
@@ -151,9 +151,6 @@ and EVMS EXAMPLE.
used the system will not have a swap entry added to
its /etc/fstab file either.
- --no-xen-ok Don't complain if xen seems not installed or xend is
- not running. (Needed for the testsuite.)
-
--output=dir Specify the output directory to create the xen
configuration file within.
@@ -1196,95 +1193,6 @@ EOF
exit 127;
}
}
-
-
- #
- # Test the system has a valid (network-script) + (vif-script) setup.
- #
- testXenConfig();
-
-}
-
-
-
-=begin doc
-
- Test that the current Xen host has a valid network configuration,
- this is designed to help newcomers to Xen.
-
-=end doc
-
-=cut
-
-sub testXenConfig
-{
-
- # wierdness.
- return if ( !-d "/etc/xen" );
-
- #
- # Temporary hash.
- #
- my %cfg;
-
- #
- # Read the configuration file.
- #
- open( CONFIG, "<", "/etc/xen/xend-config.sxp" ) or
- fail("Failed to read /etc/xen/xend-config.sxp: $!");
- while (<CONFIG>)
- {
- next if ( !$_ || !length($_) );
-
- # vif
- if ( $_ =~ /^\(vif-script ([^)]+)/ )
- {
- $cfg{ 'vif-script' } = $1;
- }
-
- # network
- if ( $_ =~ /^\(network-script ([^)]+)/ )
- {
- $cfg{ 'network-script' } = $1;
- }
- }
- close(CONFIG);
-
- if ( !defined( $cfg{ 'network-script' } ) ||
- !defined( $cfg{ 'vif-script' } ) )
- {
- print <<EOF;
-
-WARNING
--------
-
- You appear to have a missing vif-script, or network-script, in the
- Xen configuration file /etc/xen/xend-config.sxp.
-
- Please fix this and restart Xend, or your guests will not be able
- to use any networking!
-
-EOF
- }
- else
- {
- if ( ( $cfg{ 'network-script' } =~ /dummy/i ) ||
- ( $cfg{ 'vif-script' } =~ /dummy/i ) )
- {
-
- print <<EOF;
-WARNING
--------
-
- You appear to have a "dummy" vif-script, or network-script, setting
- in the Xen configuration file /etc/xen/xend-config.sxp.
-
- Please fix this and restart Xend, or your guests will not be able to
- use any networking!
-
-EOF
- }
- }
}
@@ -1344,10 +1252,10 @@ sub setupDefaultOptions
$CONFIG{ 'mirror_'.$debdist } = 'http://http.debian.net/debian-archive/debian';
}
# Initialize per distribution mirror defaults: Ubuntu
- foreach my $ubuntudist (qw(lucid precise quantal raring saucy trusty)) {
+ foreach my $ubuntudist (qw(lucid precise saucy trusty utopic)) {
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://archive.ubuntu.com/ubuntu';
}
- foreach my $ubuntudist (qw(dapper edgy feisty gutsy hardy intrepid jaunty karmic maverick natty oneiric)) {
+ foreach my $ubuntudist (qw(dapper edgy feisty gutsy hardy intrepid jaunty karmic maverick natty oneiric quantal raring)) {
$CONFIG{ 'mirror_'.$ubuntudist } = 'http://old-releases.ubuntu.com/ubuntu';
}
$CONFIG{ 'apt_proxy' } = '';
@@ -1356,7 +1264,6 @@ sub setupDefaultOptions
chomp($CONFIG{ 'arch' });
$CONFIG{ 'fs' } = 'ext3';
$CONFIG{ 'force' } = 0;
- $CONFIG{ 'no_xen_ok' } = 0;
$CONFIG{ 'install' } = 1;
$CONFIG{ 'hooks' } = 1;
$CONFIG{ 'partitions' } = '';
@@ -1689,7 +1596,7 @@ sub parseCommandLineArguments
"finalrole=s", \&checkOption,
"roledir=s", \&checkOption,
"force!", \$CONFIG{ 'force' },
- "no-xen-ok", \$CONFIG{ 'no_xen_ok' },
+ "no-xen-ok", sub { warn "Option --no-xen-ok is deprecated and ignored."; },
"keep!", \$CONFIG{ 'keep' },
"template=s", \&checkOption,
"output=s", \&checkOption,
@@ -3085,8 +2992,7 @@ sub createLVMBits
# Delete if forcing
if ( $CONFIG{ 'force' } )
{
- if ( $CONFIG{ 'no_xen_ok' } or
- !xenRunning($CONFIG{ 'hostname' }, \%CONFIG)) {
+ unless ( xenRunning($CONFIG{ 'hostname' }, \%CONFIG)) {
logprint(
"Removing $lvm_disk - since we're forcing the install\n");
runCommand("lvremove --force $lvm_disk", \%CONFIG);
diff --git a/bin/xen-delete-image b/bin/xen-delete-image
index 616bc53..e79ee74 100755
--- a/bin/xen-delete-image
+++ b/bin/xen-delete-image
@@ -30,7 +30,6 @@ xen-delete-image - Delete previously created Xen instances.
Testing options:
--test Don't complain if we're not invoked by root.
- --no-xen-ok Don't complain if xen seems not installed or xend is not running
=head1 OPTIONS
@@ -233,7 +232,7 @@ foreach my $name (@ARGV, @hosts)
{
my %PER_HOST_CONFIG = %CONFIG;
$PER_HOST_CONFIG{ 'hostname' } = $name;
- if ( $CONFIG{ 'no_xen_ok' } or !xenRunning($name, \%PER_HOST_CONFIG) )
+ unless ( xenRunning($name, \%PER_HOST_CONFIG) )
{
deleteXenImage($name);
}
@@ -276,7 +275,7 @@ sub parseCommandLineArguments
"hostname=s@", \$CONFIG{ 'hostname' },
"test", \$CONFIG{ 'test' },
"verbose", \$CONFIG{ 'verbose' },
- "no-xen-ok", \$CONFIG{ 'no_xen_ok' },
+ "no-xen-ok", sub { warn "Option --no-xen-ok is deprecated and ignored."; },
"help", \$HELP,
"manual", \$MANUAL,
"version", \$VERSION
diff --git a/bin/xt-customize-image b/bin/xt-customize-image
index ba8aefb..803ee4e 100755
--- a/bin/xt-customize-image
+++ b/bin/xt-customize-image
@@ -54,6 +54,15 @@ xt-customize-image - Customize a freshly installed copy of GNU/Linux
executed from '/usr/share/xen-tools/foo.d'. Each executable will
be loaded and executed in sorted order.
+ The systems administrator can optionally provide site-specific
+ revisions of those same hooks by placing them in the directory
+ '/etc/xen-tools/hooks.d/' in which case a script with the same name
+ as the one in the 'foo.d' directory above will take precedence. In
+ this way certain hooks can be prevented from running, expanded with
+ site-specific features which won't get overwritten on upgrades, or
+ patched with critical bug-fixes before the upstream OS distribution
+ provider reacts.
+
=head1 AUTHORS
@@ -251,6 +260,7 @@ sub runDistributionHooks
# Hook directory.
#
my $hooks = "/usr/share/xen-tools/" . $CONFIG{ 'dist' } . ".d/";
+ my $hooks_local = "/etc/xen-tools/hooks.d/";
#
# Installation prefix
@@ -296,9 +306,19 @@ sub runDistributionHooks
}
#
+ # Run a local version of the hook instead of the system one,
+ # if the local one exists and is executable.
+ #
+ my $file_local = $hooks_local . $name;
+ if ( ( -x $file_local ) && ( -f $file_local ) )
+ {
+ $file = $file_local
+ }
+
+ #
# Complete command we're going to execute.
#
- my $cmd = $hooks . $name . " $CONFIG{'location'}";
+ my $cmd = $file . " $CONFIG{'location'}";
#
# Run the command. This has different prolog and epilog
diff --git a/debian/changelog b/debian/changelog
index 422e5e4..30d33c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+xen-tools (4.4+dev-1) UNRELEASED; urgency=low
+
+ * Use "686-pae" kernels instead of "686" kernels on Debian Wheezy and
+ later. Thanks to Daniel Lintott! (Closes: #742778)
+ * Pass "-y" option ("assume yes") to yum (Closes: #735675)
+ Thanks Lionel FÉLICITÉ!
+ * Drop all xend related sanity checks, they cause more havoc nowadays
+ than they help. Thanks Ian Campbell! (Closes: #732456)
+ * Apply patch by Adrian C. (anrxc) to allow to override hooks in
+ /usr/share/xen-tools/*.d/ with hooks in /etc/xen-tools/hooks.d/.
+ Thanks! (Also add /etc/xen-tools/hooks.d/ to debian/dirs.)
+ * Ignore cover_db directory in t/perl-syntax.t.
+ * Update list of supported Ubuntu releases. Preliminary support for
+ Ubuntu 14.10 Utopic Unicorn.
+
+ -- Axel Beckert <abe@debian.org> Sun, 15 Dec 2013 17:20:43 +0100
+
xen-tools (4.4-1) unstable; urgency=low
* New upstream release
diff --git a/debian/control b/debian/control
index 254b3ef..5c4b9bd 100644
--- a/debian/control
+++ b/debian/control
@@ -75,6 +75,7 @@ Description: Tools to manage Xen virtual servers
* Ubuntu 12.10 Quantal Quetzal
* Ubuntu 13.04 Raring Ringtail
* Ubuntu 13.10 Saucy Salamander
- * Ubuntu 14.04 Trusty Tahr (LTS, under development)
+ * Ubuntu 14.04 Trusty Tahr (LTS)
+ * Ubuntu 14.10 Utopic Unicorn (under development)
* CentOS 5
* CentOS 6
diff --git a/debian/dirs b/debian/dirs
index d9b8b71..00a4f8f 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1,4 +1,5 @@
/etc/xen-tools
/etc/xen-tools/role.d
+/etc/xen-tools/hooks.d
/etc/xen-tools/skel
-/usr/share/xen-tools
\ No newline at end of file
+/usr/share/xen-tools
diff --git a/etc/xen-tools.conf b/etc/xen-tools.conf
index cf036a4..d57ba5f 100644
--- a/etc/xen-tools.conf
+++ b/etc/xen-tools.conf
@@ -290,10 +290,11 @@ mirror = `xt-guess-suite-and-mirror --mirror`
# mirror_natty = http://old-releases.ubuntu.com/ubuntu
# mirror_oneiric = http://archive.ubuntu.com/ubuntu
# mirror_precise = http://archive.ubuntu.com/ubuntu
-# mirror_quantal = http://archive.ubuntu.com/ubuntu
-# mirror_raring = http://archive.ubuntu.com/ubuntu
+# mirror_quantal = http://old-releases.ubuntu.com/ubuntu
+# mirror_raring = http://old-releases.ubuntu.com/ubuntu
# mirror_saucy = http://archive.ubuntu.com/ubuntu
# mirror_trusty = http://archive.ubuntu.com/ubuntu
+# mirror_utopic = http://archive.ubuntu.com/ubuntu
# If this is defined it will be used by debootstrap, and configured as the
# proxy for the guest
diff --git a/hooks/common/20-setup-yum b/hooks/common/20-setup-yum
index 65968cb..ebae274 100755
--- a/hooks/common/20-setup-yum
+++ b/hooks/common/20-setup-yum
@@ -33,7 +33,7 @@ if [ ! -d ${prefix}/proc ]; then
mkdir -p ${prefix}/proc
fi
mount -o bind /proc ${prefix}/proc
-chroot ${prefix} /usr/bin/yum update
+chroot ${prefix} /usr/bin/yum update -y
umount ${prefix}/proc
diff --git a/hooks/common/40-setup-networking-deb b/hooks/common/40-setup-networking-deb
index 162d0b2..6ebc175 100755
--- a/hooks/common/40-setup-networking-deb
+++ b/hooks/common/40-setup-networking-deb
@@ -88,7 +88,6 @@ setupStaticNetworking ()
#
# gateway address?
#
- gateway='';
if [ -n "${gateway}" ]; then
gateway=" gateway ${gateway}"
fi
diff --git a/hooks/debian/80-install-kernel b/hooks/debian/80-install-kernel
index 03a1190..af56ca8 100755
--- a/hooks/debian/80-install-kernel
+++ b/hooks/debian/80-install-kernel
@@ -29,7 +29,7 @@ if [ "${pygrub}" ]; then
logMessage Script $0 starting
#
-# Resolve the correct architecutre
+# Resolve the correct architecture
#
if [ "${arch}" = "i386" ]; then
@@ -61,6 +61,17 @@ fi
KERNEL_XEN_PKG="linux-image-xen-$XEN_ARCH"
KERNEL_PKG="linux-image-$XEN_ARCH"
+# Add "-pae" suffix for Debian releases after Squeeze. See
+# https://bugs.debian.org/742778 for details.
+if [ "${dist}" != "sarge" -a \
+ "${dist}" != "etch" -a \
+ "${dist}" != "lenny" -a \
+ "${dist}" != "squeeze" -a \
+ "$XEN_ARCH" = "686" ]; then
+ KERNEL_XEN_PKG="$KERNEL_XEN_PKG-pae"
+ KERNEL_PKG="$KERNEL_PKG-pae"
+fi
+
logMessage Attempting to install the $KERNEL_XEN_PKG kernel image
if chroot ${prefix} /usr/bin/apt-cache show $KERNEL_XEN_PKG > /dev/null 2>&1; then
logMessage Package $KERNEL_XEN_PKG is available - installing
diff --git a/lib/Xen/Tools/Common.pm b/lib/Xen/Tools/Common.pm
index 0eecbd9..04599d5 100644
--- a/lib/Xen/Tools/Common.pm
+++ b/lib/Xen/Tools/Common.pm
@@ -128,7 +128,10 @@ sub xenRunning ($$)
my $running = 0;
- die "Couldn't determine Xen toolstack" unless $CONFIG->{'xm'};
+ unless ($CONFIG->{'xm'}) {
+ warn "Couldn't determine Xen toolstack, skipping check for running DomUs.";
+ return 0;
+ }
open( CMD, $CONFIG->{'xm'}." list $hostname 2>/dev/null |" ) or
fail_with_config("Failed to run '".$CONFIG->{'xm'}." list $hostname'", $CONFIG);
diff --git a/t/perl-syntax.t b/t/perl-syntax.t
index 1cca99d..e56a279 100755
--- a/t/perl-syntax.t
+++ b/t/perl-syntax.t
@@ -51,6 +51,9 @@ sub checkFile
# `tests/hook-tls.t` is too.
return if ( $file =~ /hook-tls.t$/ );
+ # Ignore cover_db files
+ return if ( $file =~ /^\.\/cover_db\// );
+
# See if it is a perl file.
my $isPerl = 0;
diff --git a/t/xen-delete-image.t b/t/xen-delete-image.t
index 4166966..e234687 100755
--- a/t/xen-delete-image.t
+++ b/t/xen-delete-image.t
@@ -75,7 +75,7 @@ close( IMAGE );
# So we need to run the deletion script and verify the images
# are removed correctly.
#
-my $log = `perl -I./lib -I../lib ./bin/xen-delete-image --test --verbose --no-xen-ok --dir=$dir $hostname`;
+my $log = `perl -I./lib -I../lib ./bin/xen-delete-image --test --verbose --dir=$dir $hostname`;
ok ( $? == 0, 'Calling xen-delete-image returned exit code 0' );
print $log;