livecd-rootfs/live-build/ubuntu-core/hooks/12-add-foreign-libc6.chroot
Steve Langasek 7ec8dd87ac Fix architecture handling in hooks. We know we're always being invoked
from a launchpad-buildd-like setup, which passes ARCH and SUBARCH in the
environment, because auto/config and auto/build both rely on this.  So
don't scatter dpkg --print-architecture calls throughout, especially
when many of these are not cross-build-aware.
2016-02-05 23:39:56 -08:00

22 lines
494 B
Bash

#!/bin/sh
set -ex
echo "I: Checking if we are amd64 and libc6:i386 should be installed"
if [ "$ARCH" = "amd64" ]; then
echo "I: Enabling i386 multiarch support on amd64"
dpkg --add-architecture i386
apt-get -y update
echo "I: Installing libc6:i386 in amd64 image"
apt-get -y install libc6:i386
echo "I: Removing /var/lib/apt/lists/*"
find /var/lib/apt/lists/ -type f | xargs rm -f
echo "I: Removing /var/cache/apt/*.bin"
rm -f /var/cache/apt/*.bin
fi