Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Compiling module agains newer kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Sun Jan 26, 2020 6:56 pm    Post subject: [Solved] Compiling module agains newer kernel Reply with quote

How can I compile all the modules against a newer kernel (which is installed but not yet booted into)?
I'm on 5.4.12 but want to recompile nvidia and wireguard for 5.4.15, so that after reboot everything is ready and no need to @module-rebuild anything.
Code:
  [1]   linux-5.4.12-gentoo
  [2]   linux-5.4.15-gentoo *

Code:
ls /lib/modules/
5.4.10-gentoo
5.4.11-gentoo
5.4.12-gentoo
5.4.15-gentoo

Can I do that without modifying the .ebuild of a package?


Last edited by etnull on Tue Feb 04, 2020 8:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44945
Location: 56N 3W

PostPosted: Sun Jan 26, 2020 8:10 pm    Post subject: Reply with quote

etnull,

Out of kernel module build systems build against the kernel pointed to by /usr/src/linux

You point that to your built but not yet in use kernel and run
Code:
emerge @module-rebuild

Building against the running kernel is a fallback if /usr/src/linux is not set.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Sun Jan 26, 2020 9:36 pm    Post subject: Reply with quote

So before the reboot I do @module-rebuild and it builds against one which set in eselect kernel set? Hm, I think I tried that, or maybe not, I don't remember. I will try the next update, since now I did it the old way with two reboots.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Sun Jan 26, 2020 9:50 pm    Post subject: Reply with quote

etnull wrote:
So before the reboot I do @module-rebuild and it builds against one which set in eselect kernel set? Hm, I think I tried that, or maybe not, I don't remember. I will try the next update, since now I did it the old way with two reboots.


That certanly works for nvidia-drivers and virtuabox modules, though I usually just relink /usr/src/linux by hand. One thing though is that new kernel should be configured (not necessarily built, but .config file should be present), since many out of kenel modules check that necessary for the CONFIG parameters are set or unset.
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Fri Jan 31, 2020 10:27 am    Post subject: Reply with quote

It worked for wireguard modules, but failed for nvidia with this:
Code:
.......
In file included from /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-drm/nvidia-drm-drv.c:27:
/var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-drm/nvidia-drm-fb.h:30:10: fatal error: drm/drmP.h: No such file or directory
   30 | #include <drm/drmP.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:266: /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-drm/nvidia-drm-drv.o] Error 1
make[2]: *** Waiting for unfinished jobs....
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-drm/nvidia-drm.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_pmm_test.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_peer_identity_mappings_test.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_fault_buffer_flush_test.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-modeset/nv-kthread-q.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_mmu_test.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_va_block_test.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-modeset/nvidia-modeset-linux.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_thread_context_test.o
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline --uaccess /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel/nvidia-uvm/uvm8_range_group_tree_test.o
make[1]: *** [Makefile:1693: /var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-5.5.0-gentoo'
make: *** [Makefile:81: modules] Error 2
 * ERROR: x11-drivers/nvidia-drivers-440.44-r1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-440.44-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-440.44-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/kernel'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/work/'

>>> Failed to emerge x11-drivers/nvidia-drivers-440.44-r1, Log file:

>>>  '/var/tmp/portage/x11-drivers/nvidia-drivers-440.44-r1/temp/build.log'

 * Messages for package x11-drivers/nvidia-drivers-440.44-r1:

 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-5.5
 * <sys-kernel/vanilla-sources-5.5
 *
 * You are free to utilize eapply_user to provide whatever
 * support you feel is appropriate, but will not receive
 * support as a result of those changes.
 *
 * Do not file a bug report about this.
 *
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Fri Jan 31, 2020 10:48 am    Post subject: Reply with quote

This helped to rebuild https://forums.gentoo.org/viewtopic-t-1107536.html
didn't yet reboot, will do it later.

---

it worked
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum