]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
ubuntu: Tweak architecture support
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 26 Mar 2013 21:18:54 +0000 (17:18 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 27 Mar 2013 13:19:42 +0000 (09:19 -0400)
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>
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in

index 9ee8fb127ac66a0f618b90ffca3167bcce86b4d6..8673e4cbb824953283c61c489b21c6b961d64974 100644 (file)
@@ -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
 
index 39c5a1c4206b2b074282620e5d459a72cfc88281..f011633263066f7921c34e8c46f4bde66c01228d 100644 (file)
@@ -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