new file mode 100644
@@ -0,0 +1,23 @@
+#------------------------------------------------------------------------------
+#
+# To turn off the ti-core-initramfs.cpio creation just set:
+#
+# TI_CORE_INITRAMFS_ENABLED = "0"
+#
+#------------------------------------------------------------------------------
+TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') or bb.utils.contains('DISTRO_FEATURES', 'luks', True, False, d) else '0'}"
+
+TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
+TI_CORE_INITRAMFS_EXTRA_INSTALL ?= ""
+
+TI_CORE_INITRAMFS_IMAGE = "ti-core-initramfs"
+TI_CORE_INITRAMFS_IMAGE_FILE = "${TI_CORE_INITRAMFS_IMAGE}.cpio.xz"
+
+#------------------------------------------------------------------------------
+# Apply all of the needed changes to create/use the initramfs (if enabled).
+#------------------------------------------------------------------------------
+do_image_wic[depends] += "${@ '${TI_CORE_INITRAMFS_IMAGE}:do_image_complete' if d.getVar('TI_CORE_INITRAMFS_ENABLED') == "1" else ''}"
+
+TI_WKS_INITRAMFS ?= "${@ ',initrd=${TI_CORE_INITRAMFS_IMAGE_FILE}' if d.getVar('TI_CORE_INITRAMFS_ENABLED') == "1" else ''}"
+
+IMAGE_BOOT_FILES += "${@ '${TI_CORE_INITRAMFS_IMAGE_FILE}' if d.getVar('TI_CORE_INITRAMFS_ENABLED') == "1" else ''}"
@@ -3,6 +3,7 @@
SOC_FAMILY = "ti-soc"
require conf/machine/include/soc-family.inc
require conf/machine/include/ti-extras.inc
+require conf/machine/include/ti-core-initramfs.inc
# kernel, initrd load addresses for the fitImage in all TI platforms
UBOOT_ENTRYPOINT = "0x82000000"
new file mode 100644
@@ -0,0 +1,27 @@
+SUMMARY = "Minimal initramfs for boot requirements"
+
+LICENSE = "MIT"
+
+PV = "1.0"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
+
+RDEPENDS:${PN} += "\
+ ${TI_CORE_INITRAMFS_KERNEL_MODULES} \
+ ${VIRTUAL-RUNTIME_base-utils} \
+ ${VIRTUAL-RUNTIME_login_manager} \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ${VIRTUAL-RUNTIME_dev_manager} \
+ ${VIRTUAL-RUNTIME_update-alternatives} \
+ netbase \
+ base-files \
+ base-passwd \
+ initramfs-framework-base \
+ initramfs-module-udev \
+ initramfs-module-nfsrootfs \
+ nfs-utils-mount \
+"
new file mode 100644
@@ -0,0 +1,39 @@
+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"
+
+PV = "1.0"
+
+INITRAMFS_FSTYPES = "cpio cpio.xz"
+
+INITRAMFS_MAXSIZE = "131072"
+
+IMAGE_NAME = "ti-core-initramfs"
+
+export IMAGE_BASENAME = "${IMAGE_NAME}"
+
+TI_CORE_INITRAMFS_EXTRA_INSTALL ?= ""
+
+PACKAGE_INSTALL = "\
+ packagegroup-ti-core-initramfs \
+ ${TI_CORE_INITRAMFS_EXTRA_INSTALL} \
+"
+
+# Ensure the initramfs only contains the bare minimum
+IMAGE_FEATURES = ""
+IMAGE_LINGUAS = ""
+
+# on the kernel image.
+PACKAGE_EXCLUDE = "kernel-image-*"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+IMAGE_NAME_SUFFIX ?= ""
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+inherit image
Introduce a minimal initramfs image used to probe boot-essential and other modules that cannot be built directly into the upstream Linux kernel image without growing it unnecessarily. ti-soc.inc wires the enable/trigger logic (ti-core-initramfs.inc) in so any K3 image's do_image_wic automatically depends on it once TI_CORE_INITRAMFS_ENABLED is set. Signed-off-by: Moteen Shah <m-shah@ti.com> --- v3: Add missing PV = "1.0" to both new recipes v2: Simplified subject line .../machine/include/ti-core-initramfs.inc | 23 +++++++++++ meta-ti-bsp/conf/machine/include/ti-soc.inc | 1 + .../packagegroup-ti-core-initramfs.bb | 27 +++++++++++++ .../recipes-ti/initramfs/ti-core-initramfs.bb | 39 +++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc 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 -- 2.34.1