From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796248934; b=Tw+F81Ve6Ddb6ioGdw/xo9Fy/ODkdkhURbiUoBTg/Evzm/PsXcmrmR5DJ0RxTOMSSyi+ K3XCRj1FG2vqH/D11XD0b3e2dVGIkyu6Cbr0/JoGAFNAawtwWCWX6LSX1JkDfoO7JMgI+ x9kIIipfvItQnpOz6GwVfrYvPhvVlB4HJaFEG1qqY1YZQcjZpS9wyX20tNqNFMQ7Ign4C 7xIMGF+2xNCw6O8EmcUcGdl1WhVnSJcNKLye5EKdCaiai+aCTo3YIhqjBC86MygDwa+gf jlqFcewqT9uiQ+2y9DJceO16WADnjc2AQq83JXcwSpIjqGml3olDZb9ZIF5cWEDFC9Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796248934; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=31/KfAhvn0ridtnJJeHsXKxL7hCCPRGOZ1JzBOWWxFw=; b=wn0cUpXd23gZS/AoSdjfkLZsRIW6M75ETfe/tbealffV3lzVDwbhTChEf9RI8QgfYiJ0 Omt5ui+mxnxEWYZzsrpHZVjDJ4f5bZLTE5Iy4Ioj8lKpDZo4jg3WVeIuOk6RQTKZ/dsr/ 7ck6jStgCmw01rGEibEcSwitSTJYdlKSSVsngmeX+cxwsGK1IF81mADIO/zF0jzQg1kiz ynPJXZb9l3S26465Q7sSESeT2aQwQEGIYmZLKHvcE0MgYEFTOgKMrNza++GlqgyBqaW5k a1VQkmji16TxEPbhDCwZ2L2qoCWARq1rXQFxHYVoCJ+zqdL5LhQdXcJOrrLzilx2aOA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AbLvjxL2; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0797606A322; Wed, 2 Dec 2026 22:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AbLvjxL2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89CE11F00893; Wed, 2 Dec 2026 22:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796248934; bh=31/KfAhvn0ridtnJJeHsXKxL7hCCPRGOZ1JzBOWWxFw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=AbLvjxL2KN2Ay4AyJu6ynVPqODQYbU1IuvvbkiGLkDBfIgdjk9v1OqPDFvevST/Rc 5+nzi/1Ns8EeD38HszdoxRncSuGWX5OXBRxoGGoMe9G1kr+B7RzXSlMtpTtI5bvqYk zt2PDCTCj8I9Yk+t95YtsVjmfTeNT5BDnoKafrwKo6PBlvunh7Q/RLzPULCoWvYzaW XIvHvVn4SU/4cd5NV0Ih5LnV1NmwPyFzrMmuTkKR9wfMWfmuTm+HtNAO1SYYGj7aCV eX1f8bR/J+ByMFmhB2PiYcsWEVW7asM6EUgbCuoihoggbBDkHz5iU0oAmlQCwyIcHw KcQc7K9Sp6f3g== Date: Wed, 2 Dec 2026 15:02:11 -0700 From: Nathan Chancellor To: Hamdy Abou El Anein Cc: nsc@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scripts: extract-vmlinux: return failure when extraction fails Message-ID: <20261202220211.GB2468262@ax162> References: <20261201221013.16216-1-info@daylightlinux.ch> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201221013.16216-1-info@daylightlinux.ch> On Tue, Dec 01, 2026 at 11:10:13PM +0100, Hamdy Abou El Anein wrote: > When none of the supported decompression methods yields a kernel > image, extract-vmlinux prints an error but returns the exit status > of echo, which is normally zero. Callers checking the exit status > can therefore mistake an unsuccessful extraction for success. > > Explicitly exit with status 1 after the error message, matching > extract-ikconfig's failure convention. Preserve status 2 for invalid > invocations and status 0 for successful extraction. > > Tested invalid raw and gzip-compressed input, missing and empty > input, and byte-for-byte extraction of raw, gzip and xz ELF fixtures. > > AI assistance: ChatGPT identified the issue, prepared the fix and > commit message, and ran local regression tests. > > Fixes: 09d481270d44 ("scripts: add extract-vmlinux") > Signed-off-by: Hamdy Abou El Anein Sure. This script is not called during the build but I guess this would be the right thing to do if people were chaining a call to this script with other commands. Reviewed-by: Nathan Chancellor > --- > scripts/extract-vmlinux | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/extract-vmlinux b/scripts/extract-vmlinux > index 266df9bc7a48..947182fff26d 100755 > --- a/scripts/extract-vmlinux > +++ b/scripts/extract-vmlinux > @@ -63,3 +63,4 @@ check_vmlinux "$img" cat 0 > > # Bail out: > echo "$me: Cannot find vmlinux." >&2 > +exit 1 > -- > 2.56.1 > -- Cheers, Nathan