diff options
| author | Ryan Eatmon <reatmon@ti.com> | 2026-01-09 12:08:14 -0600 |
|---|---|---|
| committer | Ryan Eatmon <reatmon@ti.com> | 2026-01-12 15:01:47 -0600 |
| commit | 54ce94f577ce469941078b1ac272f6a4c60bebba (patch) | |
| tree | f69ef025499cef9b97714319a3bd931ed54d8523 /meta-ti-bsp | |
| parent | 270b7b64452679fdd3d83963ce468a89de86be21 (diff) | |
| download | meta-ti-54ce94f577ce469941078b1ac272f6a4c60bebba.tar.gz | |
ti-core-initramfs: Shrink size of initramfs
It looks like we were modelling this initramfs off of the wrong example
from poky. This setup produces a much smaller initramfs.
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp')
| -rw-r--r-- | meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb | 12 | ||||
| -rw-r--r-- | meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb | 33 |
2 files changed, 22 insertions, 23 deletions
diff --git a/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb b/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb index 86b69aff..c759808c 100644 --- a/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb +++ b/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb | |||
| @@ -1,16 +1,18 @@ | |||
| 1 | SUMMARY = "Minimal initramfs for boot requirements" | 1 | SUMMARY = "Minimal initramfs for boot requirements" |
| 2 | 2 | ||
| 3 | require recipes-core/packagegroups/packagegroup-core-boot.bb | 3 | LICENSE = "MIT" |
| 4 | |||
| 5 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 6 | |||
| 7 | inherit packagegroup | ||
| 4 | 8 | ||
| 5 | TI_INITRAMFS_KERNEL_MODULES ?= "" | 9 | TI_INITRAMFS_KERNEL_MODULES ?= "" |
| 6 | 10 | ||
| 7 | RDEPENDS:${PN} += "\ | 11 | RDEPENDS:${PN} += "\ |
| 8 | ${TI_INITRAMFS_KERNEL_MODULES} \ | 12 | ${TI_INITRAMFS_KERNEL_MODULES} \ |
| 13 | ${VIRTUAL-RUNTIME_base-utils} \ | ||
| 14 | base-passwd \ | ||
| 9 | initramfs-framework-base \ | 15 | initramfs-framework-base \ |
| 10 | initramfs-module-udev \ | 16 | initramfs-module-udev \ |
| 11 | initramfs-module-nfsrootfs \ | 17 | initramfs-module-nfsrootfs \ |
| 12 | nfs-utils \ | ||
| 13 | nfs-utils-client \ | ||
| 14 | " | 18 | " |
| 15 | |||
| 16 | RDEPENDS:${PN}:remove = "grub-efi kernel" | ||
diff --git a/meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb b/meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb index 1a102d82..223fef7a 100644 --- a/meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb +++ b/meta-ti-bsp/recipes-ti/initramfs/ti-core-initramfs.bb | |||
| @@ -7,29 +7,26 @@ DESCRIPTION = "Image meant to probe boot essential modules\ | |||
| 7 | 7 | ||
| 8 | LICENSE = "MIT" | 8 | LICENSE = "MIT" |
| 9 | 9 | ||
| 10 | inherit core-image | 10 | INITRAMFS_FSTYPES = "cpio cpio.xz" |
| 11 | |||
| 12 | IMAGE_NAME = "ti-core-initramfs" | ||
| 13 | |||
| 14 | IMAGE_NAME_SUFFIX = "" | ||
| 15 | 11 | ||
| 16 | IMAGE_FEATURES:remove = "package-management" | 12 | INITRAMFS_MAXSIZE = "65536" |
| 17 | 13 | ||
| 18 | INITRAMFS_FSTYPES = "cpio cpio.xz" | 14 | IMAGE_NAME = "ti-core-initramfs" |
| 19 | 15 | ||
| 20 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | 16 | export IMAGE_BASENAME = "${IMAGE_NAME}" |
| 21 | 17 | ||
| 22 | PACKAGE_INSTALL = "packagegroup-ti-core-initramfs" | 18 | PACKAGE_INSTALL = "packagegroup-ti-core-initramfs" |
| 23 | 19 | ||
| 24 | export IMAGE_BASENAME = "${IMAGE_NAME}" | 20 | # Ensure the initramfs only contains the bare minimum |
| 21 | IMAGE_FEATURES = "" | ||
| 22 | IMAGE_LINGUAS = "" | ||
| 25 | 23 | ||
| 26 | IMAGE_OVERHEAD_FACTOR = "1.1" | 24 | # on the kernel image. |
| 25 | PACKAGE_EXCLUDE = "kernel-image-*" | ||
| 26 | |||
| 27 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | ||
| 28 | IMAGE_NAME_SUFFIX ?= "" | ||
| 29 | IMAGE_ROOTFS_SIZE = "8192" | ||
| 30 | IMAGE_ROOTFS_EXTRA_SPACE = "0" | ||
| 27 | 31 | ||
| 28 | # To further reduce the size of the rootfs, remove the /boot directory from | 32 | inherit image |
| 29 | # the final image this is usually done by adding RDEPENDS_kernel-base = "" | ||
| 30 | # in the configuration file. In our case we can't use this method. Instead we | ||
| 31 | # just wipe out the content of "/boot" before creating the image. | ||
| 32 | ROOTFS_POSTPROCESS_COMMAND += "empty_boot_dir; " | ||
| 33 | empty_boot_dir () { | ||
| 34 | rm -rf ${IMAGE_ROOTFS}/boot/* | ||
| 35 | } | ||
