From 19186dc045d0fe9abe751e46cbf8e6e9b567f4e3 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 7 Apr 2022 13:01:10 +0200 Subject: mbuto: Discard stdout and stderr from selftests install ...we don't want any of that in the output. Signed-off-by: Stefano Brivio --- mbuto | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mbuto b/mbuto index 2a55d1f..9a34b34 100755 --- a/mbuto +++ b/mbuto @@ -205,7 +205,7 @@ profile_kselftests() { KERNEL="$(cat include/config/kernel.release)" - ${MAKE} -C tools/testing/selftests/ install + ${MAKE} -C tools/testing/selftests/ install >/dev/null 2>&1 MODDIR="$(${REALPATH} .mbuto_mods)" ${RM} -rf "${MODDIR}" @@ -692,30 +692,30 @@ kmod_node() { kmod_add() { info "Adding kernel module ${1}" - IFS=' -' - for __f in $("${MODPROBE}" -S "${KERNEL}" -d "${MODDIR}" -q \ - --show-depends "${1}"); do - unset IFS + if [ -z "${MODDIR}" ]; then + __d_opt="" + __find_path="/lib/modules/${KERNEL}" + else + __d_opt="-d ${MODDIR}" + __find_path="${MODDIR}/lib/modules" + fi - # If a module is built-in, skip copy, but check if we need to - # add a device node for on-demand loading. - if [ -n "${__f%builtin *}" ]; then - __src="${__f##insmod }" - # Some modprobe implementations add one trailing space - __src="${__src%% *}" - __dst="${wd}${__src##${MODDIR}}" + for __t in $("${MODPROBE}" -S "${KERNEL}" -d "${__d_opt}" -q \ + --show-depends "$(${BASENAME} ${1})"); do + __t="$(${BASENAME} "${__t%*.ko}")" + if ${MODPROBE} -S "${KERNEL}" -d "${__d_opt}" -q \ + --show-depends "$(${BASENAME} "${__t}")"; then + __src="$(${FIND} ${__find_path} -name "${__t}.ko")" + __dst="${wd}/${__src##${MODDIR}}" if ! "${DIFF}" "${__src}" "${__dst}" 2>/dev/null; then "${MKDIR}" -p "$("${DIRNAME}" "${__dst}")" "${CP}" -a "${__src}" "${__dst}" fi + kmod_node "${1}" + elif [ -z "${__f%builtin *}" ]; then + kmod_node "${1}" fi - - kmod_node "${1}" - IFS=' -' done - unset IFS } # kmod_post() - Copy files for modprobe on target, run depmod -- cgit v1.2.3