public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: gavrosc@yahoo.com, docs@lists.yoctoproject.org
Subject: Re: [docs] [PATCH] ref-manual/variables.rst: document the INITRAMFS_MAXSIZE variable
Date: Wed, 2 Apr 2025 11:15:31 +0200	[thread overview]
Message-ID: <91b88e04-a330-4ebc-8694-e971d1471ec0@cherry.de> (raw)
In-Reply-To: <16450.1743536598761017631@lists.yoctoproject.org>

Hi Christos,

On 4/1/25 9:43 PM, Christos Gavros via lists.yoctoproject.org wrote:
> hi Quentin,
> 
> when you write "compression is enabled", do you mean that the variable "INITRAMFS_FSTYPES" is set to one of the compression formats (by default is set to cpio.gz)?

I mean if the compressed (so not .cpio) size is used or uncompressed 
(.cpio).

You may want max size for the compressed size as this is likely the 
space it's going to take on the storage medium. You probably are more 
interested in the uncompressed size (even for a compressed image!) 
because that's the space it's going to take in RAM at runtime.

If I'm not mistaken, even if the initramfs is compressed on the storage 
medium, the kernel will uncompress it in RAM before using it.

> If so , then i think that "INITRAMFS_MAXSIZE" applies the compressed image.
> 

Reading the introducing commit 155ba626b46bf71acde6c24402fce1682da53b90 
in OE-Core, it seems like this was done for limiting the size in RAM.

Reading the code (meta/classes-recipe/image.bbclass:get_rootfs_size()), 
it's the size of the IMAGE_ROOTFS directory accounting for an overhead 
factor (IMAGE_OVERHEAD_FACTOR) and alignment (IMAGE_ROOTFS_ALIGNMENT). 
IMAGE_OVERHEAD_FACTOR variable is explained in code 
(meta/conf/bitbake.conf) as some free space for "stuff" to happen at 
boot. I am not entirely sure this is necessary for the initramfs (but it 
for sure is for rootfs stored on a storage medium). Then this computed 
size is compared to the value of INITRAMFS_MAXSIZE. So then it means 
this is the uncompressed size we're checking.

What I don't understand is the

"""
# Check the initramfs size against INITRAMFS_MAXSIZE (if set)
if image_fstypes == initramfs_fstypes != ''  and initramfs_maxsize:
"""

check... Why do we care that IMAGE_FSTYPES is equal to INITRAMFS_FSTYPES 
in order to check for the initramfs size? What happens when you have 
setups with an initramfs AND a rootfs on another medium (e.g. typical 
setup for PC distros, or when secureboot is involved (initramfs checking 
the rootfs + switch_root))?

Cheers,
Quentin


  reply	other threads:[~2025-04-02  9:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250328205213.93625-1-gavrosc.ref@yahoo.com>
2025-03-28 20:52 ` [PATCH] ref-manual/variables.rst: document the INITRAMFS_MAXSIZE variable Christos Gavros
2025-03-31  8:51   ` [docs] " Quentin Schulz
2025-03-31  9:24     ` Christos Gavros
2025-04-01 19:43       ` Christos Gavros
2025-04-02  9:15         ` Quentin Schulz [this message]
2025-04-02 12:24   ` Antonin Godard
2025-04-02 14:19     ` Christos Gavros
2025-04-23 19:24       ` Christos Gavros
2025-04-24  8:04         ` [docs] " Antonin Godard
2025-04-24 15:18           ` Christos Gavros
2025-04-25  7:34             ` [docs] " Antonin Godard
2025-04-25  8:35               ` Christos Gavros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91b88e04-a330-4ebc-8694-e971d1471ec0@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=docs@lists.yoctoproject.org \
    --cc=gavrosc@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox