summaryrefslogtreecommitdiffstats
path: root/core/modules
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
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')
-rw-r--r--core/modules/vmware12/module.build12
-rw-r--r--core/modules/vmware16/module.build13
2 files changed, 25 insertions, 0 deletions
diff --git a/core/modules/vmware12/module.build b/core/modules/vmware12/module.build
index 0df2f17e..555341a0 100644
--- a/core/modules/vmware12/module.build
+++ b/core/modules/vmware12/module.build
@@ -110,6 +110,18 @@ build() {
exit 0
EOF
chmod +x "${MODULE_BUILD_DIR}/bin/gccw"
+ # 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"
chroot_run "${MODULE_BUILD_DIR}" <<-EOF
perror() {
echo "[ERROR ERROR] " "\$@" >&6
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() {