mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Gary Guo <gary@garyguo.net>
Cc: Ihor Solodrai <ihor.solodrai@linux.dev>,
	 Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	 Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	 Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	 KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>,
	 Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>,
	bpf@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts/gen-btf.sh: fix shebang for NixOS
Date: Tue, 20 Jan 2026 20:38:59 +0100	[thread overview]
Message-ID: <ea83b91a-796c-4329-bcf5-2c49efa897fc@t-8ch.de> (raw)
In-Reply-To: <DFTNNQLGB1CS.2HDOGB99S9ACP@garyguo.net>

On 2026-01-20 19:15:11+0000, Gary Guo wrote:
> On Tue Jan 20, 2026 at 6:59 PM GMT, Ihor Solodrai wrote:
> > On 1/20/26 10:20 AM, Gary Guo wrote:
> >> From: Gary Guo <gary@garyguo.net>
> >> 
> >> NixOS only puts /usr/bin/env and /bin/sh at the standard location as
> >> required by POSIX, but not other shells. Other program that kernel build
> >> depends on is supplied via PATH, so shebang needs to use /usr/bin/env to
> >> find them.
> >> 
> >> This has been done to a few other scripts already, e.g.
> >> gen_test_kallsyms.sh or decode_stacktrace.sh.
> >> 
> >> Fixes: 522397d05e7d ("resolve_btfids: Change in-place update with raw binary output")
> >> Signed-off-by: Gary Guo <gary@garyguo.net>
> >> ---
> >>  scripts/gen-btf.sh | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/scripts/gen-btf.sh b/scripts/gen-btf.sh
> >> index be21ccee3487..4cd3159f2ddb 100755
> >> --- a/scripts/gen-btf.sh
> >> +++ b/scripts/gen-btf.sh
> >> @@ -1,4 +1,4 @@
> >> -#!/bin/bash
> >> +#!/usr/bin/env bash
> >>  # SPDX-License-Identifier: GPL-2.0
> >>  # Copyright (c) 2025 Meta Platforms, Inc. and affiliates.
> >>  #
> >> 
> >> base-commit: 053966c344dbd346e71305f530e91ea77916189f
> >
> > Hi Gary, thanks for the patch.
> >
> > I'm guessing this came up because gen-btf.sh is part of the vmlinux
> > build, and link-vmlinux.sh has #!/bin/sh (not bash).
> 
> My typical experience is that when I see an error about /bin/bash not found, I
> just use "bash <script path>" instead without putting much think into it.
> 
> gen-btf.sh is part of build so I don't get to invoke the script directly, hence
> the patch.

For the build we have $(CONFIG_SHELL) to stick before the script.
It is only 'sh', but it is the well-known variable users know to
override. IMO all script invocations should use this mechanism.


Thomas

  reply	other threads:[~2026-01-20 19:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 18:20 Gary Guo
2026-01-20 18:59 ` Ihor Solodrai
2026-01-20 19:15   ` Gary Guo
2026-01-20 19:38     ` Thomas Weißschuh [this message]
2026-01-20 19:53       ` Ihor Solodrai
2026-01-20 23:54         ` Gary Guo
2026-01-21  4:49           ` Ihor Solodrai
2026-01-21  4:52             ` Alexei Starovoitov
2026-01-21  5:04               ` Ihor Solodrai
2026-01-21 16:09                 ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea83b91a-796c-4329-bcf5-2c49efa897fc@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=gary@garyguo.net \
    --cc=haoluo@google.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®