From dfad28ac247a2cb319de4cb3c91421344c3382d0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 10 Apr 2017 22:23:25 -0400 Subject: librechroot: Tidy up. --- src/chroot-tools/librechroot | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/chroot-tools') diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index cf564ed..90f364e 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -5,7 +5,7 @@ set -euE # Copyright (C) 2010-2012 Nicolás Reynolds # Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) # Copyright (C) 2012 Michał Masłowski -# Copyright (C) 2012-2016 Luke Shumaker +# Copyright (C) 2012-2017 Luke Shumaker # # License: GNU GPLv2+ # @@ -31,20 +31,19 @@ set -euE # - the case statement in main() that runs them . "$(librelib conf)" -load_files chroot - -. libremessages +. "$(librelib messages)" shopt -s nullglob umask 0022 +load_files chroot + ################################################################################ # Wrappers for files in ${pkglibexecdir}/chroot/ # ################################################################################ readonly _arch_nspawn="$(librelib chroot/arch-nspawn)" readonly _mkarchroot="$(librelib chroot/mkarchroot)" -readonly _makechrootpkg="$(librelib chroot/makechrootpkg.sh)" arch_nspawn_flags=() sysd_nspawn_flags=() @@ -71,7 +70,7 @@ hack_arch_nspawn_flags() { CARCH="$(uname -m)" fi - if [[ "$CARCH" == armv7h ]] && ! setarch armv7l 2>/dev/null; then + if [[ "$CARCH" == armv7h ]] && ! setarch armv7l /bin/true 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 @@ -80,9 +79,11 @@ hack_arch_nspawn_flags() { -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 + 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 return 1 fi -- cgit v1.2.2