diff mbox series

[master,v4,4/4] meta-ti-bsp: conf: machine: include: Build initramfs for all TI SoC's

Message ID 20251006115010.1530509-5-m-shah@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series Add recipes to build initramfs image | expand

Commit Message

Moteen Shah Oct. 6, 2025, 11:50 a.m. UTC
Trigger 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).

Signed-off-by: Moteen Shah <m-shah@ti.com>
---
 meta-ti-bsp/conf/machine/include/ti-soc.inc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Ryan Eatmon Oct. 13, 2025, 10:10 p.m. UTC | #1
On 10/6/2025 6:50 AM, Moteen Shah wrote:
> Trigger 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).
> 
> Signed-off-by: Moteen Shah <m-shah@ti.com>
> ---
>   meta-ti-bsp/conf/machine/include/ti-soc.inc | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-ti-bsp/conf/machine/include/ti-soc.inc b/meta-ti-bsp/conf/machine/include/ti-soc.inc
> index 1d18ceab..68606cc4 100644
> --- a/meta-ti-bsp/conf/machine/include/ti-soc.inc
> +++ b/meta-ti-bsp/conf/machine/include/ti-soc.inc
> @@ -28,4 +28,12 @@ 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 ?= ""
> \ No newline at end of file
> +TI_INITRAMFS_KERNEL_MODULES ?= ""
> +
> +BUILD_CORE_INITRAMFS_IMAGE ?= ""
> +BUILD_CORE_INITRAMFS_IMAGE:bsp-mainline = "ti-core-initramfs:do_image_complete"
> +BUILD_CORE_INITRAMFS_IMAGE:bsp-next = "ti-core-initramfs:do_image_complete"

To avoid hard-coding "ti-core-initramfs" in so many places, let's use 
variables to contain the variations of the string.  That way we onyl 
have to change a single variable to update the name in all places (not 
that I think we will ever want to change it...)

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_complete[depends] += "${BUILD_CORE_INITRAMFS_IMAGE}"

This needs to change to do_image_wic since the initramfs file needs to 
be complete for the wic step:

do_image_wic[depends] += "${BUILD_CORE_INITRAMFS_IMAGE_STEP}"


> +
> +IMAGE_BOOT_FILES:append:bsp-mainline = " ti-core-initramfs.cpio.xz"
> +IMAGE_BOOT_FILES:append:bsp-next = " ti-core-initramfs.cpio.xz"

Change these to use the new variable:

IMAGE_BOOT_FILES:append:bsp-mainline = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
IMAGE_BOOT_FILES:append:bsp-next = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}"


And finally, define the TI_WKS_INITRAMFS variable that patch 3 now 
references.

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}"


I think that with all of this in place, we can start doing some builds 
and working with the test team to update the board configs to start 
picking them up (if available) and using them in the test farm.
diff mbox series

Patch

diff --git a/meta-ti-bsp/conf/machine/include/ti-soc.inc b/meta-ti-bsp/conf/machine/include/ti-soc.inc
index 1d18ceab..68606cc4 100644
--- a/meta-ti-bsp/conf/machine/include/ti-soc.inc
+++ b/meta-ti-bsp/conf/machine/include/ti-soc.inc
@@ -28,4 +28,12 @@  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 ?= ""
\ No newline at end of file
+TI_INITRAMFS_KERNEL_MODULES ?= ""
+
+BUILD_CORE_INITRAMFS_IMAGE ?= ""
+BUILD_CORE_INITRAMFS_IMAGE:bsp-mainline = "ti-core-initramfs:do_image_complete"
+BUILD_CORE_INITRAMFS_IMAGE:bsp-next = "ti-core-initramfs:do_image_complete"
+do_image_complete[depends] += "${BUILD_CORE_INITRAMFS_IMAGE}"
+
+IMAGE_BOOT_FILES:append:bsp-mainline = " ti-core-initramfs.cpio.xz"
+IMAGE_BOOT_FILES:append:bsp-next = " ti-core-initramfs.cpio.xz"
\ No newline at end of file