From 947597365598314ccb1246e94e730593feb2b6fe Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 11 May 2016 19:34:13 -0400 Subject: librechroot: tidy qemu-arm check --- src/chroot-tools/librechroot | 9 +++++---- 1 file 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 } -- cgit v1.2.3-54-g00ecf