Poky Project Discussions
 help / color / mirror / Atom feed
* Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers
       [not found] <18A5D9F18A3D8C50.777565@lists.yoctoproject.org>
@ 2026-04-16 13:26 ` Mikko Rapeli
  2026-04-16 13:48   ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Mikko Rapeli @ 2026-04-16 13:26 UTC (permalink / raw)
  To: poky

Hi,

On Mon, Apr 13, 2026 at 10:27:15AM +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> genericarm64 supports a lot of HW and thus large collection of kernel
> drivers are enabled and installed to images by default.
> Subset of the kernel drivers are needed in initramfs to mount rootfs
> from local mass storage devices. This increases initramfs size a lot
> and with new kernel config updates even more. Thus remove kernel
> drivers from initramfs image which are not needed for mounting
> rootfs from local mass storage devices. GPU, Bluetooth, NFC,
> sound, networking etc support is not needed in the initramfs.
> 
> According to buildhistory core-image-initramfs-boot size is reduced
> from 118 to 83 Mb.

In my oe-core master branch builds core-image-initramfs-boot is now failing
due to size limits:

https://gitlab.com/Linaro/trustedsubstrate/gpit/-/jobs/13951723488

2026-04-16 13:04:26 - ERROR    - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: The initramfs size 282121(K) exceeds INITRAMFS_MAXSIZE: 280000(K)
2026-04-16 13:04:26 - ERROR    - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: You can set INITRAMFS_MAXSIZE a larger value. Usually, it should
2026-04-16 13:04:26 - ERROR    - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: be less than 1/2 of ram size, or you may fail to boot it.

This patch could be one fix.

But is this visible in auto-builder side builds? Or have the genericarm64
poky-altcfg distro builds been disabled?

Cheers,

-Mikko

> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  .../images/core-image-initramfs-boot.bbappend | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> 
> v3: added PATHS_TO_REMOVE variable so that it can be customized
>     as suggested by Jose Quaresma <quaresma.jose@gmail.com>
> 
> v2: https://lists.yoctoproject.org/g/poky/message/13894
> 
> diff --git a/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> new file mode 100644
> index 000000000000..2298c2f94740
> --- /dev/null
> +++ b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> @@ -0,0 +1,28 @@
> +POSTFUNCS = ""
> +POSTFUNCS:genericarm64 = "reduce_initrd_size"
> +
> +PATHS_TO_REMOVE = ""
> +# these kernel modules are not needed for rootfs mount from local mass storage
> +# and can be loaded from main rootfs by udev
> +PATHS_TO_REMOVE:genericarm64 = "\
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/bluetooth \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/gpu \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/media \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/net \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/nfc \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/usb/gadget \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/fs/fuse \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bluetooth \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bridge \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/netfilter \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/nfc \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/sound \
> +"
> +
> +do_rootfs[postfuncs] += "${POSTFUNCS}"
> +reduce_initrd_size () {
> +    if [ -n "${PATHS_TO_REMOVE}" ]; then
> +        rm -rf ${PATHS_TO_REMOVE}
> +    fi
> +}
> +
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#13898): https://lists.yoctoproject.org/g/poky/message/13898
> Mute This Topic: https://lists.yoctoproject.org/mt/118800931/7159507
> Group Owner: poky+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [mikko.rapeli@linaro.org]
> -=-=-=-=-=-=-=-=-=-=-=-
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers
  2026-04-16 13:26 ` [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers Mikko Rapeli
@ 2026-04-16 13:48   ` Richard Purdie
  2026-04-16 14:07     ` Mikko Rapeli
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2026-04-16 13:48 UTC (permalink / raw)
  To: mikko.rapeli, poky

On Thu, 2026-04-16 at 16:26 +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> On Mon, Apr 13, 2026 at 10:27:15AM +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> > genericarm64 supports a lot of HW and thus large collection of kernel
> > drivers are enabled and installed to images by default.
> > Subset of the kernel drivers are needed in initramfs to mount rootfs
> > from local mass storage devices. This increases initramfs size a lot
> > and with new kernel config updates even more. Thus remove kernel
> > drivers from initramfs image which are not needed for mounting
> > rootfs from local mass storage devices. GPU, Bluetooth, NFC,
> > sound, networking etc support is not needed in the initramfs.
> > 
> > According to buildhistory core-image-initramfs-boot size is reduced
> > from 118 to 83 Mb.
> 
> In my oe-core master branch builds core-image-initramfs-boot is now failing
> due to size limits:
> 
> https://gitlab.com/Linaro/trustedsubstrate/gpit/-/jobs/13951723488
> 
> 2026-04-16 13:04:26 - ERROR    - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: The initramfs size 282121(K) exceeds INITRAMFS_MAXSIZE: 280000(K)
> 2026-04-16 13:04:26 - ERROR    - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: You can set INITRAMFS_MAXSIZE a larger value. Usually, it should
> 2026-04-16 13:04:26 - ERROR    - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: be less than 1/2 of ram size, or you may fail to boot it.
> 
> This patch could be one fix.
> 
> But is this visible in auto-builder side builds? Or have the genericarm64
> poky-altcfg distro builds been disabled?

We're not seeing it there, the builds should be running though.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers
  2026-04-16 13:48   ` Richard Purdie
@ 2026-04-16 14:07     ` Mikko Rapeli
  0 siblings, 0 replies; 6+ messages in thread
From: Mikko Rapeli @ 2026-04-16 14:07 UTC (permalink / raw)
  To: Richard Purdie; +Cc: poky

Hi,

On Thu, Apr 16, 2026 at 02:48:13PM +0100, Richard Purdie wrote:
> On Thu, 2026-04-16 at 16:26 +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> > On Mon, Apr 13, 2026 at 10:27:15AM +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> > > genericarm64 supports a lot of HW and thus large collection of kernel
> > > drivers are enabled and installed to images by default.
> > > Subset of the kernel drivers are needed in initramfs to mount rootfs
> > > from local mass storage devices. This increases initramfs size a lot
> > > and with new kernel config updates even more. Thus remove kernel
> > > drivers from initramfs image which are not needed for mounting
> > > rootfs from local mass storage devices. GPU, Bluetooth, NFC,
> > > sound, networking etc support is not needed in the initramfs.
> > > 
> > > According to buildhistory core-image-initramfs-boot size is reduced
> > > from 118 to 83 Mb.
> > 
> > In my oe-core master branch builds core-image-initramfs-boot is now failing
> > due to size limits:
> > 
> > https://gitlab.com/Linaro/trustedsubstrate/gpit/-/jobs/13951723488
> > 
> > 2026-04-16 13:04:26 - ERROR��� - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: The initramfs size 282121(K) exceeds INITRAMFS_MAXSIZE: 280000(K)
> > 2026-04-16 13:04:26 - ERROR��� - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: You can set INITRAMFS_MAXSIZE a larger value. Usually, it should
> > 2026-04-16 13:04:26 - ERROR��� - ERROR: core-image-initramfs-boot-1.0-r0 do_image_cpio: be less than 1/2 of ram size, or you may fail to boot it.
> > 
> > This patch could be one fix.
> > 
> > But is this visible in auto-builder side builds? Or have the genericarm64
> > poky-altcfg distro builds been disabled?
> 
> We're not seeing it there, the builds should be running though.

Ok. Maybe it's the linux-firmware update which just tipped genericarm64
core-image-initramfs-boot over the size limit.

I hope this patch would be fine as a fix.

Cheers,

-Mikko


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers
  2026-04-13  7:27 Mikko Rapeli
@ 2026-04-17  9:10 ` Richard Purdie
  2026-04-17  9:25   ` Mikko Rapeli
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2026-04-17  9:10 UTC (permalink / raw)
  To: mikko.rapeli, poky; +Cc: Bruce Ashfield

On Mon, 2026-04-13 at 10:27 +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> genericarm64 supports a lot of HW and thus large collection of kernel
> drivers are enabled and installed to images by default.
> Subset of the kernel drivers are needed in initramfs to mount rootfs
> from local mass storage devices. This increases initramfs size a lot
> and with new kernel config updates even more. Thus remove kernel
> drivers from initramfs image which are not needed for mounting
> rootfs from local mass storage devices. GPU, Bluetooth, NFC,
> sound, networking etc support is not needed in the initramfs.
> 
> According to buildhistory core-image-initramfs-boot size is reduced
> from 118 to 83 Mb.
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  .../images/core-image-initramfs-boot.bbappend | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> 
> v3: added PATHS_TO_REMOVE variable so that it can be customized
>     as suggested by Jose Quaresma <quaresma.jose@gmail.com>
> 
> v2: https://lists.yoctoproject.org/g/poky/message/13894
> 
> diff --git a/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> new file mode 100644
> index 000000000000..2298c2f94740
> --- /dev/null
> +++ b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> @@ -0,0 +1,28 @@
> +POSTFUNCS = ""
> +POSTFUNCS:genericarm64 = "reduce_initrd_size"
> +
> +PATHS_TO_REMOVE = ""
> +# these kernel modules are not needed for rootfs mount from local mass storage
> +# and can be loaded from main rootfs by udev
> +PATHS_TO_REMOVE:genericarm64 = "\
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/bluetooth \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/gpu \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/media \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/net \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/nfc \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/usb/gadget \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/fs/fuse \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bluetooth \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bridge \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/netfilter \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/nfc \
> +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/sound \
> +"
> +
> +do_rootfs[postfuncs] += "${POSTFUNCS}"
> +reduce_initrd_size () {
> +    if [ -n "${PATHS_TO_REMOVE}" ]; then
> +        rm -rf ${PATHS_TO_REMOVE}
> +    fi
> +}
> +

This is a tough one. There are some simple things like "POSTFUNCS"
being a bit generic as a name. I also worry a little this may trip up
yocto-check-layer with the added variable POSTFUNCS, even if it is
empty. I think if we're creating this as API, listing the directories:

    drivers/bluetooth \
    drivers/gpu \
    drivers/media \
    drivers/net \
    drivers/nfc \
    drivers/usb/gadget \
    fs/fuse \
    net/bluetooth \
    net/bridge \
    net/netfilter \
    net/nfc \
    sound \

and then adding the prefix would probably be cleaner too. Those are all
easier tweaks.

The bigger challenge is "generic" kernel adding all this. Ideally you
wouldn't install these things to the initramfs in the first place, then
you wouldn't need to delete them. I'm not sure how you could
detect/filter and install only the subset of modules you want, or how
that list of modules would be maintained/updated.

A different package to "kernel-modules" could be one idea, how you
construct that, again, I'm less sure. The above filter list could be
used to iterate the modules and filter by path I guess?

Now we've merged the firmware update, the builds are breaking but some
of these kinds of changes are probably too late for the release/LTS.

Perhaps we just have to increase the size of the initramfs for now :(

Cheers,

Richard





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers
  2026-04-17  9:10 ` [poky] " Richard Purdie
@ 2026-04-17  9:25   ` Mikko Rapeli
  2026-04-17 12:06     ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Mikko Rapeli @ 2026-04-17  9:25 UTC (permalink / raw)
  To: Richard Purdie; +Cc: poky, Bruce Ashfield

Hi,

On Fri, Apr 17, 2026 at 10:10:07AM +0100, Richard Purdie wrote:
> On Mon, 2026-04-13 at 10:27 +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> > genericarm64 supports a lot of HW and thus large collection of kernel
> > drivers are enabled and installed to images by default.
> > Subset of the kernel drivers are needed in initramfs to mount rootfs
> > from local mass storage devices. This increases initramfs size a lot
> > and with new kernel config updates even more. Thus remove kernel
> > drivers from initramfs image which are not needed for mounting
> > rootfs from local mass storage devices. GPU, Bluetooth, NFC,
> > sound, networking etc support is not needed in the initramfs.
> > 
> > According to buildhistory core-image-initramfs-boot size is reduced
> > from 118 to 83 Mb.
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > ---
> > �.../images/core-image-initramfs-boot.bbappend | 28 +++++++++++++++++++
> > �1 file changed, 28 insertions(+)
> > �create mode 100644 meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> > 
> > v3: added PATHS_TO_REMOVE variable so that it can be customized
> > ��� as suggested by Jose Quaresma <quaresma.jose@gmail.com>
> > 
> > v2: https://lists.yoctoproject.org/g/poky/message/13894
> > 
> > diff --git a/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> > new file mode 100644
> > index 000000000000..2298c2f94740
> > --- /dev/null
> > +++ b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> > @@ -0,0 +1,28 @@
> > +POSTFUNCS = ""
> > +POSTFUNCS:genericarm64 = "reduce_initrd_size"
> > +
> > +PATHS_TO_REMOVE = ""
> > +# these kernel modules are not needed for rootfs mount from local mass storage
> > +# and can be loaded from main rootfs by udev
> > +PATHS_TO_REMOVE:genericarm64 = "\
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/bluetooth \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/gpu \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/media \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/net \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/nfc \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/usb/gadget \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/fs/fuse \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bluetooth \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bridge \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/netfilter \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/nfc \
> > +��� ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/sound \
> > +"
> > +
> > +do_rootfs[postfuncs] += "${POSTFUNCS}"
> > +reduce_initrd_size () {
> > +��� if [ -n "${PATHS_TO_REMOVE}" ]; then
> > +������� rm -rf ${PATHS_TO_REMOVE}
> > +��� fi
> > +}
> > +
> 
> This is a tough one. There are some simple things like "POSTFUNCS"
> being a bit generic as a name. I also worry a little this may trip up
> yocto-check-layer with the added variable POSTFUNCS, even if it is
> empty. I think if we're creating this as API, listing the directories:
> 
>     drivers/bluetooth \
>     drivers/gpu \
>     drivers/media \
>     drivers/net \
>     drivers/nfc \
>     drivers/usb/gadget \
>     fs/fuse \
>     net/bluetooth \
>     net/bridge \
>     net/netfilter \
>     net/nfc \
>     sound \
> 
> and then adding the prefix would probably be cleaner too. Those are all
> easier tweaks.
> 
> The bigger challenge is "generic" kernel adding all this. Ideally you
> wouldn't install these things to the initramfs in the first place, then
> you wouldn't need to delete them. I'm not sure how you could
> detect/filter and install only the subset of modules you want, or how
> that list of modules would be maintained/updated.

kernel-modules correctly get installed to all images through MACHINE_EXTRA_RDEPENDS.
This is flexible to drivers being built-in or modules. IMO initramfs
image should not be explicitly tied to the exact kernel config and thus
should not depend on the exact set of kernel module packages. A slightly more abstract
interface between kernel and initramfs image is needed, and "kernel-modules"
decent at that. This works well for the real rootfs but is not optimal for
initramfs.

> A different package to "kernel-modules" could be one idea, how you
> construct that, again, I'm less sure. The above filter list could be
> used to iterate the modules and filter by path I guess?

I had a patchset for this but ran into issues with it.

https://lists.openembedded.org/g/openembedded-core/topic/112087526#msg214354

I don't see how that can move forward though.
 
> Now we've merged the firmware update, the builds are breaking but some
> of these kinds of changes are probably too late for the release/LTS.
> 
> Perhaps we just have to increase the size of the initramfs for now :(

Sigh, alright then.

Cheers,

-Mikko


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers
  2026-04-17  9:25   ` Mikko Rapeli
@ 2026-04-17 12:06     ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2026-04-17 12:06 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: poky, Bruce Ashfield

On Fri, 2026-04-17 at 12:25 +0300, Mikko Rapeli wrote:
> Hi,
> 
> On Fri, Apr 17, 2026 at 10:10:07AM +0100, Richard Purdie wrote:
> > On Mon, 2026-04-13 at 10:27 +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> > > genericarm64 supports a lot of HW and thus large collection of kernel
> > > drivers are enabled and installed to images by default.
> > > Subset of the kernel drivers are needed in initramfs to mount rootfs
> > > from local mass storage devices. This increases initramfs size a lot
> > > and with new kernel config updates even more. Thus remove kernel
> > > drivers from initramfs image which are not needed for mounting
> > > rootfs from local mass storage devices. GPU, Bluetooth, NFC,
> > > sound, networking etc support is not needed in the initramfs.
> > > 
> > > According to buildhistory core-image-initramfs-boot size is reduced
> > > from 118 to 83 Mb.
> > > 
> > > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > > ---
> > >  .../images/core-image-initramfs-boot.bbappend | 28 +++++++++++++++++++
> > >  1 file changed, 28 insertions(+)
> > >  create mode 100644 meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> > > 
> > > v3: added PATHS_TO_REMOVE variable so that it can be customized
> > >     as suggested by Jose Quaresma <quaresma.jose@gmail.com>
> > > 
> > > v2: https://lists.yoctoproject.org/g/poky/message/13894
> > > 
> > > diff --git a/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> > > new file mode 100644
> > > index 000000000000..2298c2f94740
> > > --- /dev/null
> > > +++ b/meta-yocto-bsp/recipes-core/images/core-image-initramfs-boot.bbappend
> > > @@ -0,0 +1,28 @@
> > > +POSTFUNCS = ""
> > > +POSTFUNCS:genericarm64 = "reduce_initrd_size"
> > > +
> > > +PATHS_TO_REMOVE = ""
> > > +# these kernel modules are not needed for rootfs mount from local mass storage
> > > +# and can be loaded from main rootfs by udev
> > > +PATHS_TO_REMOVE:genericarm64 = "\
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/bluetooth \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/gpu \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/media \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/net \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/nfc \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/drivers/usb/gadget \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/fs/fuse \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bluetooth \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/bridge \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/netfilter \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/net/nfc \
> > > +    ${WORKDIR}/rootfs/${libdir}/modules/*/kernel/sound \
> > > +"
> > > +
> > > +do_rootfs[postfuncs] += "${POSTFUNCS}"
> > > +reduce_initrd_size () {
> > > +    if [ -n "${PATHS_TO_REMOVE}" ]; then
> > > +        rm -rf ${PATHS_TO_REMOVE}
> > > +    fi
> > > +}
> > > +
> > 
> > This is a tough one. There are some simple things like "POSTFUNCS"
> > being a bit generic as a name. I also worry a little this may trip up
> > yocto-check-layer with the added variable POSTFUNCS, even if it is
> > empty. I think if we're creating this as API, listing the directories:
> > 
> >     drivers/bluetooth \
> >     drivers/gpu \
> >     drivers/media \
> >     drivers/net \
> >     drivers/nfc \
> >     drivers/usb/gadget \
> >     fs/fuse \
> >     net/bluetooth \
> >     net/bridge \
> >     net/netfilter \
> >     net/nfc \
> >     sound \
> > 
> > and then adding the prefix would probably be cleaner too. Those are all
> > easier tweaks.
> > 
> > The bigger challenge is "generic" kernel adding all this. Ideally you
> > wouldn't install these things to the initramfs in the first place, then
> > you wouldn't need to delete them. I'm not sure how you could
> > detect/filter and install only the subset of modules you want, or how
> > that list of modules would be maintained/updated.
> 
> kernel-modules correctly get installed to all images through MACHINE_EXTRA_RDEPENDS.
> This is flexible to drivers being built-in or modules. IMO initramfs
> image should not be explicitly tied to the exact kernel config and thus
> should not depend on the exact set of kernel module packages. A slightly more abstract
> interface between kernel and initramfs image is needed, and "kernel-modules"
> decent at that. This works well for the real rootfs but is not optimal for
> initramfs.
> 
> > A different package to "kernel-modules" could be one idea, how you
> > construct that, again, I'm less sure. The above filter list could be
> > used to iterate the modules and filter by path I guess?
> 
> I had a patchset for this but ran into issues with it.
> 
> https://lists.openembedded.org/g/openembedded-core/topic/112087526#msg214354
> 
> I don't see how that can move forward though.

The problems there didn't seem unsolvable but I don't remember the full
details. I think we should revisit that in 6.1.

> > Now we've merged the firmware update, the builds are breaking but some
> > of these kinds of changes are probably too late for the release/LTS.
> > 
> > Perhaps we just have to increase the size of the initramfs for now :(
> 
> Sigh, alright then.

We're too close to release to start doing other things unfortunately.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-17 12:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <18A5D9F18A3D8C50.777565@lists.yoctoproject.org>
2026-04-16 13:26 ` [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers Mikko Rapeli
2026-04-16 13:48   ` Richard Purdie
2026-04-16 14:07     ` Mikko Rapeli
2026-04-13  7:27 Mikko Rapeli
2026-04-17  9:10 ` [poky] " Richard Purdie
2026-04-17  9:25   ` Mikko Rapeli
2026-04-17 12:06     ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox