diff options
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-x | src/chroot-tools/librechroot | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index cc416d5..e671814 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -71,7 +71,16 @@ hack_arch_nspawn_flags() { fi if [[ "$CARCH" == armv7h ]] && ! setarch armv7l 2>/dev/null; then - arch_nspawn_flags+=(-f /usr/bin/qemu-arm-static -s) + if grep -xF 'enabled' /proc/sys/fs/binfmt_misc/arm &>/dev/null \ + && grep -xF 'interpreter /usr/bin/qemu-arm-static' /proc/sys/fs/binfmt_misc/arm &>/dev/null; then + arch_nspawn_flags+=(-f /usr/bin/qemu-arm-static -s) + else + error 'Cannot cross-compile for ARM on x86' + plain 'This requires a binfmt_misc entry for qemu-arm-static,' + plain 'which is provided by the %s package.' binfmt-qemu-static + plain 'If you have this, you may need to restart %s.' systemd-binfmt.service + return 1 + fi fi } |