Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 453372 - Genkernel should also rebuild external modules
Summary: Genkernel should also rebuild external modules
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard: How does this affect cross compilation?
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-01-21 16:26 UTC by Vit Pelcak
Modified: 2019-07-15 18:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vit Pelcak 2013-01-21 16:26:08 UTC
After changes done to kernel setup using genkernel --menuconfig all rebuild of external modules (like nvidia) should be triggered.
Comment 1 Tomáš Chvátal (RETIRED) gentoo-dev 2013-01-21 18:07:07 UTC
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.
Comment 2 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-01-21 19:05:25 UTC
> 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.
Comment 3 Richard Yao (RETIRED) gentoo-dev 2013-06-04 01:19:17 UTC
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() {
Comment 4 Richard Yao (RETIRED) gentoo-dev 2013-06-09 09:01:42 UTC
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.
Comment 5 Larry the Git Cow gentoo-dev 2019-07-15 18:06:23 UTC
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(-)