Commit 8a63c0a9 by Stéphane Graber

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: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 9a42db48
...@@ -166,7 +166,7 @@ else ...@@ -166,7 +166,7 @@ else
# precise and later; and are not supported by the query, so we don't actually # 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, # support them yet (see check later on). When Query2 is available,
# we'll use that to enable arm images. # we'll use that to enable arm images.
arch="armel" arch="armhf"
fi fi
fi fi
...@@ -206,13 +206,29 @@ if [ "$arch" == "i686" ]; then ...@@ -206,13 +206,29 @@ if [ "$arch" == "i686" ]; then
arch=i386 arch=i386
fi fi
if [ $hostarch = "i386" -a $arch = "amd64" ]; then if [ $arch != "i386" -a $arch != "amd64" -a $arch != "armhf" -a $arch != "armel" ]; then
echo "can't create amd64 container on i386" echo "Only i386, amd64, armel and armhf are supported by the ubuntu cloud template."
exit 1 exit 1
fi fi
if [ $arch != "i386" -a $arch != "amd64" ]; then if [ $hostarch != "i386" -a $hostarch != "amd64" -a $hostarch != "armhf" -a $hostarch != "armel" ]; then
echo "Only i386 and amd64 are supported by the ubuntu cloud template." 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 exit 1
fi fi
......
...@@ -617,7 +617,7 @@ else ...@@ -617,7 +617,7 @@ else
elif [ "$arch" = "x86_64" ]; then elif [ "$arch" = "x86_64" ]; then
arch="amd64" arch="amd64"
elif [ "$arch" = "armv7l" ]; then elif [ "$arch" = "armv7l" ]; then
arch="armel" arch="armhf"
fi fi
fi fi
...@@ -661,7 +661,18 @@ if [ "$arch" == "i686" ]; then ...@@ -661,7 +661,18 @@ if [ "$arch" == "i686" ]; then
fi fi
if [ $hostarch = "i386" -a $arch = "amd64" ]; then 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 exit 1
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment