summaryrefslogtreecommitdiffstats
path: root/core/modules/vmware16
diff options
context:
space:
mode:
authorSimon Rettberg2021-10-15 14:04:06 +0200
committerSimon Rettberg2021-10-15 14:04:06 +0200
commitc69d24b89c35748f2f21ebc323e9eafffd9a4927 (patch)
treeefae7e1deef356d00ae1ab2eb73d50d9fe10f497 /core/modules/vmware16
parent[kernel-vanilla] 5.10.73 (diff)
downloadmltk-c69d24b89c35748f2f21ebc323e9eafffd9a4927.tar.gz
mltk-c69d24b89c35748f2f21ebc323e9eafffd9a4927.tar.xz
mltk-c69d24b89c35748f2f21ebc323e9eafffd9a4927.zip
[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. :-(
Diffstat (limited to 'core/modules/vmware16')
-rw-r--r--core/modules/vmware16/module.build13
1 files changed, 13 insertions, 0 deletions
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() {