[Lxc-users] [PATCH 3/2] lxc-ubuntu template: set lxc.arch in config

Serge E. Hallyn serge at hallyn.com
Thu Jun 23 19:43:21 UTC 2011


Gah!  Wrong patch.  Here is the right one.  Sorry about that.

Subject: [PATCH 3/2] lxc-ubuntu template: set lxc.arch in config

Otherwise the container works fine, except uname -a reports x86_64,
not i686.

And unfortunately debootstrap and lxc.arch each accept only the
opposite of each other (i386 vs i686) :)

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 templates/lxc-ubuntu.in |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
index 0b68e84..92fff86 100644
--- a/templates/lxc-ubuntu.in
+++ b/templates/lxc-ubuntu.in
@@ -167,6 +167,11 @@ copy_configuration()
     path=$1
     rootfs=$2
     name=$3
+    arch=$4
+
+    if [ $arch = "i386" ]; then
+        arch="i686"
+    fi
 
     cat <<EOF >> $path/config
 lxc.utsname = $name
@@ -175,6 +180,7 @@ lxc.tty = 4
 lxc.pts = 1024
 lxc.rootfs = $rootfs
 lxc.mount  = $path/fstab
+lxc.arch = $arch
 
 lxc.cgroup.devices.deny = a
 # /dev/null and zero
@@ -418,6 +424,10 @@ do
     esac
 done
 
+if [ "$arch" == "i686" ]; then
+    arch=i386
+fi
+
 if [ ! -z "$clean" -a -z "$path" ]; then
     clean || exit 1
     exit 0
@@ -458,7 +468,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs $name
+copy_configuration $path $rootfs $name $arch
 if [ $? -ne 0 ]; then
     echo "failed write configuration file"
     exit 1
-- 
1.7.4.1





More information about the lxc-users mailing list