| Message ID | 20250404162932.447699-6-mikko.rapeli@linaro.org |
|---|---|
| State | New |
| Headers | show |
| Series | systemd based initrd and modular kernel support | expand |
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? > +MACHINE_EXTRA_RRECOMMENDS = "" > + > # Ensure the initramfs only contains the bare minimum > IMAGE_FEATURES = "" > IMAGE_LINGUAS = "" Cheers, Richard
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
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 = "" +MACHINE_EXTRA_RRECOMMENDS = "" + # Ensure the initramfs only contains the bare minimum IMAGE_FEATURES = "" IMAGE_LINGUAS = ""
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(-)