VMware and slackware 12.2/Slamd 12.2/linux
Having issues with VMware kernel modules on your linux (particularly slackware?) system? Read on…
This isn’t the first time I’ve had difficulty compiling vmware modules on my slackware system, and it would appear the issues I have are recurring, and aren’t limited to myself, which is why I’m writing up my experiences with them…
NOTE: After installing vmware, you can find tarballs for the various components in /usr/lib/vmware/modules/source. The ones we care about are vmblock, vmci, vmnet, vmmon and vsock (all except vmppuser), as of 6.5.2.
Build issues fall into three categories:
- Lack of support for a kernel that’s too new.
- autoconf.h not on your system
- Makefile issues
This is understandable, since there are fairly frequent releases of the kernel, and when running at the level vmware is, maintaining compatibility with the latest and greatest can be difficult. I get that. Due to the work of the vmware-any-any patches and members of the vmware forums, these types of issues can be resolved fairly quickly, but the first place I start usually is googling for a patch for my version of vmware/my kernel. For example, I just made use of the patch and script available here: VMware 6.5.2 patch for kernel 2.6.29.
The build expects the file /usr/include/linux/autoconf.h to exist. This isn’t necessarily a bad thing–and I understand it has to make some assumptions; I have no data to assert this is a bad assumption. Regardless, this file didn’t exist on my system, which caused problems. You should be able to find this file in/usr/src/linux-`uname -r`/include/linux/autoconf.h . The simple solution is to either copy or symlink the file over into your /usr/include/linux directory. Note that nowhere will the VMware build process give you an error complaining that autoconf.h was expected yet doesn’t exist (so check that it does yourself!), however all kinds of build issues occur if you don’t have this file. I welcome someone with general knowledge of linux to give me some insight here, as I see no target from within the kernel that populates /usr/src/linux with autoconf.h — make headers_install doesn’t do it (you’ll find the Kbuild file within include/linux to have no mention of autoconf.h….), and am at a loss as to how this file is supposed to get there in the first place. For now, copying/symlinking does the trick though. To be clear, the command to symlink it is as follows:
ln -s /usr/src/linux-`uname -r`/include/linux/autoconf.h /usr/include/linux/
as root.
The issue here is the use of the vm_check_build macro. This macro is used in the Makefiles to determine what flags/defines are appropriate… the problem here is two-fold: a)because the route the errors produced here to /dev/null you can have errors that you aren’t even aware of, for example the autoconf.h issue mentioned above. Not that I’m suggesting the dump it all to stdout, since the build is a probe and so errors aren’t necessarily problematic. Anyway, this can mask errors that are causing more problems for you.
If you take a look at the Makefile.kernel you’ll find it references ‘vm_check_build’ a number of times, however– and here is where I scratch my head and wonder how this works on anyone’s system– that macro doesn’t get called when processing Makefile.kernel. You’ll notice that within ‘Makefile’ it defines vm_check_build, and later includes Makefile.kernel. Despite this, Makefile.kernel does /not/ see the vm_check_build, and accordingly fails every check–which probably isn’t what is the correct configuration for your system. The solution is to pop open Makefile.normal, and grab the two line definition of vm_check_build and put it near the top of Makefile.kernel:
vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
Note that to apply this change, you’ll have to extract each of the tarballs, make this change, and repackage them. A pain, yes.
In my experience, applying what’s need of the above three points gets me working vmware modules.
Due to copyright/legal issues I’m not posting my modified tars (I have no idea what the rules are about those, so playing it safe), but I’d be happy to help you build them if you’re having issues.
Here’s hoping this helps you out, let me know if it does or if your experience differs from mine.
Just to help people find this page when googling their build errors, the various one’s I got that were resolved with the above information are:
error: 'struct task_struct' has no member named followed by a number of fields. This seems to be a kernel support issue and is fixed by getting a proper patch (like the 2.6.29 one I mention above)
error: too many arguments to function 'smp_call_function' This one is fixed by fixing the definition of vm_check_build macro in Makefile.kernel, in combination with ensuring autoconf.h exists properly.
error: conflicting types for 'poll_initwait' This one is fixed in the same manner as the smp_call_function one directly above.