summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}