Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ubuntu: Tweak architecture support

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@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information...
commit 8a63c0a9d9089e6365e5a696455476febed39d6a 1 parent 9a42db4
@stgraber stgraber authored
Showing with 34 additions and 7 deletions.
  1. +21 −5 templates/lxc-ubuntu-cloud.in
  2. +13 −2 templates/lxc-ubuntu.in
View
26 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
View
15 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
Please sign in to comment.
Something went wrong with that request. Please try again.