From c69d24b89c35748f2f21ebc323e9eafffd9a4927 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 15 Oct 2021 14:04:06 +0200 Subject: [vmware12/vmware16] patch to allow building for 5.x kernel on 4.x base Even though the vmware-modconfig utility has a -k switch for specifying a different kernel version to build the modules against, the internal Makefiles still calls uname -r to determine certain things about how to build the modules. :-( --- core/modules/vmware16/module.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/modules/vmware16') diff --git a/core/modules/vmware16/module.build b/core/modules/vmware16/module.build index c85754ad..c6626de0 100644 --- a/core/modules/vmware16/module.build +++ b/core/modules/vmware16/module.build @@ -79,6 +79,19 @@ build() { [ -z "${KERNEL_HEADERS_DIR}" -o ! -e "${KERNEL_HEADERS_DIR}" ] && perror "KERNEL_HEADERS_DIR ('"${KERNEL_HEADERS_DIR}"') not found. Was the kernel module built?" # build in two steps, to be able to use mltk function while patching modules + mkdir -p "${MODULE_BUILD_DIR}/usr/local/bin" + # This is required as there are still some uname calls in the Makefiles, EVEN THOUGH + # YOU SPECIFY ANOTHER KERNEL via -k below. Building will fail for a 5.x kernel if you + # run on a system with a 4.x kernel. + cat > "${MODULE_BUILD_DIR}/usr/local/bin/uname" <<-EOF + #!/bin/sh + if [ "\$1" = "-r" ]; then + echo '${TARGET_KERNEL_LONG}' + else + /bin/uname "\$@" || /usr/bin/uname "\$@" + fi + EOF + chmod +x "${MODULE_BUILD_DIR}/usr/local/bin/uname" pinfo "Installing vmware per chroot..." chroot_run "${MODULE_BUILD_DIR}" <<-EOF perror() { -- cgit v1.2.3-55-g7522