Bug#716839: Fix

2013-07-20 Thread Robert Brockway

I experienced this problem also.  Fix below.

After reading this bug report I completely removed the contents of 
/var/cache/lxc and reattempted creating an LXC container with an LVM 
backing store - same result.


I ran aptitude update  aptitude upgrade to make sure I was up to 
date.


The problem turned out to be that when the line cp -a 
$cache/rootfs-$arch $rootfs || return 1 is executed in 
/usr/share/lxc/templates/lxc-debian-wheezy it behaves differently because 
$rootfs is a mount point.  As a result it copies rootfs-$arch to be a 
subdirecctory of $rootfs.  When file copies are subsequently attempted the 
tree is wrong and the build fails.


Here is a unified diff which makes this work with LVM.  I haven't tested 
this with non-LVM as it is late here. I wanted to post out my solution:


--- lxc-debian-wheezy   2013-07-21 01:49:25.518395282 +1000
+++ /usr/share/lxc/templates/lxc-debian-wheezy  2013-07-21 
01:49:35.721923899 +1000

@@ -125,7 +125,7 @@

 # make a local copy of the minidebian
 echo -n Copying rootfs to $rootfs...
-cp -a $cache/rootfs-$arch $rootfs || return 1
+cp -a $cache/rootfs-$arch/* $rootfs || return 1
 return 0
 }



Cheers,

Rob

--
Email: rob...@timetraveller.org Linux counter ID #16440
IRC: Solver (OFTC  Freenode)
Web: http://www.pracops.com
Director, Software in the Public Interest (http://spi-inc.org/)
Information is a gas


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#716839: (no subject)

2013-07-20 Thread Robert Brockway
Daniel, are you suggesting that the fix is to untar the upstream tar file 
over the top of the dpkg installed files?  From a system management and 
stability point of view I find this option undesirable.


Anyway here is a unified diff that fixes the problem with the LVM backing 
store and still works with the default backing store.  I haven't 
tested other backing stores but their behaviour should be unchanged.


I'd consider it highly desirable to get this patch in the Debian package 
so that LXC isn't broken with an LVM backing store.


--- lxc-debian-wheezy   2013-07-21 01:49:25.518395282 +1000
+++ /usr/share/lxc/templates/lxc-debian-wheezy  2013-07-21 
11:56:48.479221496 +1000

@@ -124,8 +124,16 @@
 rootfs=$3

 # make a local copy of the minidebian
+   # We need to behave differently if $rootfs exists and is a
+   # directory, as happens when we use LVM as a backing store.
 echo -n Copying rootfs to $rootfs...
-cp -a $cache/rootfs-$arch $rootfs || return 1
+   if [ -d $rootfs ]
+   then
+   cp -a $cache/rootfs-$arch/* $rootfs || return 1
+   else
+   cp -a $cache/rootfs-$arch $rootfs || return 1
+   fi
+
 return 0
 }


--
Email: rob...@timetraveller.org Linux counter ID #16440
IRC: Solver (OFTC  Freenode)
Web: http://www.pracops.com
Director, Software in the Public Interest (http://spi-inc.org/)
Information is a gas


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org