diff options
author | Miguel Ojeda <ojeda@kernel.org> | 2024-05-28 18:31:50 +0200 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-05-30 01:13:20 +0900 |
commit | 6e58e0173507e506a5627741358bc770f220e356 (patch) | |
tree | 38b21421c5b973fc0c2147db8956f41d23daa543 /tools/testing/selftests/bpf/prog_tests/access_variable_array.c | |
parent | 3bd27a847a3a4827a948387cc8f0dbc9fa5931d5 (diff) |
kheaders: use `command -v` to test for existence of `cpio`
Commit 13e1df09284d ("kheaders: explicitly validate existence of cpio
command") added an explicit check for `cpio` using `type`.
However, `type` in `dash` (which is used in some popular distributions
and base images as the shell script runner) prints the missing message
to standard output, and thus no error is printed:
$ bash -c 'type missing >/dev/null'
bash: line 1: type: missing: not found
$ dash -c 'type missing >/dev/null'
$
For instance, this issue may be seen by loongarch builders, given its
defconfig enables CONFIG_IKHEADERS since commit 9cc1df421f00 ("LoongArch:
Update Loongson-3 default config file").
Therefore, use `command -v` instead to have consistent behavior, and
take the chance to provide a more explicit error.
Fixes: 13e1df09284d ("kheaders: explicitly validate existence of cpio command")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/access_variable_array.c')
0 files changed, 0 insertions, 0 deletions