[lxc-devel] [lxc/master] Fix lxc-ubuntu template usage without qemu-debootstrap

d4s on Github lxc-bot at linuxcontainers.org
Sat Jul 1 14:17:09 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 472 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170701/59fa1c3f/attachment.bin>
-------------- next part --------------
From 2444157d85fc3e4d7f4d4e8fda4ff99244f286d8 Mon Sep 17 00:00:00 2001
From: Denis Pynkin <denis.pynkin at collabora.com>
Date: Sat, 1 Jul 2017 16:55:09 +0300
Subject: [PATCH] Fix lxc-ubuntu template usage without qemu-debootstrap

In case if 'qemu-debootstrap' binary is not available then container
creation with 'lxc-ubuntu' template fail.

Signed-off-by: Denis Pynkin <denis.pynkin at collabora.com>
---
 templates/lxc-ubuntu.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
index 81d6b6ca2..5e8041a94 100644
--- a/templates/lxc-ubuntu.in
+++ b/templates/lxc-ubuntu.in
@@ -375,7 +375,7 @@ download_ubuntu()
     choose_container_proxy $cache/partial-$arch/ $arch
     # download a mini ubuntu into a cache
     echo "Downloading ubuntu $release minimal ..."
-    if [ -n "$(which qemu-debootstrap)" ]; then
+    if [ -n "$(which qemu-debootstrap 2>/dev/null || :)" ]; then
         qemu-debootstrap --verbose $debootstrap_parameters --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR
     else
         debootstrap --verbose $debootstrap_parameters --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR


More information about the lxc-devel mailing list