From: José Martínez Date: Sun, 6 Jul 2014 19:55:41 +0000 (+0200) Subject: lxc-ubuntu: fix btrfs when rootfs == realrootfs X-Git-Tag: lxc-1.1.0.alpha1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6e07af7c255f3650edc8ce3f83b6af7e5c02f66;p=thirdparty%2Flxc.git lxc-ubuntu: fix btrfs when rootfs == realrootfs Fix btrfs support when lxc-create does not bind-mount the rootfs. Signed-off-by: José Martínez Acked-by: Stéphane Graber --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 8550ce920..b151375a1 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -404,10 +404,10 @@ copy_ubuntu() try_mksubvolume $rootfs if is_btrfs_subvolume $cache/rootfs-$arch && is_btrfs_subvolume $rootfs; then realrootfs=$(dirname $config)/rootfs - umount $rootfs || return 1 + [ "$rootfs" = "$realrootfs" ] || umount $rootfs || return 1 btrfs subvolume delete $realrootfs || return 1 btrfs subvolume snapshot $cache/rootfs-$arch $realrootfs || return 1 - mount --bind $realrootfs $rootfs || return 1 + [ "$rootfs" = "$realrootfs" ] || mount --bind $realrootfs $rootfs || return 1 else rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1 fi