Re: [PATCH v4 0/4] selftests/livepatch: build and run the tests outside the running kernel

From: Petr Mladek

Date: Mon Nov 23 2026 - 09:16:14 EST


On Tue 2026-11-10 11:10:46, Sasha Levin wrote:
> The livepatch selftests build their test modules against the running
> kernel and skip every test without its devel files, so they do not
> work when built for one kernel and run on another, as CI systems do.
> In KernelCI, 36 of 69 kselftest builds of mainline fail to compile the
> modules because the kernel lacks CONFIG_LIVEPATCH, and where the
> modules do build, the installed tests skip themselves.
>
> - Patch 1 skips the modules and tests when livepatch is not enabled.
> - Patch 2 lets "make clean" remove the modules without a kernel build
> directory.
> - Patch 3 builds the modules against the kernel in O= or KBUILD_OUTPUT.
> - Patch 4 runs the tests with the installed modules, without the devel
> files.
>
> Tested on x86_64 against kernels built with O= and in place, a kernel
> without livepatch and the Debian headers. The modules build and clean
> in every case, and the installed tests pass 8/8 in a VM without devel
> files, where they were all skipped before.

My only open problem is the "O=<kernel> KDIR=<kernel>" parameters
mentions in the commit message in the 2nd patch. They do not work
for me.

Otherwise, this patchset looks ready for linux-next.

I am going to push it (with removing the problematic parameters from
the commit message) by the end of this week unless anyone complains
in the meantime.

Best Regards,
Petr