On Mon, Mar 02, 2026 at 09:20:00PM -0500, Joe Lawrence wrote:
> I finally figured out why you couldn't reproduce, in my tests, I never
> built the original kernel, I jumped straight from a clean repo to
> starting up klp-build.  If I perform an initial make before running
> klp-build, then the sequence works as expected. 
> 
> - If skipping the initial vmlinux is an unsupported use-case, then we
>   can ignore and drop this patch,
> - or perhaps detect and warn/error out 
> - If this is something we need to support, then your suggested version
>   below didn't work out either...
> 
> The following change committed on top of v7.0-rc2:

Thanks, I was able to reproduce this and figure it out.  The problem is
that "make oldconfig" doesn't sync auto.conf, whereas a full make does.

So if you do "make kernelrelease" before the first build, it may be
wrong.

And apparently that's intentional:

  commit a29d4d8c5669a658b5a091b38205c13084967ce7
  Author: Masahiro Yamada <[email protected]>
  Date:   Fri Jul 20 16:46:35 2018 +0900
  
      kbuild: do not update config for 'make kernelrelease'
      
      'make kernelrelease' depends on CONFIG_LOCALVERSION(_AUTO), but
      for the same reason as install targets, we do not want to update
      the configuration just for printing the kernelrelease string.
      
      This is likely to happen when you compiled the kernel with
      CROSS_COMPILE, but forget to pass it to 'make kernelrelease'.
      
      Signed-off-by: Masahiro Yamada <[email protected]>
  
  diff --git a/Makefile b/Makefile
  index 8ca9e0b114f1..060874d85e0d 100644
  --- a/Makefile
  +++ b/Makefile
  @@ -225,7 +225,8 @@ no-dot-config-targets := $(clean-targets) \
                         cscope gtags TAGS tags help% %docs check% coccicheck \
                         $(version_h) headers_% archheaders archscripts \
                         kernelversion %src-pkg
  -no-sync-config-targets := $(no-dot-config-targets) install %install
  +no-sync-config-targets := $(no-dot-config-targets) install %install \
  +                        kernelrelease
   
   config-targets  := 0
   mixed-targets   := 0



So the fix is just to do "make syncconfig" before the "make
kernelrelease".  Let me write up a proper patch.

-- 
Josh

Reply via email to