From c39628cbe459fe6c43824649f9063f60e4f1c06f Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Fri, 18 Jan 2013 01:26:11 +0100 Subject: [PATCH] Overwork TLS disabling on Debian and Ubuntu --- TODO.markdown | 13 +++++++------ debian/changelog | 1 + hooks/common/20-setup-apt | 14 +++++--------- hooks/debian/20-setup-apt | 32 +++++++++++--------------------- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/TODO.markdown b/TODO.markdown index e807f97..b2f0ec0 100644 --- a/TODO.markdown +++ b/TODO.markdown @@ -3,12 +3,6 @@ TODO See KNOWN_BUGS.markdown for real bugs. -Bugs to fix and features to add for 4.3 ---------------------------------------- - -Refactor TLS disabling. Seems to be happen twice, once in 20-setup-apt -and once in 10-disable-tls. - Bugs to fix and features to add for 5.0 --------------------------------------- @@ -181,6 +175,13 @@ Bugs to fix and features to add for 5.0 * Use `Perl::Critic` +* Refactor the different Ubuntu hooks directories so that only one + ubuntu hooks directory is left. + + Then also refactor TLS disabling so that it works on all + distributions the same. Currently Debian is a special case and + Ubuntu half a special case. + Stuff from Steve's TODO list / Generic TODOs -------------------------------------------- diff --git a/debian/changelog b/debian/changelog index 3500bb0..446a5e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low - Also recognize "M" and "G" instead of "MB" and "GB" as size unit for --memory. (Closes: #691320) Document the recognized units. - Default DomUs to use the noop scheduler (Closes: #693131) + - Overwork TLS disabling on Debian and Ubuntu - xen-list-images update: + now understands the --extension option. + also outputs the file name of the config file diff --git a/hooks/common/20-setup-apt b/hooks/common/20-setup-apt index c300bb8..2caa2ee 100755 --- a/hooks/common/20-setup-apt +++ b/hooks/common/20-setup-apt @@ -70,18 +70,14 @@ chroot ${prefix} /usr/bin/apt-get update # -# Now fixup TLS on non-64bit systems after dapper. +# Now fixup TLS on non-64bit systems after dapper. For dapper this is +# already fixed in 10-disable-tls. # -if [ "$dist" != 'dapper' ]; then - if [ "`uname -m`" = "x86_64" ]; then +if [ "$arch" = 'i386' -a "$dist" != 'dapper' ]; then - logMessage "Ignoring TLS since we're a 64 bit host." + logMessage "Installing libc6-xen" + installDebianPackage ${prefix} libc6-xen - else - - logMessage "Installing libc6-xen" - installDebianPackage ${prefix} libc6-xen - fi fi diff --git a/hooks/debian/20-setup-apt b/hooks/debian/20-setup-apt index 3788133..dd6bbed 100755 --- a/hooks/debian/20-setup-apt +++ b/hooks/debian/20-setup-apt @@ -90,30 +90,20 @@ fi # chroot ${prefix} /usr/bin/apt-get update - # -# For sid or etch systems we install libc6-xen +# For all systems after Sarge we install libc6-xen on i386 # -# For sarge we don't have that option, so we disable TLS. +# For Sarge we don't have that option, so we disable TLS the hard way. # -if [ "`uname -m`" = "x86_64" ]; then - - logMessage "Ignoring TLS since we're a 64 bit host." - -else - - case "${dist}" in - *) - logMessage "Installing xen-aware libc6" - - installDebianPackage ${prefix} libc6-xen - ;; - sarge) - logMessage "Disabling TLS" - mv ${prefix}/lib/tls ${prefix}/lib/tls.disabled - mkdir ${prefix}/lib/tls - ;; - esac +if [ "${arch}" = "i386" ]; then + if [ "${dist}" = 'sarge' ]; then + logMessage "Disabling TLS" + mv ${prefix}/lib/tls ${prefix}/lib/tls.disabled + mkdir ${prefix}/lib/tls + else + logMessage "Installing xen-aware libc6" + installDebianPackage ${prefix} libc6-xen + fi fi