mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts: extract-vmlinux: return failure when extraction fails
@ 2026-12-01 22:10 Hamdy Abou El Anein
  2026-12-02 22:02 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: Hamdy Abou El Anein @ 2026-12-01 22:10 UTC (permalink / raw)
  To: nathan, nsc; +Cc: linux-kbuild, linux-kernel, corentincj, mmarek

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 <info@daylightlinux.ch>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts: extract-vmlinux: return failure when extraction fails
  2026-12-01 22:10 [PATCH] scripts: extract-vmlinux: return failure when extraction fails Hamdy Abou El Anein
@ 2026-12-02 22:02 ` Nathan Chancellor
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-12-02 22:02 UTC (permalink / raw)
  To: Hamdy Abou El Anein; +Cc: nsc, linux-kbuild, linux-kernel

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 <info@daylightlinux.ch>

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 <nathan@kernel.org>

> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 22:10 [PATCH] scripts: extract-vmlinux: return failure when extraction fails Hamdy Abou El Anein
2026-12-02 22:02 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®