Add recipes to build initramfs image
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.
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).
Moteen Shah (2):
recipes-ti: initrd: Make minimal initrd image
meta-ti-bsp: wic: Add a new GRUB config for ti platforms
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56 +++++++++++++++++++ meta-ti-bsp/wic/sdimage-2part-efi.wks.in | 2 +- meta-ti-bsp/wic/ti-grub.cfg | 14 +++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb create mode 100644 meta-ti-bsp/wic/ti-grub.cfg
Signature · 1 line
2.34.1
PATCH 1/2 recipes-ti: initrd: Make minimal initrd image
Introduce 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.
--- .../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5 -0
@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"
meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +56 -0
56 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process.
The best way to accomplish that will likely be to follow the firmware
approach and include it in the MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS variable for each platform that requires it.
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES ?= ""
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable TI_INITRAMFS_KERNEL_MODULES.
This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS list for all platforms.
Did I miss anything, Denys?
Quoted 86 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>--- .../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56 +++++++++++++++++++ 2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +56
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# 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 · 3 lines
Ryan Eatmon [email protected] ----------------------------------------- Texas Instruments, Inc. - LCPD - MGTS
Re: [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Hey Ryan,
Thanks for the detailed review.
Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.
I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete" ROOTFS_POSTPROCESS_COMMAND += "install_initrd_to_boot; " install_initrd_to_boot() {
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio ${IMAGE_ROOTFS}/boot/initrd.cpio }
in core-image-%.bbappend file to make this image as a part of core image build.
I will look out for how I can achieve the same with MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.
Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
Quoted 7 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""
Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.
Noted.
Regards,
Moteen
Quoted 95 lines
Did I miss anything, Denys?
Quoted 89 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56 +++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +49
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# To further reduce the size of the rootfs, remove the /bootdirectory 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 wemeta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +5
-0+# 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/* +}
Re: [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Quoted 18 lines · Moteen Shah
Hey Ryan,
Thanks for the detailed review.Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete"
ROOTFS_POSTPROCESS_COMMAND+= "install_initrd_to_boot; "install_initrd_to_boot(){
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio
${IMAGE_ROOTFS}/boot/initrd.cpio
}
Quoted 5 lines
in core-image-%.bbappend file to make this image as a part of core image build.
I will look out for how I can achieve the same with
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
There are more distributions than just poky and arago. The solution I suggested will work for all of them and not require anything specific like your solution.
Quoted 123 lines
Quoted 7 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.Noted.
Regards,
MoteenQuoted 95 lines
Did I miss anything, Denys?
Quoted 89 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56 +++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +49
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# To further reduce the size of the rootfs, remove the /bootdirectory 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 wemeta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +5
-0+# 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 · 3 lines
Ryan Eatmon [email protected] ----------------------------------------- Texas Instruments, Inc. - LCPD - MGTS
Re: [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Hey Ryan,
Quoted 20 lines · Ryan Eatmon
Quoted 17 lines · Moteen Shah
Hey Ryan,
Thanks for the detailed review.Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete"
ROOTFS_POSTPROCESS_COMMAND+= "install_initrd_to_boot; "install_initrd_to_boot(){
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio ${IMAGE_ROOTFS}/boot/initrd.cpio }
Quoted 8 lines
Quoted 5 lines
in core-image-%.bbappend file to make this image as a part of core image build.
I will look out for how I can achieve the same with
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
There are more distributions than just poky and arago. The solution I suggested will work for all of them and not require anything specific like your solution.
Understood, I will use MACHINE_ESSENTIAL_EXTRA_RRECOMMEND inside k3.inc, but how should I include the initrd image in the boot directory of the root partition, since initrd itself is an image I cannot use ${IMAGE_ROOTFS} inside ti-initrd-image.bb. I did found a way around it https://lists.yoctoproject.org/g/yocto/message/47500, not really sure if its the correct way.
Regards,
Moteen
Quoted 126 lines
Quoted 125 lines
Quoted 8 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.Noted.
Regards,
MoteenQuoted 96 lines
Did I miss anything, Denys?
Quoted 90 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56
+++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +49
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# To further reduce the size of the rootfs, remove the /bootdirectory 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 wemeta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +5
-0+# 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/* +}
Re: [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Quoted 25 lines · Moteen Shah
Hey Ryan,
Quoted 22 lines · Ryan Eatmon
Quoted 19 lines · Moteen Shah
Hey Ryan,
Thanks for the detailed review.Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete"
ROOTFS_POSTPROCESS_COMMAND+= "install_initrd_to_boot; "install_initrd_to_boot(){
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio ${IMAGE_ROOTFS}/boot/initrd.cpio }in core-image-%.bbappend file to make this image as a part of core image build.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
I will look out for how I can achieve the same with
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
There are more distributions than just poky and arago. The solution I suggested will work for all of them and not require anything specific like your solution.
Understood, I will use
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDinside k3.inc, but how should I include the initrd image in the boot directory of the root partition, since initrd itself is an image I cannot use ${IMAGE_ROOTFS} inside ti-initrd-image.bb. I did found a way around it https://lists.yoctoproject.org/g/yocto/message/47500, not really sure if its the correct way.
Why does the initrd need to be in the rootfs? The whole point of this initrd is to get the kernel to boot to get to the point of loading the rootfs, at which point the initrd has served it's purpose.
Quoted 129 lines
Regards,
MoteenQuoted 126 lines
Quoted 125 lines
Quoted 8 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.Noted.
Regards,
MoteenQuoted 96 lines
Did I miss anything, Denys?
Quoted 90 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56
+++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +49
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# To further reduce the size of the rootfs, remove the /bootdirectory 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 wemeta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +5
-0+# 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 · 3 lines
Ryan Eatmon [email protected] ----------------------------------------- Texas Instruments, Inc. - LCPD - MGTS
Re: [meta-ti] [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Quoted 30 lines · Ryan Eatmon via lists.yoctoproject.org
Quoted 27 lines · Moteen Shah
Hey Ryan,
Quoted 24 lines · Ryan Eatmon
Quoted 21 lines · Moteen Shah
Hey Ryan,
Thanks for the detailed review.Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete"
ROOTFS_POSTPROCESS_COMMAND+= "install_initrd_to_boot; "install_initrd_to_boot(){
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio ${IMAGE_ROOTFS}/boot/initrd.cpio }in core-image-%.bbappend file to make this image as a part of core image build.
I will look out for how I can achieve the same with
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
There are more distributions than just poky and arago. The solution I suggested will work for all of them and not require anything specific like your solution.
Understood, I will use
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDinside k3.inc, but how should I include the initrd image in the boot directory of the root partition, since initrd itself is an image I cannot use ${IMAGE_ROOTFS} inside ti-initrd-image.bb. I did found a way around it https://lists.yoctoproject.org/g/yocto/message/47500, not really sure if its the correct way.Why does the initrd need to be in the rootfs? The whole point of this initrd is to get the kernel to boot to get to the point of loading the rootfs, at which point the initrd has served it's purpose.
I was keeping it inside the rootfs to avoid increasing size of the boot partition, grub was able to read/load it from any of the required partitions given in the SD Card. I will put it in the boot partition after increasing its size then in v2.
Regards,
Moteen
Quoted 141 lines
Quoted 131 lines
Regards,
MoteenQuoted 126 lines
Quoted 125 lines
Quoted 8 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.Noted.
Regards,
MoteenQuoted 96 lines
Did I miss anything, Denys?
Quoted 90 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56
+++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +49
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# To further reduce the size of the rootfs, remove the /bootdirectory 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 wemeta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +5
-0+# 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/* +}-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19017): https://lists.yoctoproject.org/g/meta-ti/message/19017
Mute This Topic: https://lists.yoctoproject.org/mt/115128108/9997635
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [meta-ti] [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Quoted 34 lines · Moteen Shah via lists.yoctoproject.org
Quoted 32 lines · Ryan Eatmon via lists.yoctoproject.org
Quoted 29 lines · Moteen Shah
Hey Ryan,
Quoted 26 lines · Ryan Eatmon
Quoted 22 lines · Moteen Shah
Hey Ryan,
Thanks for the detailed review.Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete"
ROOTFS_POSTPROCESS_COMMAND+= "install_initrd_to_boot; "install_initrd_to_boot(){
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio ${IMAGE_ROOTFS}/boot/initrd.cpio }in core-image-%.bbappend file to make this image as a part of core image build.
I will look out for how I can achieve the same with
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
There are more distributions than just poky and arago. The solution I suggested will work for all of them and not require anything specific like your solution.
Understood, I will use
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDinside k3.inc, but how should I include the initrd image in the boot directory of the root partition, since initrd itself is an image I cannot use ${IMAGE_ROOTFS} inside ti-initrd-image.bb. I did found a way around it https://lists.yoctoproject.org/g/yocto/message/47500, not really sure if its the correct way.Why does the initrd need to be in the rootfs? The whole point of this initrd is to get the kernel to boot to get to the point of loading the rootfs, at which point the initrd has served it's purpose.
I was keeping it inside the rootfs to avoid increasing size of the boot partition, grub was able to read/load it from any of the required partitions given in the SD Card. I will put it in the boot partition after increasing its size then in v2.
Rootfs is the right spot, it should go in the same spot as the other Linux boot components (kernel and DTB) which we should have in rootfs.
Andrew
Quoted 144 lines
Regards,
MoteenQuoted 119 lines
Quoted 119 lines
Regards,
MoteenQuoted 114 lines
Quoted 114 lines
Quoted 8 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.Noted.
Regards,
MoteenQuoted 85 lines
Did I miss anything, Denys?
Quoted 80 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56 +++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +50
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# 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 = ""Quoted 12 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb line 56
Quoted 6 lines
meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +6
-0+# 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/* +}-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19030): https://lists.yoctoproject.org/g/meta-ti/message/19030
Mute This Topic: https://lists.yoctoproject.org/mt/115128108/3619733
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [meta-ti] [master][PATCH 1/2] recipes-ti: initrd: Make minimal initrd image
Hey Ryan,
Quoted 29 lines · Moteen Shah via lists.yoctoproject.org
Hey Ryan,
Quoted 26 lines · Ryan Eatmon
Quoted 22 lines · Moteen Shah
Hey Ryan,
Thanks for the detailed review.Quoted 4 lines · Ryan Eatmon
After some discussion in a call with Denys today, I think we have some feedback on what is needed to better leverage this patch idea.
1) We need the way to get this image built as part of the build process. The best way to accomplish that will likely be to follow the firmware approach and include it in the
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSvariable for each platform that requires it.I was planning to do something like:
do_rootfs[depends] += "ti-initrd-image:do_image_complete"
ROOTFS_POSTPROCESS_COMMAND+= "install_initrd_to_boot; "install_initrd_to_boot(){
install -m 0644 ${DEPLOY_DIR_IMAGE}/initrd.cpio ${IMAGE_ROOTFS}/boot/initrd.cpio }in core-image-%.bbappend file to make this image as a part of core image build.
I will look out for how I can achieve the same with
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.Is the above solution optimal though? Since all of the K3 platforms will be shifting to the initrd flow.
Quoted 8 lines
Quoted 2 lines
There are more distributions than just poky and arago. The solution I suggested will work for all of them and not require anything specific like your solution.
Understood, I will use
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDinside k3.inc, but how should I include the initrd image in the boot directory of the root partition, since initrd itself is an image I cannot use ${IMAGE_ROOTFS} inside ti-initrd-image.bb. I did found a way around it https://lists.yoctoproject.org/g/yocto/message/47500, not really sure if its the correct way.Regards,
Moteen
Adding on the thread, using MACHINE_ESSENTIAL_EXTRA_RRECOMMEND does not builds the initrd.cpio. I suspect that the tag is used to include packages and since ti-initrd-image is recipe for image itself and not a package it does not work. As a workaround to the issue, I am using:
do_image_complete[depends] += "ti-initrd-image:do_image_complete"
in the platform specific .inc files.
Regards,
Moteen
Quoted 135 lines
Quoted 117 lines
Quoted 117 lines
Quoted 8 lines
2) We need a better way to specify the list of MODULES rather than hardcoding the list in the recipe. The list of required modules will likely be different for different platforms.
To that end we recommend creating a new variable that should be defined in the ti-soc.inc:
TI_INITRAMFS_KERNEL_MODULES?= ""Quoted 8 lines
Then in each platform specific .inc file we can set that list to the needed modules based on the ti-bsp need. Our vendor kernels do not need it, so it could remain blank, but the mainline/next bsps could set it since those actually create the kernel module packages.
TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " mod1 mod2" TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " mod1 mod2"
Then in the ti-initrd-image.bb you would drop the MODULES="" setting and just change to the variable
TI_INITRAMFS_KERNEL_MODULES.This way, if there are other layers that want to create their own initramfs we have a variable in place for them to use to include the required modules based on the kernel version that is being built.
Seems like a better solution for including the modules, I'll fix it in v2.
Quoted 4 lines
So, I would probably break all of this up into multiple patches. The first patch would the work in #2 above to establish the needed variable for all platforms. The next patches are your patches but moving to TI_INITRAMFS_KERNEL_MODULES. And the final patch would be adding your new ti-initrd-image into
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDSlist for all platforms.Noted.
Regards,
MoteenQuoted 88 lines
Did I miss anything, Denys?
Quoted 83 lines · Moteen Shah
Introduce 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.
Signed-off-by Moteen Shah <[email protected]>---
.../initrd/packagegroup-ti-initrd.bb | 5 ++ .../recipes-ti/initrd/ti-initrd-image.bb | 56
+++++++++++++++++++2 files changed, 61 insertions(+)create mode 100644 meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb create mode 100644 meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb
meta-ti-bsp/recipes-ti/initrd/packagegroup-ti-initrd.bb new file +5
-0@@ -0,0 +1,5 @@ +SUMMARY = "Minimal initrd for boot requirements" + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +49
-0@@ -0,0 +1,56 @@ +SUMMARY = "TI SDK minimal initrd 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 = "initrd" + +IMAGE_NAME_SUFFIX = "" + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-udev \ + initramfs-module-nfsrootfs \ +" + +MODULES = "\ + kernel-module-cdns-pltfrm \ + kernel-module-ti-j721e-ufs \ + kernel-module-tps6594-i2c \ +" + +UTILS = "\ + cifs-utils \ + nfs-utils \ + nfs-utils-client \ +" + +PACKAGE_INSTALL = "\ + ${INITRAMFS_SCRIPTS} \ + ${UTILS} \ + ${MODULES} \ + packagegroup-ti-initrd \ +" + +export IMAGE_BASENAME = "ti-initrd-image" + +# To further reduce the size of the rootfs, remove the /bootdirectory from
+# the final image this is usually done by adding
RDEPENDS_kernel-base = ""Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb line 56
Quoted 7 lines
+# in the configuration file. In our case we can't use this method. Instead we
meta-ti-bsp/recipes-ti/initrd/ti-initrd-image.bb new file +5
-0+# 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/* +}-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19015): https://lists.yoctoproject.org/g/meta-ti/message/19015
Mute This Topic: https://lists.yoctoproject.org/mt/115128108/9997635
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
PATCH 2/2 meta-ti-bsp: wic: Add a new GRUB config for ti platforms
In reply to Moteen ShahAdd a new grub config for TI specific platforms. While, only supporting to boot linux from filesystem on MMC for now, it will support booting linux and initrd image from OSPI, UFS later down the line. Hence, make a new config altogether for easier development.
--- meta-ti-bsp/wic/sdimage-2part-efi.wks.in | 2 +- meta-ti-bsp/wic/ti-grub.cfg | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 meta-ti-bsp/wic/ti-grub.cfg
meta-ti-bsp/wic/sdimage-2part-efi.wks.in +1 -1
@@ -3,6 +3,6 @@ # supports EFI. Boot files are located in the first vfat partition with extra # reserved space. We cannot use a GPT here. -bootloader --timeout=3 --append="rootfstype=ext4 ${TI_WKS_BOOTLOADER_APPEND}" +bootloader --configfile="ti-grub.cfg" part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid
meta-ti-bsp/wic/ti-grub.cfg new file +14 -0
@@ -0,0 +1,14 @@ +# Set timeout and default options +set timeout=3 +set default=0 +set root_part=(hd0,msdos2) + +# Define paths to kernel and initrd in root partition +set kernel_path="${root_part}/boot/Image" +set initrd_path="${root_part}/boot/initrd.cpio" + +# Main boot entry +menuentry "Boot Linux" { + linux ${kernel_path} root=/dev/disk/by-label/root rootwait rootfstype=ext4 + initrd ${initrd_path} +}
Signature · 1 line
2.34.1
meta-ti / na / 20250908105315.19583-1-m-shah
PRC Results: PASS
=========================================================
check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
All patches passed
=========================================================
apply-yocto-patch: PASS
=========================================================
master
=====================
Summary:
- Patch Series: [master][PATCH 0/1] Add recipes to build initramfs image
- Submitter: From: Moteen Shah <[email protected]>
- Date: Date: Mon, 8 Sep 2025 16:23:13 +0530
- Num Patches: 1
- Mailing List (public inbox) Commit SHA: c607a2ea4fc8808bb3da64e42d635284f0ee6602
Applied to:
- Repository: lcpd-prc-meta-ti
- Base Branch: master-wip
- Commit Author: Ryan Eatmon <[email protected]>
- Commit Subject: optee-ftpm: Add TI version override for ftpm
- Commit SHA: 106d575e5879911420c5ad4d486bda3e8164f4c9
Patches
----------------------------------------
All patches applied
=========================================================
check-yocto-repo: PASS
=========================================================
master
=====================
PASS