stefantalpalaru / gentoo-overlay

Gentoo overlay
GNU General Public License v2.0
43 stars 11 forks source link

app-emulation/vmware-modules build failure with kernel >=6.4.10, patch needed #127

Closed lourdas closed 1 year ago

lourdas commented 1 year ago

After upgrading today to 6.4.10, vmware-modules could not build because 6.4.10 introduced a new header file and by default is not included in vmnet. mkubecek committed a patch here: https://github.com/mkubecek/vmware-host-modules/commit/b75cd616cca0a4c9ff22124c4c91d218e64e6205

A temporary workaround is a small patch in user portage patches directory:

/etc/portage/patches/app-emulation/vmware-modules-17.0.2 # ls -l
total 12
4 drwxr-xr-x 2 root root 4096 Αυγ  12 10:31 ./
4 drwxr-xr-x 3 root root 4096 Αυγ  12 10:31 ../
4 -rw-r--r-- 1 root root  385 Αυγ  12 10:31 fix-6.4.10-breaks-vmnet-vmware-17.0.2.diff
/etc/portage/patches/app-emulation/vmware-modules-17.0.2 # cat fix-6.4.10-breaks-vmnet-vmware-17.0.2.diff
diff --git a/vmnet-only/bridge.c b/vmnet-only/bridge.c
index 2886be4..a498c32 100644
@@ -45,6 +45,13 @@
#include <net/tcp.h>
#include <net/ipv6.h>

+/* This fixes moving skb_gso_segment(skb, 0); to net/gso.h from kernel 6.4.10
+*  and later.
+*/
+#if LINUX_VERSION_CODE >= (6,4,10)
+#  include <net/gso.h>
+#endif
+
#ifdef CONFIG_NET_RADIO
#   include <linux/wireless.h>
#endif
stefantalpalaru commented 1 year ago

The upstream patch breaks compilation for older kernels: https://github.com/mkubecek/vmware-host-modules/issues/204#issuecomment-1675922892

I used a patch similar to yours instead:

diff -ur vmware-host-modules-efc76a69acebb66409af5f267c51ccc027e057e6.orig/vmnet-only/bridge.c vmware-host-modules-efc76a69acebb66409af5f267c51ccc027e057e6/vmnet-only/bridge.c
--- vmware-host-modules-efc76a69acebb66409af5f267c51ccc027e057e6.orig/vmnet-only/bridge.c   2023-02-17 09:50:22.000000000 +0100
+++ vmware-host-modules-efc76a69acebb66409af5f267c51ccc027e057e6/vmnet-only/bridge.c    2023-08-12 15:50:11.915654613 +0200
@@ -45,6 +45,13 @@
 #include <net/tcp.h>
 #include <net/ipv6.h>

+/* This fixes moving skb_gso_segment(skb, 0); to net/gso.h from kernel 6.4.10
+*  and later.
+*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 10)
+#  include <net/gso.h>
+#endif
+
 #ifdef CONFIG_NET_RADIO
 #   include <linux/wireless.h>
 #endif

Thank you for the bug report and please test the latest version of the "vmware-modules" package on 6.4.10.

lourdas commented 1 year ago

Yes, it builds fine, thanks for the excellent response!

lourdas commented 1 year ago

Maybe it's worth integrating the latest fixes from https://github.com/mkubecek/vmware-host-modules/commit/8b2d31498a8df9b1215f407c989b065953b73455

stefantalpalaru commented 1 year ago

If it's not broken, don't fix it.

We'll get those commits anyway, when upgrading for 6.5.