From fe45029b4dfc02467f65825bb24f19b7c410dd07 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Fri, 5 Aug 2022 01:12:29 -0700 Subject: [PATCH] kpatch-build: fix KBUILD_MODNAME for OOT modules For consistency with what the kernel does (and what we already do for in-tree modules), if the file has any dashes ('-'), replace them with underscores in the objname (aka KBUILD_MODNAME). Fixes #1286. Signed-off-by: Josh Poimboeuf --- kpatch-build/kpatch-build | 1 + 1 file changed, 1 insertion(+) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 02504e6..296fa48 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -1100,6 +1100,7 @@ for i in $FILES; do SYMVERS_FILE="$BUILDDIR/Module.symvers" elif [[ "$(basename "$KOBJFILE")" = "$(basename "$OOT_MODULE")" ]]; then KOBJFILE_NAME="$(basename --suffix=.ko "$OOT_MODULE")" + KOBJFILE_NAME="${KOBJFILE_NAME//-/_}" KOBJFILE_PATH="$OOT_MODULE" SYMTAB="${TEMPDIR}/module/${KOBJFILE_NAME}.symtab" SYMVERS_FILE="$TEMPDIR/Module.symvers"