[PATCH v2 1/1] bootm: improve error message when gzip decompression buffer is too small

Tom Rini trini at konsulko.com
Wed Apr 30 16:36:11 CEST 2025


On Wed, Apr 30, 2025 at 10:23:25AM +0800, Aristo Chen wrote:

> Currently, when decompressing a gzip-compressed image during bootm, a
> generic error such as "inflate() returned -5" is shown when the buffer is
> too small. However, it is not immediately clear that this is caused by
> CONFIG_SYS_BOOTM_LEN being too small.
> 
> This patch improves error handling by:
> - Detecting Z_BUF_ERROR (-5) returned from the inflate() call
> - Suggesting the user to increase CONFIG_SYS_BOOTM_LEN when applicable
> - Preserving the original return code from zunzip() instead of overwriting
>   it with -1
> 
> By providing clearer hints when decompression fails due to insufficient
> buffer size, this change helps users diagnose and fix boot failures more
> easily.
> 
> Signed-off-by: Aristo Chen <aristo.chen at canonical.com>

Reviewed-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250430/ce02ba4f/attachment.sig>


More information about the U-Boot mailing list