On Thu, Jan 30, 2014 at 11:21:08AM -0500, Scott Moser wrote: > * ppc64el images now exist and generally function. > Instead of failing because an arch isnt in the list, > let that check happen by ability to download something. > * update the hard coded ubuntu releases to know about 'trusty' > and drop no longer supported releases (consistent with behavior > when distro-info is available) > * shorten the logic that decides if host and container arch > are supported. > * support skipping "invalid arch" check entirely via undocumented > variable UCTEMPLATE_SKIP_ARCH_CHECK. > * update usage to reference 'tryreleased' as the default 'stream' > * give good error message if user tries 'released' and there > is no released version available. > > Signed-off-by: Scott Moser <[email protected]>
Acked-by: Stéphane Graber <[email protected]> As discussed, I'll push a follow-up commit that adds the remaining logic for arm64/armel/armhf: | host arch | arm64 | armhf | armel | ------------------------------------- | arm64 | X | X | X | (although optional, all existing silicon supports 32bit instructions) | armhf | | X | X | (just a userspace difference, so both work) | armel | | X | X | (not always true as armv6 will run armel but not armhf, however that's true of all supported platforms) ------------------------------------- > --- > templates/lxc-ubuntu-cloud.in | 43 > ++++++++++++++++--------------------------- > 1 file changed, 16 insertions(+), 27 deletions(-) > > diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in > index 42ee563..3e4c600 100644 > --- a/templates/lxc-ubuntu-cloud.in > +++ b/templates/lxc-ubuntu-cloud.in > @@ -25,6 +25,8 @@ STATE_DIR="@LOCALSTATEDIR@" > HOOK_DIR="@LXCHOOKDIR@" > CLONE_HOOK_FN="$HOOK_DIR/ubuntu-cloud-prep" > LXC_TEMPLATE_CONFIG="@LXCTEMPLATECONFIG@" > +KNOWN_RELEASES="lucid precise quantal saucy trusty" > +skip_arch_check=${UCTEMPLATE_SKIP_ARCH_CHECK:-0} > > if [ -r /etc/default/lxc ]; then > . /etc/default/lxc > @@ -136,7 +138,7 @@ Generic Options > [ -a | --arch ]: Architecture of container, defaults to host architecture > [ -T | --tarball ]: Location of tarball > [ -d | --debug ]: Run with 'set -x' to debug errors > -[ -s | --stream]: Use specified stream rather than 'released' > +[ -s | --stream]: Use specified stream rather than 'tryreleased' > > Additionally, clone hooks can be passed through (ie, --userdata). For those, > see: > @@ -158,7 +160,7 @@ release=precise > if [ -f /etc/lsb-release ]; then > . /etc/lsb-release > rels=$(ubuntu-distro-info --supported 2>/dev/null) || > - rels="lucid natty oneiric precise quantal raring saucy" > + rels="$KNOWN_RELEASES" > for r in $rels; do > [ "$DISTRIB_CODENAME" = "$r" ] && release="$r" > done > @@ -226,30 +228,13 @@ if [ "$arch" = "i686" ]; then > arch=i386 > fi > > -if [ $arch != "i386" -a $arch != "amd64" -a $arch != "armhf" -a $arch != > "armel" ]; then > - echo "Only i386, amd64, armel and armhf are supported by the ubuntu > cloud template." > - exit 1 > -fi > - > -if [ $hostarch != "i386" -a $hostarch != "amd64" -a $hostarch != "armhf" -a > $hostarch != "armel" ]; then > - echo "Only i386, amd64, armel and armhf are supported as host." > - exit 1 > -fi > - > -if [ $hostarch = "amd64" -a $arch != "amd64" -a $arch != "i386" ]; then > - echo "can't create $arch container on $hostarch" > - exit 1 > -fi > - > -if [ $hostarch = "i386" -a $arch != "i386" ]; then > - echo "can't create $arch container on $hostarch" > - exit 1 > -fi > - > -if [ $hostarch = "armhf" -o $hostarch = "armel" ] && \ > - [ $arch != "armhf" -a $arch != "armel" ]; then > - echo "can't create $arch container on $hostarch" > - exit 1 > +if [ "$skip_arch_check" = "0" ]; then > + case "$hostarch:$arch" in > + $arch:$arch) : ;; # the host == container > + amd64:i386|arm*:arm*) :;; # supported "cross" > + *) echo "cannot create '$arch' container on hostarch '$hostarch'"; > + exit 1;; > + esac > fi > > if [ "$stream" != "daily" -a "$stream" != "released" -a "$stream" != > "tryreleased" ]; then > @@ -298,7 +283,11 @@ fi > if [ -n "$tarball" ]; then > url2="$tarball" > else > - url1=`ubuntu-cloudimg-query $release $stream $arch --format "%{url}\n"` > + if ! url1=`ubuntu-cloudimg-query $release $stream $arch --format > "%{url}\n"`; then > + echo "There is no download available for release=$release, > stream=$stream, arch=$arch" > + [ "$stream" = "daily" ] || echo "You may try with '--stream=daily'" > + exit > + fi > url2=`echo $url1 | sed -e 's/.tar.gz/-root\0/'` > fi > > -- > 1.9.rc1 > > _______________________________________________ > lxc-devel mailing list > [email protected] > http://lists.linuxcontainers.org/listinfo/lxc-devel -- Stéphane Graber Ubuntu developer http://www.ubuntu.com
signature.asc
Description: Digital signature
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
