Re: [PATCH v4 2/4] selftests/livepatch: clean the test modules without a kernel build directory

From: Petr Mladek

Date: Tue Nov 24 2026 - 06:04:32 EST


On Mon 2026-11-23 10:44:33, Sasha Levin wrote:
> On Mon, Nov 23, 2026 at 11:23:11AM +0100, Petr Mladek wrote:
> > The two parameters "O=<kernel> KDIR=<kernel>" do not make much sense
> > to me. The command starts compiling other selftests. I get:
> >
> > $> make -C tools/testing/selftests O=<kernel> KDIR=<kernel> TARGETS=livepatch
> > Makefile:4: *** Package alsa not found, please install alsa development package or add directory containing `alsa.pc` in PKG_CONFIG_PATH. Stop.
>
> Sorry, <kernel> was a placeholder for the kernel build directory. Pasted
> as is, the shell takes "<kernel>" as redirections, so make gets an empty
> O= and no TARGETS at all, and its output goes to a file named
> "TARGETS=livepatch". If that's what happened, that file and an empty
> "KDIR=" are now at the top of your tree.

I see. I have never used these parameters so I could not imagine
what the value would be :-)

> > Are these parameters really used by the KernelCI?
> > Could you please provide link to a build log?
>
> Yes. This is from Saturday's x86_64 build of mainline:
>
> make --silent --keep-going --jobs=8 O=/tmp/kci/kernel_build \
> INSTALL_PATH=/tmp/kci/kernel_build/kselftest_install \
> KDIR=/tmp/kci/kernel_build ARCH=x86_64 SRCARCH=x86 \
> CROSS_COMPILE=x86_64-linux-gnu- -C tools/testing/selftests all
>
> https://files.kernelci.org/kbuild-gcc-14-x86-kselftest-6b01150f99c74e1a99a2a261/build.log.gz
>
> > So, maybe just the sample command in the commit message is wrong.
>
> Yes, it should have used a real path:
>
> make -C tools/testing/selftests O=/tmp/build KDIR=/tmp/build TARGETS=livepatch

This works for me.

> Please keep O= and KDIR= in it, though. The paragraph is about modules
> built for a kernel other than the running one, and that's how they get
> built without this series.

OK. I'll use the variant with the real paths.

Best Regards,
Petr