Skip to main content
Associate III
November 2, 2023
Solved

Where are bootfs, userfs, and vendorfs installed by bitbake?

  • November 2, 2023
  • 1 reply
  • 3699 views

I am bitbaking the core-image-minimal image, for a plain yocto poky distribution (Kirkstone), using stm32mp1 as my machine, and I am trying to figure out how the various st partition images are included in the build process. 

That is, how and where are the st-image-bootfs.bb, st-image-userfs.bb  and st-image-vendorfs.bb included in the core-image-minimal build? Everything is build as intended, but I cannot figure out how.

I cannot find anywhere, where the recipes are added to any of the environment variables I usually use to include recipes, (IMAGE_INSTALL, PACKAGE_INSTALL, etc.).

The only place I can find a reference to, for instance the bootfs recipe, is in meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc

STM32MP_BOOTFS_IMAGE ?= "st-image-bootfs"

 But I cannot trace that to how the recipe is included in the build.

Please help.

This topic has been closed for replies.
Best answer by Erwan SZYMANSKI

@mjuels ,
It looks a little bit tricky. In fact, you have to consider st-images-vendorfs, st-image-userfs and so on as real image. BUT, when you compile with Yocto/Bitbake, you choose to compile one unique image, not multiple ones.

In our case, we must compile also these other images, but without being able to say it clearly to Bitbake, so how to do ? The trick is here, integration team adds a dependency on a task of each other partition in the script I highlighted, <partition>:do_<...>, so the dependency is made by a workaround solution. 

To go further, we could imagine that the do_populate_lic_deploy could have been a different task than this one. The idea is to create the dependency with the image, not particularly with the task. Of course the task is not chosen randomly and there is a reason why they took this one, but do not focus on the task taken but more on the dependency created between your main image and partitions images.

I hope it is clear, not easy to explain I admit.

Kind regards,
Erwan.

1 reply

Erwan SZYMANSKI
Technical Moderator
November 3, 2023

Hello @mjuels ,
The dependencies on these different recipes are not explicit, as hidden inside a function located in st-partitions-image.bbclassaround line 100. You will see a comment saying Make sure to append the partition build to current image target. This is the script below that do the job.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
mjuelsAuthor
Associate III
November 4, 2023

Hello Erwan,

Thank you for the reply!

I went throguh the file, and I see how the IMAGE_PARTITIONS gets analyzed for the content defined in
meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc

I do not however understand which part of the script that tells bitbake to run the recipe?

I can see that the script sets up a number of variables. eg. IMAGE_PARTITION_MOUNTPOINT, IMAGE_ROOTFS_SIZE, for each file system, and that the file-system information is pushed to the image_partitions variable, but from there I do not see how it is used?

In the section of the script you reference, there is an explicit check "if current_image_name not in image_partitions ..." which excludes everything already set up in image_partitions, so I cannot see how the content of image_partitions is used in relation to bitbake.

Can you elaborate a bit on how the recipes are implicitly included based on the work done by the script?


Thank you for your assistance!

Best regards

mjuelsAuthor
Associate III
November 8, 2023

Hello @Erwan SZYMANSKI 

Thank you for your reply - It has increased my insight a bit, but can you possibly elaborate on some of the details in my other reply?

As I mentioned, I can see that the script sets up a number of variables. eg. IMAGE_PARTITION_MOUNTPOINT, IMAGE_ROOTFS_SIZE, for each file system, and that the file-system information is pushed to the image_partitions variable.

However, I do not yet understand how any of this is subsequently used to tell bitbake to run the recipes?

 

Best regards