From: Vaidas Kascėnas Date: Thu, 24 Dec 2015 16:12:28 +0000 (+0200) Subject: Optional template parameter -v|--variant tells debootstrap which variant script to... X-Git-Tag: lxc-2.0.0.beta2~20^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d95ca97415af1f91e1e52d90032353f176d73ba;p=thirdparty%2Flxc.git Optional template parameter -v|--variant tells debootstrap which variant script to use. Signed-off-by: Vaidas Kascėnas --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index a3d240089..741ad7d10 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -343,6 +343,9 @@ download_ubuntu() fi packages_template="${packages_template},$(echo $langpacks | sed 's/ /,/g')" + if [ $variant == 'minbase' ]; then + packages_template="${packages_template},sudo,ifupdown,isc-dhcp-client" + fi echo "Installing packages in template: ${packages_template}" @@ -358,9 +361,9 @@ download_ubuntu() # download a mini ubuntu into a cache echo "Downloading ubuntu $release minimal ..." if [ -n "$(which qemu-debootstrap)" ]; then - qemu-debootstrap --verbose --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR + qemu-debootstrap --verbose $(if [ -n "$variant" ]; then echo --variant="$variant"; fi) --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR else - debootstrap --verbose --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR + debootstrap --verbose $(if [ -n "$variant" ]; then echo --variant="$variant"; fi) --components=main,universe --arch=$arch --include=${packages_template} $release $cache/partial-$arch $MIRROR fi if [ $? -ne 0 ]; then @@ -647,10 +650,11 @@ usage() { cat <] [-d|--debug] - [-F | --flush-cache] [-r|--release ] [ -S | --auth-key ] + [-F | --flush-cache] [-r|--release ] [-v|--variant] [ -S | --auth-key ] [--rootfs ] [--packages ] [-u|--user ] [--password ] [--mirror ] [--security-mirror ] release: the ubuntu release (e.g. precise): defaults to host release on ubuntu, otherwise uses latest LTS +variant: debootstrap variant to use (see debootstrap(8)) bindhome: bind 's home into the container The ubuntu user will not be created, and will have sudo access. @@ -662,7 +666,7 @@ EOF return 0 } -options=$(getopt -o a:b:hp:r:n:FS:du: -l arch:,bindhome:,help,path:,release:,name:,flush-cache,auth-key:,debug,rootfs:,packages:,user:,password:,mirror:,security-mirror: -- "$@") +options=$(getopt -o a:b:hp:r:v:n:FS:du: -l arch:,bindhome:,help,path:,release:,variant:,name:,flush-cache,auth-key:,debug,rootfs:,packages:,user:,password:,mirror:,security-mirror: -- "$@") if [ $? -ne 0 ]; then usage $(basename $0) exit 1 @@ -717,6 +721,7 @@ do --password) password=$2; shift 2;; -F|--flush-cache) flushcache=1; shift 1;; -r|--release) release=$2; shift 2;; + -v|--variant) variant=$2; shift 2;; --packages) packages=$2; shift 2;; -b|--bindhome) bindhome=$2; shift 2;; -a|--arch) arch=$2; shift 2;;