diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-01-02 11:36:25 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-01-02 11:47:17 -0500 |
commit | 8edfe171876c23cd5322fc103e4ab91489710dae (patch) | |
tree | 825130d83b71f53cac6c976197dced733267b3e3 /src | |
parent | ed3d53fb876af4489b1dec17bf9bf5c01e4adab9 (diff) |
librechroot: Update binfmt_misc check for qemu-user-static-binfmt
Diffstat (limited to 'src')
-rwxr-xr-x | src/chroot-tools/librechroot | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index ad052b4..1667d98 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -5,7 +5,7 @@ set -euE # Copyright (C) 2010-2012 Nicolás Reynolds <fauno@parabola.nu> # Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> # Copyright (C) 2012 Michał Masłowski <mtjm@mtjm.eu> -# Copyright (C) 2012-2017 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (C) 2012-2018 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv2+ # @@ -73,16 +73,17 @@ hack_arch_nspawn_flags() { # We're running an ARM chroot on a non-ARM processor # Make sure that qemu-static is set up with binfmt_misc - if [[ $(grep -c -xF \ - -e 'enabled' \ + if [[ -z $(grep -l -xF \ -e 'interpreter /usr/bin/qemu-arm-static' \ - /proc/sys/fs/binfmt_misc/arm 2>/dev/null) -lt 2 ]]; then + -r -- /proc/sys/fs/binfmt_misc 2>/dev/null \ + | xargs -r grep -xF 'enabled') ]] + then error 'Cannot cross-compile for ARM on x86' plain 'This requires a binfmt_misc entry for qemu-arm-static.' prose 'Such a binfmt_misc entry is provided by the %s package. If you have it installed, but still see this message, you may need to restart %s.' \ - binfmt-qemu-static systemd-binfmt.service + qemu-user-static-binfmt systemd-binfmt.service return $EXIT_NOTINSTALLED fi |