[lxc-devel] [PATCH] ubuntu/ubuntu-cloud: Add support for arm64 and ppc64el [V2]

Stéphane Graber stgraber at ubuntu.com
Tue Jan 28 18:01:17 UTC 2014


Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 templates/lxc-ubuntu-cloud.in | 17 +++++++++++++----
 templates/lxc-ubuntu.in       | 13 +++++++++++--
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in
index 42ee563..0ef5920 100644
--- a/templates/lxc-ubuntu-cloud.in
+++ b/templates/lxc-ubuntu-cloud.in
@@ -181,6 +181,10 @@ else
         # support them yet (see check later on).  When Query2 is available,
         # we'll use that to enable arm images.
         arch="armhf"
+    elif [ "$arch" = "aarch64" ]; then
+        arch="arm64"
+    elif [ "$arch" = "ppc64le" ]; then
+        arch="ppc64el"
     fi
 fi
 
@@ -226,16 +230,22 @@ if [ "$arch" = "i686" ]; then
     arch=i386
 fi
 
-if [ $arch != "i386" -a $arch != "amd64" -a $arch != "armhf" -a $arch != "armel" ]; then
+if [ $arch != "i386" -a $arch != "amd64" -a $arch != "armhf" -a $arch != "armel" -a $arch != "arm64" -a $arch != "ppc64el" ]; 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
+if [ $hostarch != "i386" -a $hostarch != "amd64" -a $hostarch != "armhf" -a $hostarch != "armel" -a $hostarch != "arm64" -a $hostarch != "ppc64el" ]; then
     echo "Only i386, amd64, armel and armhf are supported as host."
     exit 1
 fi
 
+if [ $hostarch = "armhf" -o $hostarch = "armel" -o $hostarch = "arm64" ] && \
+   [ $arch != "armhf" -a $arch != "armel" -a $arch != "arm64" ]; then
+    echo "can't create $arch container on $hostarch"
+    exit 1
+fi
+
 if [ $hostarch = "amd64" -a $arch != "amd64" -a $arch != "i386" ]; then
     echo "can't create $arch container on $hostarch"
     exit 1
@@ -246,8 +256,7 @@ if [ $hostarch = "i386" -a $arch != "i386" ]; then
     exit 1
 fi
 
-if [ $hostarch = "armhf" -o $hostarch = "armel" ] && \
-   [ $arch != "armhf" -a $arch != "armel" ]; then
+if [ $arch = "arm64" ] && [ $hostarch != "arm64" ]; 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 74d6eb4..88e7c9c 100644
--- a/templates/lxc-ubuntu.in
+++ b/templates/lxc-ubuntu.in
@@ -658,6 +658,10 @@ else
         arch="amd64"
     elif [ "$arch" = "armv7l" ]; then
         arch="armhf"
+    elif [ "$arch" = "aarch64" ]; then
+        arch="arm64"
+    elif [ "$arch" = "ppc64le" ]; then
+        arch="ppc64el"
     fi
 fi
 
@@ -712,8 +716,13 @@ if [ $hostarch = "i386" -a $arch = "amd64" ]; then
     exit 1
 fi
 
-if [ $hostarch = "armhf" -o $hostarch = "armel" ] && \
-   [ $arch != "armhf" -a $arch != "armel" ]; then
+if [ $hostarch = "armhf" -o $hostarch = "armel" -o $hostarch = "arm64" ] && \
+   [ $arch != "armhf" -a $arch != "armel" -a $arch != "arm64" ]; then
+    echo "can't create $arch container on $hostarch"
+    exit 1
+fi
+
+if [ $arch = "arm64" ] && [ $hostarch != "arm64" ]; then
     echo "can't create $arch container on $hostarch"
     exit 1
 fi
-- 
1.8.5.3



More information about the lxc-devel mailing list