From nobody Sun Feb 8 11:25:58 2026 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2B6D374173; Wed, 21 Jan 2026 18:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769019408; cv=none; b=VzqrVzetwHUyv8OFhCbuykLEUa2bJ7cCq4qA75v7IY80MPA7pZM+1d3L2rRqJdsqUx+fEdT77FHygUCEd+lCEP/tsE/Yn+YrWAQ6TJ8kOn7ozuDKPwIcedEujE6R9j0lLR84s7eI6ElbCwjV9lnK5WQ/9W1fAOiIjQUHVxciVbk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769019408; c=relaxed/simple; bh=EWJ+M2aurz/ZDVQ4cF0rmciL+eLNgTv9Y3fYeGkYLPs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nDijtqWq2/xSPHyXG7phgcZB88kGu2s8sQc5urhg5Py5Dyki80ICFq8IQ604szaczG2tgeMcw0VPu4N6OKyY99HPCRqoSP4YpISJKcNvSM8E6+5YyTa/ZExWmCcooy6CsEKV/cTU9PdW6OKXEI+5d01MkKlTRb/AsUPngChk7rk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=a6xoM53o; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="a6xoM53o" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769019402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GhqpgloiqR9YVGZDPWVRJeg0INhy+dJCnyzXd7L9Q0A=; b=a6xoM53oFEzdTTj2BjY8MAhMNh8fu59B6uIHTx+gBO5kaJAwDeLlZm1CGsqUhJknZBeOEt WLyhJwNfFIrrpXE+FuOPreklEMCkTzsCTg41CcVbBxG19K4collwN0UHmyxKnprgAVrp7s lI6I8cccS10NAKlsiRUZ9ER+ogw5maU= From: Ihor Solodrai To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau Cc: Gary Guo , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Nathan Chancellor , Nicolas Schier , bpf@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v1] scripts/gen-btf.sh: Use CONFIG_SHELL for execution Date: Wed, 21 Jan 2026 10:16:17 -0800 Message-ID: <20260121181617.820300-1-ihor.solodrai@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" 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+dxmSNoJAGb6xV89ffUCKXe5CJXovXZt22nv= 5iYFV5mw@mail.gmail.com/ Signed-off-by: Ihor Solodrai Reported-by: Gary Guo Suggested-by: Thomas Wei=C3=9Fschuh Tested-by: Gary Guo --- scripts/Makefile.modfinal | 2 +- scripts/gen-btf.sh | 8 ++++---- scripts/link-vmlinux.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal index 422c56dc878e..adcbcde16a07 100644 --- a/scripts/Makefile.modfinal +++ b/scripts/Makefile.modfinal @@ -43,7 +43,7 @@ quiet_cmd_btf_ko =3D BTF [M] $@ if [ ! -f $(objtree)/vmlinux ]; then \ printf "Skipping BTF generation for %s due to unavailability of vmlinux\= n" $@ 1>&2; \ else \ - $(srctree)/scripts/gen-btf.sh --btf_base $(objtree)/vmlinux $@; \ + $(CONFIG_SHELL) $(srctree)/scripts/gen-btf.sh --btf_base $(objtree)/vmli= nux $@; \ fi; =20 # Same as newer-prereqs, but allows to exclude specified extra dependencies diff --git a/scripts/gen-btf.sh b/scripts/gen-btf.sh index be21ccee3487..8ca96eb10a69 100755 --- a/scripts/gen-btf.sh +++ b/scripts/gen-btf.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2025 Meta Platforms, Inc. and affiliates. # @@ -81,7 +81,7 @@ gen_btf_data() =20 gen_btf_o() { - local btf_data=3D${ELF_FILE}.btf.o + btf_data=3D${ELF_FILE}.btf.o =20 # Create ${btf_data} which contains just .BTF section but no symbols. Add # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all @@ -107,11 +107,11 @@ embed_btf_data() ${OBJCOPY} --add-section .BTF=3D${ELF_FILE}.BTF ${ELF_FILE} =20 # a module might not have a .BTF_ids or .BTF.base section - local btf_base=3D"${ELF_FILE}.BTF.base" + btf_base=3D"${ELF_FILE}.BTF.base" if [ -f "${btf_base}" ]; then ${OBJCOPY} --add-section .BTF.base=3D${btf_base} ${ELF_FILE} fi - local btf_ids=3D"${ELF_FILE}.BTF_ids" + btf_ids=3D"${ELF_FILE}.BTF_ids" if [ -f "${btf_ids}" ]; then ${RESOLVE_BTFIDS} --patch_btfids ${btf_ids} ${ELF_FILE} fi diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 08cd8e25c65c..16d6a048e07c 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -206,7 +206,7 @@ fi =20 if is_enabled CONFIG_DEBUG_INFO_BTF; then info BTF .tmp_vmlinux1 - if ! ${srctree}/scripts/gen-btf.sh .tmp_vmlinux1; then + if ! ${CONFIG_SHELL} ${srctree}/scripts/gen-btf.sh .tmp_vmlinux1; then echo >&2 "Failed to generate BTF for vmlinux" echo >&2 "Try to disable CONFIG_DEBUG_INFO_BTF" exit 1 --=20 2.52.0