Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp88551lqb; Tue, 28 May 2024 09:32:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPOQ9JRF8pUeucUcI8rZHGn4CL2ltgKXrf2/pXn6/KqxFvkM8o7+o/6s2dWUPArjhlNoLLa7Fo68JwWSengKHUbN8ecJLXjqELj3PBoA== X-Google-Smtp-Source: AGHT+IGbn1ImaKJAgxECK3cTbJBcSq6kixxWD622YhaiL1LP4cbbwRC09ImpttXAvG3Tyj2pEx9N X-Received: by 2002:a17:907:94cb:b0:a62:eab9:4be2 with SMTP id a640c23a62f3a-a62eab94d52mr489290466b.44.1716913937566; Tue, 28 May 2024 09:32:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716913937; cv=pass; d=google.com; s=arc-20160816; b=hJWmtw4LFWBP9DaYzHI9/owbfYgl9UyXfyiI5fLKykMWBvEv2E5ngiQ0hxiaQXSxts A5H5g2CA2t+prbvi5lLfXgvyHuVVQ4xqUP080OME79SwtdPGNpVAHHCRdQUkqjud1by4 5Q4rFoJfIwJybTh6riASlVy5BkIuAi6TY3RZvM8zX68FS/tnfQpqOzdmgm8FdktwwQ4k LtKrFUC/KM99OOBmr6Jd79mDmcY/jnh9fnDgyXt8wcBSvqHkQ6pTX3ridVtNWLaH8rZT i7WFBJJ4Yw4YEcGfqkLnUOXf2pTd6RXJ3ZBzRr2IpagwLIRnV0mA57CB7Ot/QwjhFh7Q Q9Pw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=OXh9UVXgH0LeWCuRHXdo2tFke1Mq8GtLAmT5qreUwdA=; fh=wnNshkGSWCBBowFp/8M7+L6/pEZvcYWxMGPUTAMzeYE=; b=c5xn1E3MnasWKXij5iLhkzO2T0X5KUdkLhFoSnpsq7NvN3PAH0J63TYb8IHPr0PNa6 YtDvgmNuApdnxcHyTVUsZ8x2oV/OUie8HRl8FY8bS5URsVayaKAUMugMIRbkLdXT4HcB 3pm6qfqPKEklwIlumjlhq6l48pI1O7lu4EmSvZG9WoVhaKRa3NGdgoxrFcrntMCjgEVB TMFiOCfPC/zFo8lAGy4yf6Zj3sMcAIrPnXC3AGRnUEHpSFFMcD2MTf96sUuurlDf+R8m hYyy8mmnvgn9efL30gNNkYoUac7RetEnOh2JspeuWaaO1NGF9E9/+0PuixjpiyfDJHJv J8pQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aMaKISZW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c800fc3si535332166b.114.2024.05.28.09.32.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 09:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aMaKISZW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4FD981F23CCC for ; Tue, 28 May 2024 16:32:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 401F717106A; Tue, 28 May 2024 16:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aMaKISZW" 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 594241DA4C; Tue, 28 May 2024 16:32:09 +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=1716913930; cv=none; b=ErL1ZCiC3Oo4e0914YQ0BsYTiZms19DWLS7HWVDkKfFY9a8txiQ3g8ZEDd4yGz44AP1n5oMa/fMqBmhw1PluC3oBwjlODMJMVkynUPSYAUumvCNfByNu0P24AybxPY0NczWenEWeec3BsS1u4eL39kDZ7GvVSkcjX8aaIv1oYHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716913930; c=relaxed/simple; bh=1o50xjb05Lg9GH8f5gPzgNxU6RvrcdP6/JkkfWVE8vY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RJ/cqHjUrz97amK5Sdp4WKgEfsshL8L2q/+AWUL3zqIugerlFJqxWS0d9bD7jXWtoYuKvuGS40s7ukc19zv7d0ZUUzo62LqtMo/RFYqa8h8A0RlbxZwfojyxA23beWSQhIxLjpiZL7oijKbgkmVNpdft0ydM3R0DkJt8vtDcNwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aMaKISZW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57CA2C3277B; Tue, 28 May 2024 16:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716913928; bh=1o50xjb05Lg9GH8f5gPzgNxU6RvrcdP6/JkkfWVE8vY=; h=From:To:Cc:Subject:Date:From; b=aMaKISZW9uXUDe4p1BPzBzP/ScskTBC8kXYmMTlIjFPrpSSVdSZqUJeTizFbjiVJ+ rg5FC08yiUQYiVGDx+bn60AiweejkNBDxGpRDDE3zw27CVwVYjX2NNbSf0KVOTbrmk ffWuDXhMOv3vrEKnidwFstJCNE2ig1/lYGY2l3pfPSFDYzRhTnbEcE3MqGxlatK+58 O0cd6Aab/tjH6bkBn5g6eCfIRL+jQ+q6d8BtL4Cm/ENydqwQGQifS8X3xdO75Mj1gh C5Bp3VBD1KlbORDap9wHAPtZyjXOv1YyoYK3Mw3zwDczlsX+mbI49wXMieUFVPZz7P pqiuKawB1ZXYg== From: Miguel Ojeda To: Masahiro Yamada Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Miguel Ojeda Subject: [PATCH] kheaders: use `command -v` to test for existence of `cpio` Date: Tue, 28 May 2024 18:31:50 +0200 Message-ID: <20240528163150.410706-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Miguel Ojeda --- 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 6d443ea22bb7..4ba5fd3d73ae 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. base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 -- 2.45.1