mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
lxc-ubuntu: Use dpkg --add-architecture
When a container has dpkg >= 1.16.2, use dpkg --add-architecture for multi-arch configuration on foreign architecture containers. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
add1d11833
commit
40f6ee0088
@ -469,8 +469,13 @@ post_process()
|
||||
|
||||
# If the container isn't running a native architecture, setup multiarch
|
||||
if [ -x "$(ls -1 ${rootfs}/usr/bin/qemu-*-static 2>/dev/null)" ]; then
|
||||
dpkg_version=$(chroot $rootfs dpkg-query -W -f='${Version}' dpkg)
|
||||
if chroot $rootfs dpkg --compare-versions $dpkg_version ge "1.16.2"; then
|
||||
chroot $rootfs dpkg --add-architecture ${hostarch}
|
||||
else
|
||||
mkdir -p ${rootfs}/etc/dpkg/dpkg.cfg.d
|
||||
echo "foreign-architecture ${hostarch}" > ${rootfs}/etc/dpkg/dpkg.cfg.d/lxc-multiarch
|
||||
fi
|
||||
|
||||
# Save existing value of MIRROR and SECURITY_MIRROR
|
||||
DEFAULT_MIRROR=$MIRROR
|
||||
|
Loading…
Reference in New Issue
Block a user