Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/gen-btf.sh: Use CONFIG_SHELL for execution

According to the docs [1], kernel build scripts should be executed via
CONFIG_SHELL, which is sh by default.

Fixup gen-btf.sh to be runnable with sh, and use CONFIG_SHELL at every
invocation site.

See relevant discussion for context [2].

[1] https://docs.kernel.org/kbuild/makefiles.html#script-invocation
[2] https://lore.kernel.org/bpf/CAADnVQ+dxmSNoJAGb6xV89ffUCKXe5CJXovXZt22nv5iYFV5mw@mail.gmail.com/

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Tested-by: Gary Guo <gary@garyguo.net>
Reported-by: Gary Guo <gary@garyguo.net>
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Fixes: 522397d05e7d ("resolve_btfids: Change in-place update with raw binary output")
Link: https://lore.kernel.org/r/20260121181617.820300-1-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Ihor Solodrai and committed by
Alexei Starovoitov
26ad5d6e d73cbe2c

+6 -6
+1 -1
scripts/Makefile.modfinal
··· 43 43 if [ ! -f $(objtree)/vmlinux ]; then \ 44 44 printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \ 45 45 else \ 46 - $(srctree)/scripts/gen-btf.sh --btf_base $(objtree)/vmlinux $@; \ 46 + $(CONFIG_SHELL) $(srctree)/scripts/gen-btf.sh --btf_base $(objtree)/vmlinux $@; \ 47 47 fi; 48 48 49 49 # Same as newer-prereqs, but allows to exclude specified extra dependencies
+4 -4
scripts/gen-btf.sh
··· 1 - #!/bin/bash 1 + #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # Copyright (c) 2025 Meta Platforms, Inc. and affiliates. 4 4 # ··· 81 81 82 82 gen_btf_o() 83 83 { 84 - local btf_data=${ELF_FILE}.btf.o 84 + btf_data=${ELF_FILE}.btf.o 85 85 86 86 # Create ${btf_data} which contains just .BTF section but no symbols. Add 87 87 # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all ··· 107 107 ${OBJCOPY} --add-section .BTF=${ELF_FILE}.BTF ${ELF_FILE} 108 108 109 109 # a module might not have a .BTF_ids or .BTF.base section 110 - local btf_base="${ELF_FILE}.BTF.base" 110 + btf_base="${ELF_FILE}.BTF.base" 111 111 if [ -f "${btf_base}" ]; then 112 112 ${OBJCOPY} --add-section .BTF.base=${btf_base} ${ELF_FILE} 113 113 fi 114 - local btf_ids="${ELF_FILE}.BTF_ids" 114 + btf_ids="${ELF_FILE}.BTF_ids" 115 115 if [ -f "${btf_ids}" ]; then 116 116 ${RESOLVE_BTFIDS} --patch_btfids ${btf_ids} ${ELF_FILE} 117 117 fi