* [PATCH] mbuto: Fix for kernel modules with additional extensions in filename
@ 2022-07-05 17:53 Stefano Brivio
2022-07-06 6:04 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Stefano Brivio @ 2022-07-05 17:53 UTC (permalink / raw)
To: passt-dev
[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]
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(a)gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
---
mbuto | 7 ++++---
1 file 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
--
@@ -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
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mbuto: Fix for kernel modules with additional extensions in filename
2022-07-05 17:53 [PATCH] mbuto: Fix for kernel modules with additional extensions in filename Stefano Brivio
@ 2022-07-06 6:04 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2022-07-06 6:04 UTC (permalink / raw)
To: passt-dev
[-- Attachment #1: Type: text/plain, Size: 2071 bytes --]
On Tue, Jul 05, 2022 at 07:53:32PM +0200, Stefano Brivio wrote:
> 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(a)gibson.dropbear.id.au>
> Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
This seems to do the trick: I'm now booting guests in the passt tests.
Running into other failures, but I don't think they're mbuto related.
Tested-by: David Gibson <david(a)gibson.dropbear.id.au>
> ---
> mbuto | 7 ++++---
> 1 file 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
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-06 6:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 17:53 [PATCH] mbuto: Fix for kernel modules with additional extensions in filename Stefano Brivio
2022-07-06 6:04 ` David Gibson
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).