diff options
-rwxr-xr-x | mbuto | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -48,10 +48,13 @@ COPIES="${COPIES:-}" # Workers for time-consuming tasks such as stripping modules, see workers() THREADS="$(nproc)" -# Fix-up script to run before /init, can be omitted +# Fix-up script to run before /init, can be omitted. Note that we're adding +# /usr/libexec to PATH because, while a given program might not be intended to +# directly run on the host (that's what /usr/libexec is for), we might need to +# run it directly on the guest instead. [ -z "${FIXUP}" ] && FIXUP='#!/bin/sh -export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin: +export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin:/usr/libexec: mount -t proc proc /proc mount -t sysfs sys /sys @@ -752,14 +755,7 @@ prog_add() { unset IFS [ -z "${__bin}" ] && err "Can't source ${1}" - # Binaries in /usr/libexec are meant to run on other hosts only, so they - # can't reside in /usr/libexec on the target image. Move to /usr/bin. - if [ "$("${DIRNAME}" "${__bin}")" = "/usr/libexec" ]; then - __bindir="${wd}/usr/bin" - else - __bindir="${wd}$("${DIRNAME}" "${__bin}")" - fi - + __bindir="${wd}$("${DIRNAME}" "${__bin}")" "${MKDIR}" -p "${__bindir}" "${CP}" --preserve=all "${__bin}" "${__bindir}" |