Re: [poky] [PATCH v3] genericarm64 core-image-initramfs-boot: remove some kernel drivers

Mikko Rapeli <[email protected]> Thu, 16 Apr 2026 16:26:09 +0300
Newsgroups org.yoctoproject.lists.poky
Message-ID <aeDjcbnGMMqzyW_z@nuoska>
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 <[email protected]>
> ---
>  .../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 <[email protected]>
> 
> 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: [email protected]
> Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-
>