summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-11 19:55:59 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-11 19:55:59 -0400
commit3c22e8bcfedf2c86880f0165b38093afacc52901 (patch)
tree4f627294214cbebcbd71dc80576e38e0e8787847 /src/chroot-tools
parent947597365598314ccb1246e94e730593feb2b6fe (diff)
librechroot: Don't use the host CacheDir for ARM chroots on x86 hosts.v20160511
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/librechroot12
1 files changed, 12 insertions, 0 deletions
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
}