Package: xen-tools
Version: 2.6-1
Severity: important
Tags: patch

Hi Steve,

the new sysvinit (on debootstrap) mounts /lib/init/rw, which is still mounted
when xen-create-image wants to clean up the tempdir. Since the umount of the
tempdir fails silently, the recursive rm is applied to the whole (still
mounted) image, leaving only lib/init/rw and an unusable image. I propose the
following patch:

=====================================================================
--- xen-tools-2.6.orig/bin/xen-create-image
+++ xen-tools-2.6/bin/xen-create-image
@@ -1766,7 +1766,7 @@
     #
     #  Create a temporary mount-point to use for the image/volume.
     #
-    $MOUNT_POINT = tempdir( CLEANUP => 1 );
+    $MOUNT_POINT = tempdir();

     #
     #  Lookup the correct arguments to pass to mount.
@@ -2143,7 +2143,9 @@
        my $mount = `/bin/mount`;
        if ( $mount =~ /$MOUNT_POINT/)
        {
+           runCommand( "umount $MOUNT_POINT/lib/init/rw" );
            runCommand( "umount $MOUNT_POINT" );
+           runCommand( "rmdir $MOUNT_POINT" );
        }
     }

=====================================================================

(When further directories like lib/init/rw show up, we could factor out all
those into a list + umount loop.)

An alternative would be to leave CLEANUP => 1, but then, other errors leading
to similar problems could still occur in the future.

I can upload the package myself (and possibly adopt it), if you want,
considering #390904. I'm going to use it frequently.

Thanks!

bye,
  Roland

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-1-xen-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)

Versions of packages xen-tools depends on:
ii  debootstrap                   0.3.3      Bootstrap a basic Debian system
ii  libtext-template-perl         1.44-1.1   Text::Template perl module
ii  perl-modules                  5.8.8-6.1  Core Perl modules

Versions of packages xen-tools recommends:
pn  reiserfsprogs                 <none>     (no description available)
pn  rpmstrap                      <none>     (no description available)
pn  xen | xen-hypervisor-3.0      <none>     (no description available)
pn  xfsprogs                      <none>     (no description available)

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to