From 3c22e8bcfedf2c86880f0165b38093afacc52901 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 11 May 2016 19:55:59 -0400 Subject: librechroot: Don't use the host CacheDir for ARM chroots on x86 hosts. --- src/chroot-tools/librechroot | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index a386861..4cf1d98 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -63,6 +63,7 @@ hack_arch_nspawn_flags() { esac done + # Detect the architecture of the chroot local CARCH if [[ -f "$makepkg_conf" ]]; then eval $(grep '^CARCH=' "$makepkg_conf") @@ -71,6 +72,9 @@ hack_arch_nspawn_flags() { fi if [[ "$CARCH" == armv7h ]] && ! setarch armv7l 2>/dev/null; then + # We're running an ARM chroot on a non-ARM processor + + # Make sure that qemu-static is set up with binfmt_misc if [[ $(grep -xF \ -e 'enabled'\ -e 'interpreter /usr/bin/qemu-arm-static' \ @@ -81,7 +85,15 @@ hack_arch_nspawn_flags() { plain 'If you have this, you may need to restart %s.' systemd-binfmt.service return 1 fi + + # Let qemu/binfmt_misc do its thing arch_nspawn_flags+=(-f /usr/bin/qemu-arm-static -s) + + # The -any packages are built separately for ARM from + # x86, so if we use the same CacheDir as the x86 host, + # then there will be PGP errors. + mkdir -p /var/cache/pacman/pkg-arm + arch_nspawn_flags+=(-c /var/cache/pacman/pkg-arm) fi } -- cgit v1.2.3-54-g00ecf