Changelog: [seh] Don't take arch from environment

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
---
 templates/lxc-ubuntu.in |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
index e73baa8..0a55f4c 100644
--- a/templates/lxc-ubuntu.in
+++ b/templates/lxc-ubuntu.in
@@ -393,14 +393,24 @@ eval set -- "$options"
 release=lucid
 bindhome=
 arch=$(arch)
-trim_container=0
-if [ "$arch" == "x86_64" ]; then arch=amd64
-fi
 
-if [ "$arch" == "i686" ]; then
-    arch=i386
+# Code taken from debootstrap
+if [ -x /usr/bin/dpkg ] && /usr/bin/dpkg --print-architecture >/dev/null 2>&1; 
then
+    arch=`/usr/bin/dpkg --print-architecture`
+elif type udpkg >/dev/null 2>&1 && udpkg --print-architecture >/dev/null 2>&1; 
then
+    arch=`/usr/bin/udpkg --print-architecture`
+else
+    arch=$(arch)
+    if [ "$arch" = "i686" ]; then
+        arch="i386"
+    elif [ "$arch" = "x86_64" ]; then
+        arch="amd64"
+    elif [ "$arch" = "armv7l" ]; then
+        arch="armel"
+    fi
 fi
 
+trim_container=0
 hostarch=$arch
 while true
 do
-- 
1.7.4.1


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to