aboutgitcode
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-07-05 19:47:41 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-07-06 19:48:38 +0200
commit18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d (patch)
tree32dbb3f8bbe3c62952746f465776c6218fdbc17f
parent69344047fb12d12c2698c7a33516e2e8ab7780d9 (diff)
downloadmbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.tar
mbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.tar.gz
mbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.tar.bz2
mbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.tar.lz
mbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.tar.xz
mbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.tar.zst
mbuto-18a0f1c1ebc9729980e5ab2cf323bf34d7ca780d.zip
mbuto: Fix for kernel modules with additional extensions in filename
David reports that on Fedora 36 mbuto fails to source the virtio_net module for the passt profile, because modules are compressed and they have a .ko.xz file extension. I tried this on Fedora Cloud Base 36-1.5 on x86_64, and mbuto actually locates the module, but it fails to parse the insmod commands from the dependencies as it expects a .ko at the end of any module file. I'm not sure that's the same issue David found, but start fixing this part at least. While at it: we're calling kmod_node always on the module name passed to kmod_add, instead of calling it for that module plus dependencies: fix this as well. Reported-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-xmbuto7
1 files changed, 4 insertions, 3 deletions
diff --git a/mbuto b/mbuto
index 693aaaa..4ffe549 100755
--- a/mbuto
+++ b/mbuto
@@ -868,11 +868,12 @@ kmod_add() {
;;
*)
for __t in ${__f}; do
- __t="$(${BASENAME} -- "${__t%*.ko}")"
+ __t="$(${BASENAME} -- "${__t}")"
+ __t="${__t%%.*}"
if ${MODPROBE} -S "${KERNEL}" -d "${__d_opt}" -q \
--show-depends -- "$(${BASENAME} -- "${__t}")" >/dev/null; then
- __src="$(${FIND} ${__find_path} -name "${__t}.ko")"
+ __src="$(${FIND} ${__find_path} -name "${__t}.*")"
[ -z "${__src}" ] && continue
__dst="${wd}${__src##${MODDIR}}"
@@ -881,7 +882,7 @@ kmod_add() {
"${CP}" -a "${__src}" "${__dst}"
fi
- kmod_node "${1}"
+ kmod_node "${__t}"
fi
done
esac