Re: [docs] [PATCH] ref-manual: expand on kernel "do_sizecheck" task

"Antonin Godard" <[email protected]> Fri, 10 Jul 2026 09:55:23 +0200
Newsgroups org.yoctoproject.lists.docs
Message-ID <[email protected]>
Hi,

On Thu Jul 9, 2026 at 10:31 AM CEST, Robert P. J. Day wrote:
>
> Expand on the description of do_sizecheck() to mention that it will
> size-check on *all* kernel images listed in KERNEL_IMAGETYPES.
>
> Signed-off-by: Robert P. J. Day <[email protected]>
>
> ---
>
> diff --git a/documentation/ref-manual/tasks.rst b/documentation/ref-manual/tasks.rst
> index e1db2d5ed..db0abad00 100644
> --- a/documentation/ref-manual/tasks.rst
> +++ b/documentation/ref-manual/tasks.rst
> @@ -837,11 +837,10 @@ can successfully build the kernel modules in the next step of the build.
>  ``do_sizecheck``
>  ----------------
>
> -After the kernel has been built, this task checks the size of the
> -stripped kernel image against
> -:term:`KERNEL_IMAGE_MAXSIZE`. If that
> -variable was set and the size of the stripped kernel exceeds that size,
> -the kernel build produces a warning to that effect.
> +If the variable :term:`KERNEL_IMAGE_MAXSIZE` is set, this task compares
> +the size of all stripped kernel images listed in :term:`KERNEL_IMAGETYPES`
> +against that value. If more than one image type is listed there, warn on
> +any that exceed that value, but fail only if none of them fit.
>
>  .. _ref-tasks-strip:
>
> diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
> index c92b195ff..ba83b6e6f 100644
> --- a/documentation/ref-manual/variables.rst
> +++ b/documentation/ref-manual/variables.rst
> @@ -5603,17 +5603,18 @@ system and gives an overview of their function and contents.
>        information.
>
>     :term:`KERNEL_IMAGE_MAXSIZE`
> -      Specifies the maximum size of the kernel image file in kilobytes. If
> -      :term:`KERNEL_IMAGE_MAXSIZE` is set, the size of the kernel image file is
> -      checked against the set value during the
> -      :ref:`ref-tasks-sizecheck` task. The task fails if
> -      the kernel image file is larger than the setting.
> +      Specifies the maximum allowable size of the kernel image file in kilobytes.

I know this was already the case, but I think those are kibibytes, not
kilobytes. How the size is computed:

  size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$imageType | awk '{print $1}'`

du's docs:

  -k     like --block-size=1K
  -B, --block-size=SIZE

  The SIZE argument is an integer and optional unit (example: 10K is
  10*1024).  Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,...
  (powers of 1000).  Binary prefixes can be used, too: KiB=K, MiB=M, and
  so on.

Otherwise looks good, thanks! I'll merge in master-next with this modification.

Antonin