From 88753f7abfe702d2e2a1a4e3f3ed0f7c0a48415f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vaidas=20Kasc=C4=97nas?= Date: Wed, 6 Jan 2016 19:46:33 +0200 Subject: [PATCH] Update lxc-ubuntu.in MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Updated as per request in https://github.com/lxc/lxc/pull/740#discussion-diff-48759756 Signed-off-by: Vaidas Kascėnas vaidas@kascenas.lt --- templates/lxc-ubuntu.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 741ad7d10..9f2150ae5 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -332,6 +332,7 @@ download_ubuntu() release=$3 packages_template=${packages_template:-"ssh,vim"} + debootstrap_parameters= # Try to guess a list of langpacks to install langpacks="language-pack-en" @@ -343,7 +344,10 @@ download_ubuntu() fi packages_template="${packages_template},$(echo $langpacks | sed 's/ /,/g')" - if [ $variant == 'minbase' ]; then + if [ -n "$variant" ]; then + debootstrap_parameters="$debootstrap_parameters --variant=$variant" + fi + if [ $variant = 'minbase' ]; then packages_template="${packages_template},sudo,ifupdown,isc-dhcp-client" fi @@ -361,9 +365,9 @@ download_ubuntu() # download a mini ubuntu into a cache echo "Downloading ubuntu $release minimal ..." if [ -n "$(which qemu-debootstrap)" ]; then - qemu-debootstrap --verbose $(if [ -n "$variant" ]; then echo --variant="$variant"; fi) --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR + qemu-debootstrap --verbose $debootstrap_parameters --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR else - debootstrap --verbose $(if [ -n "$variant" ]; then echo --variant="$variant"; fi) --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR + debootstrap --verbose $debootstrap_parameters --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR fi if [ $? -ne 0 ]; then -- 2.47.3