Add recipes to build initramfs image
v5 cover Add recipes to build initramfs image
The series aims to add a new recipe which will package boot essential and some other modules in image which can later be used in the boot process of all K3 platforms. This will result in the addition of ~20MB initramfs image in the bootflow.
The motivation behind the work is to probe modules(in boot time) which could not be built in the upstream Linux kernel image, as using it as inbuilt drivers will increase the kernel image size, which is undesirable by the upstream folks.
Hence, build those drivers as modules and package it inside initramfs and later get it probed through initramfs-udev(device manager).
The series will introduce an additional 20MB initramfs image in the bootflow of all K3 platforms regardless of whether any platform chooses to add modules to it or not, so as to keep the bootflow for all devices uniform. Hence, the build/packaging of initrd image is being triggered in k3.inc.
Bootlogs for J784s4:
https://gist.github.com/Jamm02/8fc4c60b113a420ac0a0dee375228faf
Changes since V4:
- Save the initramfs file name in a variable instead of hardcoding it.
- Optionally include initrd inside .wks using a varible to avoid build failures for non mainline builds.
Link to V4: https://lists.yoctoproject.org/g/meta-ti/message/19110
Link to V3: https://lists.yoctoproject.org/g/meta-ti/message/19083
Link to V2: https://lists.yoctoproject.org/g/meta-ti/message/19043
Link to V1: https://lists.yoctoproject.org/g/meta-ti/topic/115128108
Moteen Shah (4):
meta-ti-bsp: conf: machine: include: Add common module variable for TI
Initramfs image
recipes-ti: initramfs: Make minimal initramfs image
meta-ti-bsp: wic: Add initramfs path to to grub config
meta-ti-bsp: conf: machine: include: Build initramfs for all TI SoCs.
meta-ti-bsp/conf/machine/include/am62axx.inc | 3 ++ meta-ti-bsp/conf/machine/include/j721e.inc | 3 ++ meta-ti-bsp/conf/machine/include/j784s4.inc | 3 ++ meta-ti-bsp/conf/machine/include/ti-soc.inc | 18 ++++++++++ .../packagegroup-ti-core-initramfs.bb | 15 +++++++++ .../recipes-ti/initramfs/ti-core-initramfs.bb | 33 +++++++++++++++++++ meta-ti-bsp/wic/sdimage-2part-efi.wks.in | 2 +- 7 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb create mode 100644 meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb
Signature · 1 line
2.34.1
PATCH v5 1/4 meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image
Add a new variable in ti-soc.inc which would be populated by individual platforms with the required modules which would later be packaged inside the initramfs image.
--- meta-ti-bsp/conf/machine/include/am62axx.inc | 3 +++ meta-ti-bsp/conf/machine/include/j721e.inc | 3 +++ meta-ti-bsp/conf/machine/include/j784s4.inc | 3 +++ meta-ti-bsp/conf/machine/include/ti-soc.inc | 2 ++ 4 files changed, 11 insertions(+)
meta-ti-bsp/conf/machine/include/am62axx.inc +3 -0
@@ -11,3 +11,6 @@ TFA_BOARD = "lite" OPTEEMACHINE = "k3-am62x" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cnm-wave-fw" + +TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = "kernel-module-tps6594-i2c" +TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = "kernel-module-tps6594-i2c"
meta-ti-bsp/conf/machine/include/j721e.inc +3 -0
@@ -19,3 +19,6 @@ TI_VXE_VXD_DRIVER = "ti-vxe-vxd-driver" TI_VXE_VXD_DRIVER:bsp-ti-6_6 = "" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw vxd-dec-fw ti-eth-fw-j721e ${TI_VXE_VXD_DRIVER}" + +TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs" +TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
meta-ti-bsp/conf/machine/include/j784s4.inc +3 -0
@@ -13,3 +13,6 @@ TFA_BOARD = "j784s4" OPTEEMACHINE = "k3-j784s4" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw cnm-wave-fw ti-eth-fw-j784s4" + +TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs" +TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
meta-ti-bsp/conf/machine/include/ti-soc.inc +2 -0
@@ -27,3 +27,5 @@ CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICE KERNEL_CLASSES += "${CLASS_DEVICETREE_PREFIX}" IMAGE_CLASSES += "${CLASS_DEVICETREE_PREFIX}" + +TI_INITRAMFS_KERNEL_MODULES ?= ""
Signature · 1 line
2.34.1
Re: [meta-ti] [master][PATCH v5 1/4] meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image
Quoted 50 lines · Moteen Shah via lists.yoctoproject.org
Add a new variable in ti-soc.inc which would be populated by individual platforms with the required modules which would later be packaged inside the initramfs image.
Signed-off-by Moteen Shah <[email protected]>--- meta-ti-bsp/conf/machine/include/am62axx.inc | 3 +++ meta-ti-bsp/conf/machine/include/j721e.inc | 3 +++ meta-ti-bsp/conf/machine/include/j784s4.inc | 3 +++ meta-ti-bsp/conf/machine/include/ti-soc.inc | 2 ++ 4 files changed, 11 insertions(+)meta-ti-bsp/conf/machine/include/am62axx.inc +3
-0@@ -11,3 +11,6 @@ TFA_BOARD = "lite" OPTEEMACHINE = "k3-am62x" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cnm-wave-fw" + +TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = "kernel-module-tps6594-i2c" +TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = "kernel-module-tps6594-i2c"meta-ti-bsp/conf/machine/include/j721e.inc +3
-0@@ -19,3 +19,6 @@ TI_VXE_VXD_DRIVER = "ti-vxe-vxd-driver" TI_VXE_VXD_DRIVER:bsp-ti-6_6 = "" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw vxd-dec-fw ti-eth-fw-j721e ${TI_VXE_VXD_DRIVER}" + +TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs" +TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"meta-ti-bsp/conf/machine/include/j784s4.inc +3
-0@@ -13,3 +13,6 @@ TFA_BOARD = "j784s4" OPTEEMACHINE = "k3-j784s4" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw cnm-wave-fw ti-eth-fw-j784s4" + +TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs" +TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"meta-ti-bsp/conf/machine/include/ti-soc.inc +0
-0
meta-ti-bsp/conf/machine/include/ti-soc.inc CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICE · line 31
Quoted 6 lines
meta-ti-bsp/conf/machine/include/ti-soc.inc +2
-0@@ -27,3 +27,5 @@ CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICE KERNEL_CLASSES += "${CLASS_DEVICETREE_PREFIX}" IMAGE_CLASSES += "${CLASS_DEVICETREE_PREFIX}" + +TI_INITRAMFS_KERNEL_MODULES ?= ""
Add newlines at end of files.
Andrew
Quoted 11 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19127): https://lists.yoctoproject.org/g/meta-ti/message/19127
Mute This Topic: https://lists.yoctoproject.org/mt/115769464/3619733
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
PATCH v5 2/4 recipes-ti: initramfs: Make minimal initramfs image
In reply to Moteen ShahIntroduce a new minimal initramfs image which will be used for all K3 devices in the boot flow. The image will package boot essential and other modules which will be modprobed by initramfs-udev once the inbuilt drivers gets probed.
--- .../packagegroup-ti-core-initramfs.bb | 15 +++++++++ .../recipes-ti/initramfs/ti-core-initramfs.bb | 33 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb create mode 100644 meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb
meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb new file +15 -0
@@ -0,0 +1,15 @@ +SUMMARY = "Minimal initramfs for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN} += "\ + ${TI_INITRAMFS_KERNEL_MODULES} \ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +RDEPENDS:${PN}:remove = "grub-efi kernel"
meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb new file +33 -0
@@ -0,0 +1,33 @@ +SUMMARY = "TI SDK minimal initramfs image" + +DESCRIPTION = "Image meant to probe boot essential modules\ + and other modules to reach the userspace, which cannot be\ + built inside the upstream linux kernel image.\ +" + +LICENSE = "MIT" + +inherit core-image + +IMAGE_NAME = "ti-core-initramfs" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +PACKAGE_INSTALL = "packagegroup-ti-core-initramfs" + +export IMAGE_BASENAME = "${IMAGE_NAME}" + +# To further reduce the size of the rootfs, remove the /boot directory from +# the final image this is usually done by adding RDEPENDS_kernel-base = "" +# in the configuration file. In our case we can't use this method. Instead we +# just wipe out the content of "/boot" before creating the image. +ROOTFS_POSTPROCESS_COMMAND += "empty_boot_dir; " +empty_boot_dir () { + rm -rf ${IMAGE_ROOTFS}/boot/* +}
Signature · 1 line
2.34.1
PATCH v5 3/4 meta-ti-bsp: wic: Add initramfs path to to grub config
In reply to Moteen ShahAdd initrd path to grub.cfg config so that it picks up the initramfs image from the boot partition and includes it in the boot process.
--- meta-ti-bsp/wic/sdimage-2part-efi.wks.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-ti-bsp/wic/sdimage-2part-efi.wks.in +1 -1
@@ -4,5 +4,5 @@ # reserved space. We cannot use a GPT here. bootloader --timeout=3 --append="rootfstype=ext4 ${TI_WKS_BOOTLOADER_APPEND}" -part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M +part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}${TI_WKS_INITRAMFS}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid
Signature · 1 line
2.34.1
PATCH v5 4/4 meta-ti-bsp: conf: machine: include: Build initramfs for all TI SoCs.
In reply to Moteen ShahTrigger build for initramfs image and package it in the boot partition of all TI SoC's whenever an image recipe is built with upstream kernel(mainline or mainline-next).
--- meta-ti-bsp/conf/machine/include/ti-soc.inc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
meta-ti-bsp/conf/machine/include/ti-soc.inc +17 -1
@@ -28,4 +28,20 @@ CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICE KERNEL_CLASSES += "${CLASS_DEVICETREE_PREFIX}" IMAGE_CLASSES += "${CLASS_DEVICETREE_PREFIX}" -TI_INITRAMFS_KERNEL_MODULES ?= "" +TI_INITRAMFS_KERNEL_MODULES ?= "" + +BUILD_CORE_INITRAMFS_IMAGE = "ti-core-initramfs" +BUILD_CORE_INITRAMFS_IMAGE_FILE = "${BUILD_CORE_INITRAMFS_IMAGE}.cpio.xz" + +BUILD_CORE_INITRAMFS_IMAGE_STEP ?= "" +BUILD_CORE_INITRAMFS_IMAGE_STEP:bsp-mainline = "${BUILD_CORE_INITRAMFS_IMAGE}:do_image_complete" +BUILD_CORE_INITRAMFS_IMAGE_STEP:bsp-next = "${BUILD_CORE_INITRAMFS_IMAGE}:do_image_complete" + +do_image_wic[depends] += "${BUILD_CORE_INITRAMFS_IMAGE_STEP}" + +TI_WKS_INITRAMFS ?= "" +TI_WKS_INITRAMFS:bsp-mainline = ",initrd=${BUILD_CORE_INITRAMFS_IMAGE_FILE}" +TI_WKS_INITRAMFS:bsp-next = ",initrd=${BUILD_CORE_INITRAMFS_IMAGE_FILE}" + +IMAGE_BOOT_FILES:append:bsp-mainline = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}" +IMAGE_BOOT_FILES:append:bsp-next = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
Signature · 1 line
2.34.1
meta-ti / na / 20251015120032.288741-1-m-shah
PRC Results: FAIL
=========================================================
check-yocto-patches: FAIL
=========================================================
Patches
----------------------------------------
FAIL - [master][PATCH v5 1/4] meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image
ERROR: Commit message too long (> 80 chars): meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image. (COMMIT-MESSAGE-1)
patch:44
Subject: [master][PATCH v5 1/4] meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image
WARN: Commit message does not include file/recipe name: meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image. (COMMIT-MESSAGE-2)
patch
WARN: Commit message should not include directory path to recipe: meta-ti-bsp: conf: machine: include: Add common module variable for TI Initramfs image.
meta-ti-bsp:
conf:
machine:
include: (COMMIT-MESSAGE-3)
patch
WARN: Revised patch missing a comment. (REVISION-1)
patch
WARN - [master][PATCH v5 2/4] recipes-ti: initramfs: Make minimal initramfs image
WARN: Commit message does not include file/recipe name: recipes-ti: initramfs: Make minimal initramfs image. (COMMIT-MESSAGE-2)
patch
WARN: Commit message should not include directory path to recipe: recipes-ti: initramfs: Make minimal initramfs image.
recipes-ti: (COMMIT-MESSAGE-3)
patch
WARN: Revised patch missing a comment. (REVISION-1)
patch
WARN - [master][PATCH v5 3/4] meta-ti-bsp: wic: Add initramfs path to to grub config
WARN: Commit message does not include file/recipe name: meta-ti-bsp: wic: Add initramfs path to to grub config. (COMMIT-MESSAGE-2)
patch
WARN: Commit message should not include directory path to recipe: meta-ti-bsp: wic: Add initramfs path to to grub config.
meta-ti-bsp:
wic: (COMMIT-MESSAGE-3)
patch
WARN: Revised patch missing a comment. (REVISION-1)
patch
WARN - [master][PATCH v5 4/4] meta-ti-bsp: conf: machine: include: Build initramfs for all TI SoCs.
WARN: Commit message does not include file/recipe name: meta-ti-bsp: conf: machine: include: Build initramfs for all TI SoCs.. (COMMIT-MESSAGE-2)
patch
WARN: Commit message should not include directory path to recipe: meta-ti-bsp: conf: machine: include: Build initramfs for all TI SoCs..
meta-ti-bsp:
conf:
machine:
include: (COMMIT-MESSAGE-3)
patch
WARN: Revised patch missing a comment. (REVISION-1)
patch