fix(dkms): install all modules on kernel autoinstall - #97
Open
Till0196 wants to merge 4 commits into
Open
Conversation
gen_dkms_dyn_conf.sh uses mod_build_loc_base='/kernel' to locate built modules in the MEDIA_INST_DIR tree. With the old path (updates/extra/media) the pattern never matched, so no modules were written to dkms_dyn.conf and only dvb-core.ko was installed. Fixes: tbsdtv#60
When a new kernel is installed, dkms autoinstall calls read_conf before the build runs. At that point dkms_dyn.conf does not yet exist, so only the fallback dvb-core entry is loaded and cached in last_mvka. After POST_BUILD generates the full dkms_dyn.conf, do_install hits the cache and never re-reads it, resulting in only dvb-core.ko being installed. Fix by maintaining a kernel-independent copy of dkms_dyn.conf (dkms_dyn_shared.conf). On the next kernel autoinstall the fallback is sourced before the build runs, so the cache is populated with the full module list from the start.
There was a problem hiding this comment.
Pull request overview
Fixes DKMS kernel autoinstall so that media-build installs the full set of media modules (not just dvb-core.ko) by ensuring a complete dynamic module list is available at autoinstall() time and by aligning install paths so module discovery works.
Changes:
- Update
v4l/Makefileinstall path to live under/kernel/...so module discovery matchesgen_dkms_dyn_conf.shexpectations. - Extend
gen_dkms_dyn_conf.shto optionally write a kernel-independent “shared” dynamic config copy for reuse on subsequent kernel autoinstalls. - Update
dkms.confto generate the shared config inPOST_BUILDand to source it as a fallback when the per-kernel config doesn’t exist yet.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
v4l/Makefile |
Adjusts module install base path to /kernel/drivers/media to support module discovery during DKMS install. |
gen_dkms_dyn_conf.sh |
Adds optional shared-conf output to preserve the full module list across kernel autoinstalls. |
dkms.conf |
Passes shared-conf path to POST_BUILD and sources shared conf as fallback during autoinstall. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Recognize --help after the 3rd positional argument and reject unexpected extra arguments instead of silently ignoring them - Ensure shared fallback directory exists (mkdir -p) and fail explicitly when the cp to the shared conf path fails, preventing silent stale-conf issues
- Simplify --help check for optional 4th arg (already handled by arg_check_help) - Use err_exit instead of exit_print for error consistency - Quote variables in dkms.conf [ -e ] and source commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the kernel is updated and DKMS autoinstalls
media-build, onlydvb-core.kois installed instead of all ~750 media modules.
Root cause
autoinstall()callsread_conf()before the build starts. At that pointdkms_dyn.confdoes not exist yet, so only the static fallback (dvb-core) iscached in
last_mvka. AfterPOST_BUILDrunsgen_dkms_dyn_conf.shandgenerates the full module list,
do_install()hits the cache and never re-readsthe conf — resulting in only
dvb-core.kobeing installed.A secondary issue (also reported in #60) is that
KDIR26inv4l/Makefilewas set to
updates/extra/media, whilegen_dkms_dyn_conf.shsearches under/lib/modules/<kernel>/kernel/. The path mismatch caused the script to find nomodules, producing an empty (or minimal)
dkms_dyn.conf.Fix
v4l/MakefileChange
KDIR26fromupdates/extra/mediatokernel/drivers/mediaso thatgen_dkms_dyn_conf.shcan locate the installed modules.gen_dkms_dyn_conf.shAfter generating the per-kernel
dkms_dyn.conf, copy it to akernel-independent
dkms_dyn_shared.conf(passed as an optional 4th argument).dkms.confWhen the per-kernel
dkms_dyn.confdoes not exist yet (i.e. at the start ofautoinstallbefore the build), fall back todkms_dyn_shared.conffrom thelast successful build. This gives
read_conf()the full module list before thebuild starts, so
do_install()installs all modules after the build completes.Testing
Verified on Ubuntu 6.8.0-107-generic:
dkms installinstalls all modules anddkms statusreportsinstalledwith no warnings.