diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-04-28 17:45:07 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-04-29 14:26:24 +0200 |
commit | 5b6c16ab7c08335c3c99760e2228b2518686ff1f (patch) | |
tree | 09a8dc92b98cd669f80a2a2a63299bf819a59b0a | |
parent | 00d49371c00a3a7286896d064d0a6ed8c06755e6 (diff) | |
download | mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.tar mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.tar.gz mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.tar.bz2 mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.tar.lz mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.tar.xz mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.tar.zst mbuto-5b6c16ab7c08335c3c99760e2228b2518686ff1f.zip |
mbuto: kselftests: Skip modules that don't have a corresponding .ko file
This might happen e.g. if we find a 'builtin' token in a multi-line
modprobe output: the modprobe command will succeed, but that doesn't
necessarily correspond to a module file.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-x | mbuto | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -855,24 +855,29 @@ kmod_add() { __f=$("${MODPROBE}" -S "${KERNEL}" -d "${__d_opt}" -q \ --show-depends -- "$(${BASENAME} -- ${1})") + case ${__f} in - "builtin "*) - kmod_node "${1}" - ;; - *) - for __t in ${__f}; do - __t="$(${BASENAME} -- "${__t%*.ko}")" - if ${MODPROBE} -S "${KERNEL}" -d "${__d_opt}" -q \ - --show-depends -- "$(${BASENAME} -- "${__t}")" >/dev/null; 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}" + "builtin "*) + kmod_node "${1}" + ;; + *) + for __t in ${__f}; do + __t="$(${BASENAME} -- "${__t%*.ko}")" + if ${MODPROBE} -S "${KERNEL}" -d "${__d_opt}" -q \ + --show-depends -- "$(${BASENAME} -- "${__t}")" >/dev/null; then + + __src="$(${FIND} ${__find_path} -name "${__t}.ko")" + [ -z "${__src}" ] && continue + + __dst="${wd}${__src##${MODDIR}}" + if ! "${DIFF}" "${__src}" "${__dst}" 2>/dev/null; then + "${MKDIR}" -p "$("${DIRNAME}" "${__dst}")" + "${CP}" -a "${__src}" "${__dst}" fi - done + + kmod_node "${1}" + fi + done esac } |