Skip to content

Commit

Permalink
Alternative test for dpkg multiarch support in lxc-debian template
Browse files Browse the repository at this point in the history
Signed-off-by: David Noyes <david.j.noyes@gmail.com>
  • Loading branch information
davidnoyes authored and stgraber committed Aug 28, 2015
1 parent 17ed245 commit 4633d67
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions templates/lxc-debian.in
Expand Up @@ -377,13 +377,9 @@ EOF

# If the container isn't running a native architecture, setup multiarch
if [ "${arch}" != "${hostarch}" ]; then
mkdir -p ${rootfs}/etc/dpkg/dpkg.cfg.d
echo "foreign-architecture ${hostarch}" > ${rootfs}/etc/dpkg/dpkg.cfg.d/lxc-multiarch

# Test if dpkg supports multiarch
if chroot $rootfs dpkg -l dpkg 2>&1 | grep -q "unknown option 'foreign-architecture'"; then
echo "dpkg does not support multiarch: removing multiarch configuration file"
rm ${rootfs}/etc/dpkg/dpkg.cfg.d/lxc-multiarch
if ! chroot $rootfs dpkg --print-foreign-architecture 2>&1; then
chroot $rootfs dpkg --add-architecture ${hostarch}
fi
fi

Expand Down

0 comments on commit 4633d67

Please sign in to comment.