Skip to content

[v26.03.4] Fix ./configure in DKMS - #1794

Merged
robertbaldyga merged 4 commits into
Open-CAS:v26.03.4.rcfrom
robertbaldyga:v26.03.4-fix-dkms-configure
Aug 24, 2026
Merged

[v26.03.4] Fix ./configure in DKMS#1794
robertbaldyga merged 4 commits into
Open-CAS:v26.03.4.rcfrom
robertbaldyga:v26.03.4-fix-dkms-configure

Conversation

@robertbaldyga

Copy link
Copy Markdown
Member

No description provided.

'./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>
@robertbaldyga
robertbaldyga merged commit 8cee1bc into Open-CAS:v26.03.4.rc Aug 24, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants