Some users like to put (roughly) emerge @module-rebuild into a /etc/kernel/postinst.d/ script so that it's re-run at each "make install". Bug 496262 is talking about a similar problem. I did a bit of testing and found that the kernel build/install environment is setting KERNELRELEASE which causes a problem in the nvidia Makefile. Would you consider an ebuild-level workaround like 'unset KERNELRELEASE'? You can reproduce the failure like: # KERNELRELEASE=foo emerge -1 nvidia-drivers And it fails like: * Preparing nvidia module make -j4 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' ARCH=x86_64 IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/usr/src/linux CC=x86_64-pc-linux-gnu-gcc NV_VERBOSE=1 module Makefile:19: /Kbuild: No such file or directory make: *** No rule to make target '/Kbuild'. Stop. I believe the failure is due to this section at the top of ${WORKDIR}/kernel/Makefile: # This makefile is read twice: when a user or nvidia-installer invokes # 'make', this file is read. It then invokes the Linux kernel's # Kbuild. Modern versions of Kbuild will then read the Kbuild file in # this directory. However, old versions of Kbuild will instead read # this Makefile. For backwards compatibility, when read by Kbuild # (recognized by KERNELRELEASE not being empty), do nothing but # include the Kbuild file in this directory. ifneq ($(KERNELRELEASE),) include $(src)/Kbuild else
I understand not wanting to do anything too hacky with the nvidia-drivers build, but it sure would be nice to be able to run this via kernel postinst.d. If it's not possible, I understand.
Shouldn't that rather get set/unset in linux-mod.eclass or alike?
Maybe, but this is quite specific to nvidia-drivers, no other builds are failing as far as I can see. I'll admit that I don't really understand the (script) logic, and why it takes that action based on $KERNELRELEASE being set
(In reply to Ben Kohler from comment #0) > * Preparing nvidia module > make -j4 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- > 'LDFLAGS=-m elf_x86_64' ARCH=x86_64 IGNORE_CC_MISMATCH=yes V=1 > SYSSRC=/usr/src/linux SYSOUT=/usr/src/linux CC=x86_64-pc-linux-gnu-gcc > NV_VERBOSE=1 module https://gitweb.gentoo.org/repo/gentoo.git/tree/x11-drivers/nvidia-drivers/nvidia-drivers-440.36.ebuild#n181
Considering we have USE=dist-kernel to cause module rebuilds now, I think we can bin this. If still have users really needing this, feel free to ping me.
Then again, do users want this with *-sources too?
(In reply to Ionen Wolkens from comment #6) > Then again, do users want this with *-sources too? Hmm, well actually, since this still happen I'll have a look later.
Well, tried but KERNELRELEASE was just the tip of the iceberg -- getting past that just raises more issues with environment pollution (I should've known already). If someone really want to do this, try something like: env -i bash -c '. /etc/profile; emerge -1 nvidia-drivers' Not that I recommended it.