On Tue, Feb 17, 2026 at 11:17:00AM -0500, Joe Lawrence wrote:
> Maybe I'm starting to see things, but when running 'S 2' builds, I keep
> getting "vmlinux.o: changed function: override_release".  It could be
> considered benign for quick development work, or confusing.  Seems easy
> enough to stash and avoid.
> 
> Repro:
> 
> Start with a clean source tree, setup some basic configs for klp-build:
> 
>   $ make clean && make mrproper
>   $ vng --kconfig
>   $ ./scripts/config --file .config \
>        --set-val CONFIG_FTRACE y \
>        --set-val CONFIG_KALLSYMS_ALL y \
>        --set-val CONFIG_FUNCTION_TRACER y \
>        --set-val CONFIG_DYNAMIC_FTRACE y \
>        --set-val CONFIG_DYNAMIC_DEBUG y \
>        --set-val CONFIG_LIVEPATCH y
>   $ make olddefconfig
> 
> Build the first patch, save klp-tmp/ (note the added DEBUG that dumps
> the localversion after assignment in set_kernelversion):
> 
>   $ ./scripts/livepatch/klp-build -T ~/cmdline-string.patch 
>   DEBUG: localversion=6.19.0-gc998cd490c02                           <<
>   Validating patch(es)
>   Building original kernel
>   Copying original object files
>   Fixing patch(es)
>   Building patched kernel
>   Copying patched object files
>   Diffing objects
>   vmlinux.o: changed function: cmdline_proc_show
>   BMuilding patch module: livepatch-cmdline-string.ko
>   SgUCCESS
>    c
> Buield a second patch, short-circuit to step 2 (build patched kernel):
> 
>   $ ./scripts/livepatch/klp-build -T -S 2 ~/cmdline-string.patch
>   DEBUG: localversion=6.19.0+                                        <<
>   Fixing patch(es)
>   Building patched kernel
>   Copying patched object files
>   Diffing objects
>   vmlinux.o: changed function: override_release                      <<
>   vmlinux.o: changed function: cmdline_proc_show
>   Building patch module: livepatch-cmdline-string.ko
>   SUCCESS

Hm, I wasn't able to recreate, but it's worrisome that two different
localversions are being reported.  How do we know which one is correct?

I'm also not sure why my original code is being so obtuse by
constructing the kernelrelease manually.  I can't remember if that's on
purpose or not.

The below would be simpler, I wonder if this also happens to fix the
issue?

diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
index 809e198a561d..792168c9e474 100755
--- a/scripts/livepatch/klp-build
+++ b/scripts/livepatch/klp-build
@@ -285,15 +285,14 @@ set_module_name() {
 # application from appending it with '+' due to a dirty git working tree.
 set_kernelversion() {
        local file="$SRC/scripts/setlocalversion"
-       local localversion
+       local kernelrelease
 
        stash_file "$file"
 
-       localversion="$(cd "$SRC" && make --no-print-directory kernelversion)"
-       localversion="$(cd "$SRC" && KERNELVERSION="$localversion" 
./scripts/setlocalversion)"
-       [[ -z "$localversion" ]] && die "setlocalversion failed"
+       kernelrelease="$(cd "$SRC" && make kernelrelease)"
+       [[ -z "$kernelrelease" ]] && die "setlocalversion failed"
 
-       sed -i "2i echo $localversion; exit 0" scripts/setlocalversion
+       sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion
 }
 
 get_patch_files() {

Reply via email to