[lxc-devel] [PATCH] ubuntu: Tweak architecture support
Serge Hallyn
serge.hallyn at ubuntu.com
Tue Mar 26 21:54:48 UTC 2013
Quoting Stéphane Graber (stgraber at ubuntu.com):
> This updates the various checks to match the grid below:
>
> == lxc-ubuntu support per architecture ==
> amd64: amd64, i386, armel, armhf, powerpc
> i386: i386, armel, armhf, powerpc
> armel: armel, armhf
> armhf: armhf, armel
> powerpc: powerpc
>
> == lxc-ubuntu-cloud support per architecture ==
> amd64: amd64, i386
> i386: i386
> armel: armel, armhf
> armhf: armhf, armel
>
> Note that most of the foreign architectures on x86 are supported
> through the use of qemu-user-static. This one however isn't yet
> support for cloud images (I'll send a patch for 1.0).
>
> Also, qemu-user-static is technically able to emulate amd64 on i386
> but qemu-debootstrap doesn't appear to know that and fails quite miserably.
>
> We may also want to add a test for amd64 kernel but i386 userspace, which
> is a valid combination that allows running an amd64 container on an i386
> host without requiring emulation, but that's for another patch.
>
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> templates/lxc-ubuntu-cloud.in | 26 +++++++++++++++++++++-----
> templates/lxc-ubuntu.in | 15 +++++++++++++--
> 2 files changed, 34 insertions(+), 7 deletions(-)
>
> diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in
> index 9ee8fb1..8673e4c 100644
> --- a/templates/lxc-ubuntu-cloud.in
> +++ b/templates/lxc-ubuntu-cloud.in
> @@ -166,7 +166,7 @@ else
> # precise and later; and are not supported by the query, so we don't actually
> # support them yet (see check later on). When Query2 is available,
> # we'll use that to enable arm images.
> - arch="armel"
> + arch="armhf"
> fi
> fi
>
> @@ -206,13 +206,29 @@ if [ "$arch" == "i686" ]; then
> arch=i386
> fi
>
> -if [ $hostarch = "i386" -a $arch = "amd64" ]; then
> - echo "can't create amd64 container on i386"
> +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 [ $arch != "i386" -a $arch != "amd64" ]; then
> - echo "Only i386 and amd64 are supported by the ubuntu cloud template."
> +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
> fi
>
> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
> index 39c5a1c..f011633 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -617,7 +617,7 @@ else
> elif [ "$arch" = "x86_64" ]; then
> arch="amd64"
> elif [ "$arch" = "armv7l" ]; then
> - arch="armel"
> + arch="armhf"
> fi
> fi
>
> @@ -661,7 +661,18 @@ if [ "$arch" == "i686" ]; then
> fi
>
> if [ $hostarch = "i386" -a $arch = "amd64" ]; then
> - echo "can't create amd64 container on i386"
> + 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
> +fi
> +
> +if [ $hostarch = "powerpc" -a $arch != "powerpc" ]; then
> + echo "can't create $arch container on $hostarch"
> exit 1
> fi
>
> --
> 1.8.1.2
>
>
> ------------------------------------------------------------------------------
> Own the Future-Intel® Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list