mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Ihor Solodrai" <ihor.solodrai@linux.dev>,
	"Gary Guo" <gary@garyguo.net>,
	"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>
Cc: <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 19:15:11 +0000	[thread overview]
Message-ID: <DFTNNQLGB1CS.2HDOGB99S9ACP@garyguo.net> (raw)
In-Reply-To: <b53ee085-d9d2-4365-a5bc-d61e2bce97f8@linux.dev>

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.

Best,
Gary

>
> But I wonder if all of these need the same change then:
>
> $ git log --oneline -n1
> 24d479d26b25 (HEAD, tag: v6.19-rc6) Linux 6.19-rc6
> $ grep -r '#!/bin/bash' ./scripts/
> ./scripts/check-uapi.sh:#!/bin/bash
> ./scripts/decodecode:#!/bin/bash
> ./scripts/extract-fwblobs:#!/bin/bash
> ./scripts/gfp-translate:#!/bin/bash
> ./scripts/git-resolve.sh:#!/bin/bash
> ./scripts/mkuboot.sh:#!/bin/bash
> ./scripts/objdiff:#!/bin/bash
> ./scripts/objdump-func:#!/bin/bash
> ./scripts/prune-kernel:#!/bin/bash
> ./scripts/tags.sh:#!/bin/bash
> ./scripts/tracing/ftrace-bisect.sh:#!/bin/bash
> ./scripts/livepatch/klp-build:#!/bin/bash


  reply	other threads:[~2026-01-20 19:15 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 [this message]
2026-01-20 19:38     ` Thomas Weißschuh
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=DFTNNQLGB1CS.2HDOGB99S9ACP@garyguo.net \
    --to=gary@garyguo.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --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®