Re: [OE-core] [PATCH v3 05/11] core-image-initramfs-boot: don't install RRECOMMENDS to reduce size

Mikko Rapeli
2025-04-10T13:09:30Z

Hi,

On Thu, Apr 10, 2025 at 01:47:27PM +0100, Richard Purdie wrote:
> On Fri, 2025-04-04 at 19:29 +0300, Mikko Rapeli via
> lists.openembedded.org wrote:
> > Disables recommends to only install important packages.
> > Disable machine specific additions which are meant for
> > full rootfs boot. For example on genericarm64, full
> > set of kernel modules and WiFi related firmware is
> > in the machine recommends and those are not needed when
> > booting to rootfs from an initrd. These reduce systemd
> > initrd size from 200Mb to 54Mb.
> >
> > Since recommends are not automatically installed anymore,
> > explicitly add initramfs-module-rootfs, busybox-udhcpc and libkmod
> > to shell script based initrd. initramfs-module-rootfs is needed to
> > mount the rootfs. Installing busybox-udhcpc and libkmod
> > for backwards compatibility.
> >
> > Not installing openssl-conf, openssl-ossl-module-legacy or
> > ldconfig packages since they don't seem essential in initrd
> > to mount the rootfs.
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > ---
> > ï¿½meta/recipes-core/images/core-image-initramfs-boot.bb | 11
> > ++++++++++-
> > ï¿½1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/images/core-image-initramfs-boot.bb
> > b/meta/recipes-core/images/core-image-initramfs-boot.bb
> > index c66c28db76..99388476ac 100644
> > --- a/meta/recipes-core/images/core-image-initramfs-boot.bb
> > +++ b/meta/recipes-core/images/core-image-initramfs-boot.bb
> > @@ -2,7 +2,7 @@ SUMMARY = "Basic initramfs to boot a fully-featured
> > rootfs"
> > ï¿½DESCRIPTION = "Small initramfs that contains just udev and init, to
> > find the real rootfs."
> > ï¿½LICENSE = "MIT"
> > ï¿½
> > -INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-
> > udev"
> > +INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev
> > initramfs-module-rootfs"
> > ï¿½
> > ï¿½inherit image
> > ï¿½
> > @@ -20,8 +20,17 @@ PACKAGE_INSTALL = " \
> > ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ${VIRTUAL-RUNTIME_dev_manager} \
> > ï¿½ï¿½ï¿½ï¿½ ', '${INITRAMFS_SCRIPTS}', d)} \
> > ï¿½ï¿½ï¿½ï¿½ base-passwd \
> > +ï¿½ï¿½ï¿½ busybox-udhcpc \
> > +ï¿½ï¿½ï¿½ libkmod \
> > ï¿½"
> > ï¿½
> > +# reduce size
> > +NO_RECOMMENDATIONS = "1"
> > +
> > +# don't install automatically, pick manually instead
> > +MACHINE_EXTRA_RDEPENDS = ""
>
> I'd probably accept that removing the rrecommends below is probably ok
> for the initramfs but I'm not convinced removing rdepends is a good
> move. If that works, are the things in question really rdepends for the
> machine?

If MACHINE_EXTRA_RDEPENDS is for:

"A list of machine-specific packages to install as part of the image
being built that are __not essential for the machine to boot__. However,
the build process for more fully-featured images depends on the packages
being present."

Then I would think they are not needed for initramfs usecases.

Cheers,

-Mikko