Re: [PATCH] klp-build: Add an option to set the livepatch module version
From: Miroslav Benes
Date: Wed Sep 30 2026 - 07:37:01 EST
On Wed, 30 Sep 2026, Dmitry Malkin wrote:
> Livepatch modules generated by klp-build do not contain MODULE_VERSION
> metadata. Add --module-version to identify a livepatch release
> independently of its module name.
>
> Append MODULE_VERSION() to the temporary copy of init.c when the option
> is supplied. Restrict the accepted characters so the value can be
> embedded safely in a C string literal. Leave the source template and
> default build behavior unchanged.
>
> For example:
>
> $ scripts/livepatch/klp-build --module-version=1.2.3 fix.patch
>
> The version can be read from the resulting module file without loading it:
>
> $ modinfo -F version livepatch-fix.ko
>
> The version is descriptive module metadata; it does not control
> livepatch replacement or compatibility.
>
> Signed-off-by: Dmitry Malkin <dma@xxxxxxxxxx>
thank you for the patch but MODULE_VERSION() is being removed from the
kernel [1]. build-id should be sufficient.
Miroslav
[1] https://lore.kernel.org/lkml/20260731-module_ver_remove-v2-0-c9163858f382@xxxxxxxxxxxxxxxxxxx/