After changes done to kernel setup using genkernel --menuconfig all rebuild of external modules (like nvidia) should be triggered.
The goal is to rebuild all needed modules everytime you do some stuff with your config or if you bump version so you are on safe side. Basically only added dep over sys-kernel/module-rebuild where module-rebuild is executed in proper phase would be great.
> Basically only added dep over sys-kernel/module-rebuild where module-rebuild is executed in proper phase would be great. Or use `emerge -1 @module-rebuild` and don't force an unnecessary dependency on users.
You can accomplish this by passing --callback='emerge @module-rebuild' to genkernel. With that said, this is something that I would genkernel to do automatically. The following patch would do it, but this will need some attention in the context of cross compilation before it can be merged. diff --git a/gen_compile.sh b/gen_compile.sh index aab2716..d25a307 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -309,6 +309,13 @@ compile_modules() { depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map ${KV} fi unset UNAME_MACHINE + + if [ $UID -eq 0 -a -f /var/lib/module-rebuild/moduledb -a $(wc -l < /var/lib/module-rebuild/moduledb) -gt 0 ] + then + print_info 1 " >> Compiling out-of-tree modules..." + emerge @module-rebuild 2>&1 >> ${LOGFILE} + fi + } compile_kernel() {
I had a chat with Robin Johnson about this. The plan to implement this is to make it an optional setting that is off by default. When it is enabled, it will only take effect when the root user runs genkernel.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=a3d49067e775c640a146514d68755dc0a4c6c613 commit a3d49067e775c640a146514d68755dc0a4c6c613 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-07-15 17:59:44 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-07-15 17:59:44 +0000 Add "--module-rebuild" parameter MODULEREBUILD option will be enabled by default. When enabled and we are building a non-static kernel for the same host (no cross-compile!), also building modules and install into into a non-custom location, we will now call `emerge @module-rebuild`. Closes: https://bugs.gentoo.org/453372 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> doc/genkernel.8.txt | 6 ++++++ gen_cmdline.sh | 7 +++++++ gen_compile.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ gen_determineargs.sh | 1 + genkernel | 1 + genkernel.conf | 6 +++++- 6 files changed, 73 insertions(+), 1 deletion(-)