~serge-hallyn/ubuntu/quantal/lxc/lxc-user-ns

« back to all changes in this revision

Viewing changes to debian/patches/0090-lxc-ubuntu-use-dpkg-add-architecture

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn, Stéphane Graber, Serge Hallyn
  • Date: 2012-06-26 13:04:01 UTC
  • Revision ID: package-import@ubuntu.com-20120626130401-8tclzscid8u2lzxu
Tags: 0.8.0~rc1-4ubuntu17
[ Stéphane Graber ]
* 0090-lxc-ubuntu-use-dpkg-add-architecture: Update lxc-ubuntu
  template to use "dpkg --add-architecture" in containers running
  dpkg >= 1.16.2. (LP: #1017862)

[ Serge Hallyn ]
* 0091-introduce-container-hooks.patch: introduce container hooks at several
  points in the container life-cycle.
* Add copyright statement to lxc-aa-custom-profile
* Add debian/hooks/mountcgroups as an example (installed under
  /usr/share/lxc/hooks)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Use dpkg --add-architecture in lxc-ubuntu
 
2
 When a container has dpkg >= 1.16.2, use dpkg --add-architecture
 
3
 for multi-arch configuration on foreign architecture containers.
 
4
Author: Stéphane Graber <stgraber@ubuntu.com>
 
5
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1017862
 
6
 
 
7
---
 
8
Origin: vendor
 
9
Forwarded: no
 
10
 
 
11
--- lxc-0.8.0~rc1.orig/templates/lxc-ubuntu.in
 
12
+++ lxc-0.8.0~rc1/templates/lxc-ubuntu.in
 
13
@@ -474,8 +474,13 @@ post_process()
 
14
 
 
15
     # If the container isn't running a native architecture, setup multiarch
 
16
     if [ -x "$(ls -1 ${rootfs}/usr/bin/qemu-*-static 2>/dev/null)" ]; then
 
17
-        mkdir -p ${rootfs}/etc/dpkg/dpkg.cfg.d
 
18
-        echo "foreign-architecture ${hostarch}" > ${rootfs}/etc/dpkg/dpkg.cfg.d/lxc-multiarch
 
19
+        dpkg_version=$(chroot $rootfs dpkg-query -W -f='${Version}' dpkg)
 
20
+        if chroot $rootfs dpkg --compare-versions $dpkg_version ge "1.16.2"; then
 
21
+            chroot $rootfs dpkg --add-architecture ${hostarch}
 
22
+        else
 
23
+            mkdir -p ${rootfs}/etc/dpkg/dpkg.cfg.d
 
24
+            echo "foreign-architecture ${hostarch}" > ${rootfs}/etc/dpkg/dpkg.cfg.d/lxc-multiarch
 
25
+        fi
 
26
 
 
27
         # Save existing value of MIRROR and SECURITY_MIRROR
 
28
         DEFAULT_MIRROR=$MIRROR