[v26.03.4] Fix ./configure in DKMS - #1794
Merged
robertbaldyga merged 4 commits intoAug 24, 2026
Merged
Conversation
'./configure' always probed the running kernel, which is wrong whenever the modules are built for a different one. Add '--kernel-dir' to point it at an explicit kernel, and describe it (and the config file argument) in a new '--help' message. The kernel is now taken solely from that option, falling back to the running kernel. Reading KERNEL_DIR from the environment as well would leave two ways of saying the same thing, so the RPM spec is updated to pass the directory it exports for 'make' to './configure' too. The CONFIG_UNWINDER_ORC check reads its .config from the selected kernel directory as well; it searched /usr/src/ for a directory named after the running kernel, which would have had './configure' probe one kernel and inspect another one's configuration. Signed-off-by: Aram Akhavan <1147328+kaysond@users.noreply.github.com> Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
The CONFIG_UNWINDER_ORC check reads the kernel's .config, but header packages of some distributions ship none, so the check was skipped and the user was left with the "unable to find kernel config" warning on a perfectly usable kernel directory. Such packages still carry the resolved configuration in include/config/auto.conf, so read that when there is no .config. Signed-off-by: Aram Akhavan <1147328+kaysond@users.noreply.github.com> Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
DKMS builds the modules for every installed kernel, but PRE_BUILD ran a bare './configure', which probed the running kernel. On any kernel other than the running one the generated header described the wrong kernel API, so the build either failed or produced modules compiled against mismatched definitions. Pass the kernel DKMS is building for to './configure', and pass the same directory to 'make' so both halves of the build agree on it. Fixes Open-CAS#1772 Signed-off-by: Aram Akhavan <1147328+kaysond@users.noreply.github.com> Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
… one Nothing tied generated_defines.h to the kernel it was generated for, so running './configure' for one kernel and 'make' for another silently compiled the modules against an API description that does not match the kernel headers in use, failing with unrelated-looking compiler errors. Record the probed kernel in config.out and carry it over into generated_defines.h as CAS_CONFIGURED_KERNEL_DIR. Keeping it in the config file rather than a stamp of its own means a header generated from a saved config states the kernel too, and keeping it in the header means 'make' needs to know nothing about where the config lives. modules/Makefile now compares it with the kernel it is about to build against and stops with an explanation if the two differ. Headers generated before this change carry no such define and are built as before. Signed-off-by: Aram Akhavan <1147328+kaysond@users.noreply.github.com> Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
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.
No description provided.