Source: linux
Version: 7.0~rc6
Severity: normal
Tags: patch
Under certain circumstances, `scripts/Makefile.modfinal` may need to call
`scripts/gen-btf.sh`, which is currently missing from `linux-kbuild` package.
Below is the relevant excerpt from `scripts/Makefile.modfinal`:
```
# Re-generate module BTFs if either module's .ko or vmlinux changed
%.ko: %.o %.mod.o .module-common.o $(ARCH_MODULE_LDS) $(and
$(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),$(objtree)/vmlinux) FORCE
+$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux)
ifdef CONFIG_DEBUG_INFO_BTF_MODULES
+$(if $(newer-prereqs),$(call cmd,btf_ko))
endif
+$(call cmd,check_tracepoint)
```
This for example causes Nvidia proprietary flavor modules to fail to build on
kernel versions 7.0~rcX:
> BTF [M] nvidia-drm.ko
> sh: 0: cannot open
> /usr/src/linux-headers-7.0+unreleased-common/scripts/gen-btf.sh: No such file
> make[4]: ***
> [/usr/src/linux-headers-7.0+unreleased-common/scripts/Makefile.modfinal:62:
> nvidia-drm.ko] Error 2
The attached patch includes `scripts/gen-btf.sh` into `linux-kbuild` package.
diff --git a/debian/rules.d/scripts/Makefile b/debian/rules.d/scripts/Makefile
index 0c1be41676..c0fd9722b7 100644
--- a/debian/rules.d/scripts/Makefile
+++ b/debian/rules.d/scripts/Makefile
@@ -19,6 +19,7 @@ SCRIPTS = \
checkversion.pl \
depmod.sh \
gcc-*.sh \
+ gen-btf.sh \
gen_initramfs_list.sh \
headers_install.sh \
kernel-doc.py \