• Miguel Ojeda's avatar
    kheaders: use `command -v` to test for existence of `cpio` · 6e58e017
    Miguel Ojeda authored
    Commit 13e1df09 ("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 9cc1df42 ("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: 13e1df09 ("kheaders: explicitly validate existence of cpio command")
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    6e58e017
gen_kheaders.sh 3.13 KB