From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 437AA1A2568; Thu, 6 Jun 2024 14:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683751; cv=none; b=WiPx0ChWKYfd1hQFCSjzSXvW25pFJzAqgSHsC504Y3M98br41ojECJoIBX2GqKlmQ8XCx/S481jsLE3NEp1mL00cuuAfwvkQILnhrOfZGh+npuHnl9zG+NI1aVOaKlZvLNXS3pcKEe0NRB1U8PfuVJs5nt4tCIA8FdtEO+Z0l0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683751; c=relaxed/simple; bh=ChOVSZ5VMTflUxNXaQlKyOaL2fD6oZVq6yeSDJ3MmU8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TDSHJhxDcB4fH+Od37QHHHenUBQk226w0GW7VUiucf5nhAjVTe1m6AZRd1t9xnmPyDpv/bxiZ5hVKDwiNXR1qP1graacEN0pJqVXTIRjCNJyzqdCcPxcKFpI38o4+3uSMKpBbGQrd7dmXuYB2MDTxr+4LCcW+T4EW9sy6nc581M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AoAI84zd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AoAI84zd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 256A0C32781; Thu, 6 Jun 2024 14:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683751; bh=ChOVSZ5VMTflUxNXaQlKyOaL2fD6oZVq6yeSDJ3MmU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AoAI84zddJcfRn5bpECM44jlsExaVoueahyLN9e+BgkFDmWvt2zxeSGEoNKGID8Wg z76AIw0ddWyZCypRVmq+Lw6ZxTAmV+2+mWY2C2+UQiA8s97b2fewERhxap8qKHb+HT UkSVT+Jrk1rYHSfqAELG+WmNjCTad+9zmxNor8AU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miguel Ojeda , Masahiro Yamada , Sasha Levin Subject: [PATCH 6.6 720/744] kheaders: use `command -v` to test for existence of `cpio` Date: Thu, 6 Jun 2024 16:06:32 +0200 Message-ID: <20240606131755.561073629@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131732.440653204@linuxfoundation.org> References: <20240606131732.440653204@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miguel Ojeda [ Upstream commit 6e58e0173507e506a5627741358bc770f220e356 ] 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 Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- kernel/gen_kheaders.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index 6d443ea22bb73..4ba5fd3d73ae2 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -14,7 +14,12 @@ include/ arch/$SRCARCH/include/ " -type cpio > /dev/null +if ! command -v cpio >/dev/null; then + echo >&2 "***" + echo >&2 "*** 'cpio' could not be found." + echo >&2 "***" + exit 1 +fi # Support incremental builds by skipping archive generation # if timestamps of files being archived are not changed. -- 2.43.0