]> git.ipfire.org Git - thirdparty/u-boot.git/commit
bootm: teach handle_decomp_error() about the noload decompression buffer
authorAristo Chen <aristo.chen@canonical.com>
Fri, 10 Jul 2026 13:13:29 +0000 (13:13 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 23 Jul 2026 21:16:15 +0000 (15:16 -0600)
commit79b6ee1a4b3ce9ca2db0429fc2e8dfb4110cd7e8
tree282f5a482b6ffda88bfb4ba7f6a29984ddcb9e1c
parentf7b525a8bc5396b84cf873bdfa5750731de398e9
bootm: teach handle_decomp_error() about the noload decompression buffer

For a compressed kernel_noload image, bootm_load_os() allocates a
per-image decompression buffer of ALIGN(image_len * 8, SZ_1M) rather
than the global CONFIG_SYS_BOOTM_LEN. When decompression fails on that
path, handle_decomp_error() still prints

    Image too large: increase CONFIG_SYS_BOOTM_LEN

which is misleading: increasing CONFIG_SYS_BOOTM_LEN does not help
because the smaller per-image buffer is the actual bound. Commit
2ff26c1e378d ("bootm: fix overflow of the noload kernel decompression
buffer") worked around this by printing a follow-up note right after
handle_decomp_error() returned, but the boot log then reads as two
contradictory sentences.

Introduce enum bootm_decomp_limit and pass it into
handle_decomp_error() so the helper picks the right message in one
place. For the per-image path it now prints

    Image too large for the per-image decompression buffer (0x100000 bytes)

quoting the actual buffer size; the global path is unchanged. Drop the
trailing note in bootm_load_os() so only one line is printed.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
boot/bootm.c