Closed realnc closed 4 years ago
Did you build a kernel in "/usr/src/linux"? Or at least did a make config
?
That whole fixdep part is not supposed to kick in at all. The process looks like this on my system:
>>> Compiling source in /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4 ...
* Preparing vmmon module
make -j9 -l9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' auto-build KERNEL_DIR=/usr/src/linux KBUILD_OUTPUT=/usr/src/linux
Using kernel build system.
make -C /usr/src/linux/include/.. M=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-5.4.11-gentoo'
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/linux/driverLog.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/linux/driver.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/linux/hostif.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/common/memtrack.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/common/apic.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/common/statVarsVmmon.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/common/vmx86.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/common/sharedAreaVmmon.o
CC [M] /var/tmp/portage/app-emulation/vmware-modules-15.5.1-r1/work/vmware-host-modules-w15.5.1-k5.4/vmmon-only/common/cpuid.o
Yes, I did build the kernel and also did make install & make modules_install
. And obviously eselect kernel set 2
prior to that.
However, I now know what's going on. You can't build vmware-modules while the new kernel is not booted. Normally,I build the new kernel, to the install
and module_install
, I then emerge @module-rebuild
and reboot. This always worked fine when upgrading from 4.19.x to 4.19.y. But with the new kernel being 5.4 while the running kernel is 4.19, it doesn't work in the case of vmware-modules. After I booted the 5.4 kernel, then emerging vmware-modules worked.
So we can close this, I guess, unless there's something that can be done about it in the ebuild?
You can't build vmware-modules while the new kernel is not booted.
That's unusual.
Normally,I build the new kernel, to the install and module_install, I then emerge @module-rebuild and reboot.
That's what I also do, and I never ran into this problem.
unless there's something that can be done about it in the ebuild?
I don't see what we can do in there, without understanding the root cause. Closing the issue, but feel free to comment if you discover some other clue.
Yay! I found the answer.
This bug appears when you're compiling vmware-modules for a 5.x kernel while you're still running a 4.x kernel (or lower).
The Makefiles in vmmon-only
and vmnet-only
subdirs define $VM_UNAME
as
VM_UNAME = $(shell uname -r)
$VM_UNAME
is used to select M=
for 5.x kernels, instead of SUBDIRS=
# Use SUBDIRS on 2.x, 3.x, 4.x. Use M on newer kernels.
ifeq ($(filter-out 2 3 4,$(firstword $(subst ., ,$(VM_UNAME)))),)
DIRVAR := SUBDIRS
else
DIRVAR := M
endif
When the running kernel version is 4.x or lower, the kernel build system uses the wrong variable, and the sandbox errors appear.
The following patch for the latest available ebuild fixes the bug.
--- vmware-modules-16.0.0.ebuild 2020-09-22 06:00:13.189601642 -0500
+++ vmware-modules-16.0.0.ebuild 2020-10-12 22:50:48.296361930 -0500
@@ -52,6 +52,7 @@
src_prepare() {
# decouple the kernel include dir from the running kernel version: https://github.com/stefantalpalaru/gentoo-overlay/issues/17
sed -i -e "s%HEADER_DIR = /lib/modules/\$(VM_UNAME)/build/include%HEADER_DIR = ${KERNEL_DIR}/include%" */Makefile || die "sed failed"
+ sed -i -e "s%VM_UNAME = \$(shell uname -r)%VM_UNAME = ${KV_FULL}%" */Makefile || die "sed failed"
# Allow user patches so they can support RC kernels and whatever else
default
Beautiful! Fix applied in 15.5.6-r3 and 16.0.0-r1.
I just upgraded my kernel from 4.19 to 5.4 (new LTS). Emerging vmware-modules-15.5.1-r1 fails with:
There's a lot more "ACCESS DENIED" errors. I tried to emerge with:
but this results in a different error: