lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFTNNQLGB1CS.2HDOGB99S9ACP@garyguo.net>
Date: Tue, 20 Jan 2026 19:15:11 +0000
From: "Gary Guo" <gary@...yguo.net>
To: "Ihor Solodrai" <ihor.solodrai@...ux.dev>, "Gary Guo"
 <gary@...yguo.net>, "Alexei Starovoitov" <ast@...nel.org>, "Daniel
 Borkmann" <daniel@...earbox.net>, "Andrii Nakryiko" <andrii@...nel.org>,
 "Martin KaFai Lau" <martin.lau@...ux.dev>, "Eduard Zingerman"
 <eddyz87@...il.com>, "Song Liu" <song@...nel.org>, "Yonghong Song"
 <yonghong.song@...ux.dev>, "John Fastabend" <john.fastabend@...il.com>, "KP
 Singh" <kpsingh@...nel.org>, "Stanislav Fomichev" <sdf@...ichev.me>, "Hao
 Luo" <haoluo@...gle.com>, "Jiri Olsa" <jolsa@...nel.org>
Cc: <bpf@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scripts/gen-btf.sh: fix shebang for NixOS

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@...yguo.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@...yguo.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ