summaryrefslogtreecommitdiff
path: root/src/chroot-tools/librechroot
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-11 19:34:13 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-11 19:34:13 -0400
commit947597365598314ccb1246e94e730593feb2b6fe (patch)
tree1b75fc6b31bfffe72cb93ad8334610cb2f20eb58 /src/chroot-tools/librechroot
parent0845d893d8ca1892d9e392e61cc90f4c7c76c983 (diff)
librechroot: tidy qemu-arm check
Diffstat (limited to 'src/chroot-tools/librechroot')
-rwxr-xr-xsrc/chroot-tools/librechroot9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index 7cfe125..a386861 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -71,16 +71,17 @@ hack_arch_nspawn_flags() {
fi
if [[ "$CARCH" == armv7h ]] && ! setarch armv7l 2>/dev/null; then
- 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
+ if [[ $(grep -xF \
+ -e 'enabled'\
+ -e 'interpreter /usr/bin/qemu-arm-static' \
+ /proc/sys/fs/binfmt_misc/arm 2>/dev/null |wc -l) -lt 2 ]]; then
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
+ arch_nspawn_flags+=(-f /usr/bin/qemu-arm-static -s)
fi
}