• Masahiro Yamada's avatar
    kbuild: rpm-pkg: fix build error with CONFIG_MODULES=n · 8d1001f7
    Masahiro Yamada authored
    When CONFIG_MODULES is disabled, 'make (bin)rpm-pkg' fails:
    
      $ make allnoconfig binrpm-pkg
        [ snip ]
      error: File not found: .../linux/rpmbuild/BUILDROOT/kernel-6.10.0_rc3-1.i386/lib/modules/6.10.0-rc3/kernel
      error: File not found: .../linux/rpmbuild/BUILDROOT/kernel-6.10.0_rc3-1.i386/lib/modules/6.10.0-rc3/modules.order
    
    To make it work irrespective of CONFIG_MODULES, this commit specifies
    the directory path, /lib/modules/%{KERNELRELEASE}, instead of individual
    files.
    
    However, doing so would cause new warnings:
    
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.alias
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.alias.bin
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.builtin.alias.bin
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.builtin.bin
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.dep
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.dep.bin
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.devname
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.softdep
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.symbols
      warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.symbols.bin
    
    These files exist in /lib/modules/%{KERNELRELEASE} and are also explicitly
    marked as %ghost.
    
    Suppress depmod because depmod-generated files are not packaged.
    
    Fixes: 615b3a3d ("kbuild: rpm-pkg: do not include depmod-generated files")
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
    8d1001f7
kernel.spec 4.38 KB