Package: xen-tools
Version: 4.3.1-1
Severity: critical
Tags: patch upstream
Justification: breaks the whole system

When creating a machine with XFS as filesytem the 91-install-fs-tools does not 
install the xfs_progs.
The following error is logged:

  /usr/lib/xen-tools/wheezy.d/91-install-fs-tools: 32: [: -eq: unexpected 
operator
  /usr/lib/xen-tools/wheezy.d/91-install-fs-tools: 35: [: -eq: unexpected 
operator
  /usr/lib/xen-tools/wheezy.d/91-install-fs-tools: 38: [: -eq: unexpected 
operator

This lines actually contain the following: 
  if [ $has_xfs -eq 1 ]; then

The issue is  that $has_xfs is set in 90-make-fstab but not accessable in 
91-install-fs-tools

I see that the upstream maintainer already has a patch for this issue: 
1de424a69d838a5cff19c17f019935c716fe0700
Attached you can also find this patch.
commit 1de424a69d838a5cff19c17f019935c716fe0700
Author: Axel Beckert <a...@deuxchevaux.org>
Date:   Wed Jan 23 18:02:44 2013 +0100

    Fix filesystem tools installation in 91-install-fs-tools
    
    Was broken since 4.3rc1.
    
    Merged 91-install-fs-tools back into 90-make-fstab. Added support for
    RPM-based distributions, too, so it's more generic now.

diff --git a/debian/changelog b/debian/changelog
index 25a0063..0e93aba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,9 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low
       update the menu.list automatically.
     - hooks/common.sh: Rename installCentOS4Package to installRPMPackage.
       Add installCentOS4Package wrapper for backward compatibility.
+    - Fix filesystem tools installation in 91-install-fs-tools (which was
+      broken since 4.3~rc1-1) by merging 91-install-fs-tools back into
+      90-make-fstab. Also supports RPM-based distributions now.
   * Add debian/gbp.conf to be able to to build xen-tools with
     git-buildpackage.
   * Clean up debian/rules:
diff --git a/hooks/common/90-make-fstab b/hooks/common/90-make-fstab
index cf32731..81e715f 100755
--- a/hooks/common/90-make-fstab
+++ b/hooks/common/90-make-fstab
@@ -100,6 +100,34 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
 done
 
 
+logMessage Checking for filesystem tools to install
+
+#
+#  Install any required packages for the given root filesystem
+#
+if [ "$has_xfs" -eq 1 ]; then
+    installPackage ${prefix} xfsprogs
+fi
+if [ "$has_reiserfs" -eq 1 ]; then
+    if isAPT; then
+        installDebianPackage reiserfsprogs
+    elif isYum; then
+        installRPMPackage reiserfs-utils
+    else
+        logMessage "Unable to install reiserfs tools; no package manager recognized"
+    fi
+fi
+if [ "$has_btrfs" -eq 1 ]; then
+    if isAPT; then
+        installDebianPackage btrfs-tools
+    elif isYum; then
+        installRPMPackage btrfs-progs
+    else
+        logMessage "Unable to install btrfs tools; no package manager recognized"
+    fi
+fi
+
+
 #
 #  Log our finish
 #
diff --git a/hooks/common/91-install-fs-tools b/hooks/common/91-install-fs-tools
deleted file mode 100755
index c3af3cb..0000000
--- a/hooks/common/91-install-fs-tools
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-#
-#  Some root filesystems will require the installation of new packages
-#
-# Steve
-# --
-# http://www.steve.org.uk/
-
-
-prefix=$1
-
-#
-#  Source our common functions
-#
-if [ -e /usr/lib/xen-tools/common.sh ]; then
-    . /usr/lib/xen-tools/common.sh
-else
-    . ./hooks/common.sh
-fi
-
-
-#
-# Log our start
-#
-logMessage Script $0 starting
-
-
-#
-#  Install any required packages for the given root filesystem
-#
-if [ "$has_xfs" -eq 1 ]; then
-    installDebianPackage ${prefix} xfsprogs
-fi
-if [ "$has_reiserfs" -eq 1 ]; then
-    installDebianPackage ${prefix} reiserfsprogs
-fi
-if [ "$has_btrfs" -eq 1 ]; then
-    installDebianPackage ${prefix} btrfs-tools
-fi
-
-
-#
-#  Log our finish
-#
-logMessage Script $0 finished
diff --git a/hooks/dapper/91-install-fs-tools b/hooks/dapper/91-install-fs-tools
deleted file mode 120000
index ac7f209..0000000
--- a/hooks/dapper/91-install-fs-tools
+++ /dev/null
@@ -1 +0,0 @@
-../common/91-install-fs-tools
\ No newline at end of file
diff --git a/hooks/debian/91-install-fs-tools b/hooks/debian/91-install-fs-tools
deleted file mode 120000
index ac7f209..0000000
--- a/hooks/debian/91-install-fs-tools
+++ /dev/null
@@ -1 +0,0 @@
-../common/91-install-fs-tools
\ No newline at end of file
diff --git a/hooks/edgy/91-install-fs-tools b/hooks/edgy/91-install-fs-tools
deleted file mode 120000
index ac7f209..0000000
--- a/hooks/edgy/91-install-fs-tools
+++ /dev/null
@@ -1 +0,0 @@
-../common/91-install-fs-tools
\ No newline at end of file
diff --git a/hooks/intrepid/91-install-fs-tools b/hooks/intrepid/91-install-fs-tools
deleted file mode 120000
index ac7f209..0000000
--- a/hooks/intrepid/91-install-fs-tools
+++ /dev/null
@@ -1 +0,0 @@
-../common/91-install-fs-tools
\ No newline at end of file
diff --git a/hooks/karmic/91-install-fs-tools b/hooks/karmic/91-install-fs-tools
deleted file mode 120000
index ac7f209..0000000
--- a/hooks/karmic/91-install-fs-tools
+++ /dev/null
@@ -1 +0,0 @@
-../common/91-install-fs-tools
\ No newline at end of file

Reply via email to