Clone eMMC and flashing process using verdin imx8

Hello Guys,

I’m using a imx8m with torizonOS, but I just started with a reference image with some docker containers just to have a base image to work with.
I just setup the image, I have all the OS configs set up as well as the docker containers running the apps.
Now, my main doubt is how can I create an image for production?
I did not use the torizon-builder for any of this process, and at least for now I would continue like this for the MVP, and later in the process, with some time to learn new tools, start migrating to using torizon-builder.
For now, not sure if this solution if the best one, but I was thinking of using dd to clone the eMMC drive to an external USB flash drive, and with this, I can get an image of the contents of the eMMC, the problem is the EasyInstaller can only work with specific images and cannot load these type of images.
How can I flash to the internal eMMC a saved image so I can replicate it for production?
Maybe using this GitHub - nxp-imx/mfgtools: Freescale/NXP I.MX Chip image deploy tools.?

Thanks

Greetings @peterz

I’m using a imx8m with torizonOS, but I just started with a reference image with some docker containers just to have a base image to work with.

Just to clarify which OS image are you using here? We have OS images called “reference images” but these are completely different from Torizon OS and do not feature Docker.

Now, my main doubt is how can I create an image for production?
I did not use the torizon-builder for any of this process, and at least for now I would continue like this for the MVP, and later in the process, with some time to learn new tools, start migrating to using torizon-builder.

Our recommendation would be to use TorizonCore Builder to create your production image. We have an article on preparing your custom image for production: Production Programming in Torizon | Toradex Developer Center

For now, not sure if this solution if the best one, but I was thinking of using dd to clone the eMMC drive to an external USB flash drive, and with this, I can get an image of the contents of the eMMC, the problem is the EasyInstaller can only work with specific images and cannot load these type of images.
How can I flash to the internal eMMC a saved image so I can replicate it for production?

While not impossible, we do not recommend this path. We only recommend using Toradex Easy Installer to flash images on our hardware. Is there a reason you’re trying to clone the eMMC and flash things in this way?

Best Regards,
Jeremias

The version used is torizon Core
Linux verdin-imx8mm-14756371 5.15.129-6.5.0+git.6f8fd49366db #1-TorizonCore SMP PREEMPT Fri Dec 22 11:15:52 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Regarding the use of TorizonCore Builder we need a lot of changes at the OS level, multiple services and scripts to do specific tasks and access specific hardware, that is why we opt not to use it.
Until now, I don’t see the need to use it, we just setup our OS and when it is good to go we should be able to replicate it.

Even without recommendation, can at least point to somewhere where we can flash standard images on the eMMC without using easyinstaller?

Regarding the use of TorizonCore Builder we need a lot of changes at the OS level, multiple services and scripts to do specific tasks and access specific hardware, that is why we opt not to use it.

Could you elaborate on the kinds of changes you are doing? TorizonCore Builder is capable of handling quite a bit of OS customizations as seen here: Use Cases Documentation Overview | Toradex Developer Center

Or is there a specific change that you have already determined TorizonCore Builder unable to do?

Until now, I don’t see the need to use it, we just setup our OS and when it is good to go we should be able to replicate it.

If this works for you then that is fine. I would still suggest you consider using TorizonCore Builder, it’s our recommended workflow and we would be able to provide you better support with this. Also if you plan to use any of our other tooling like our VSCode extensions, or our Torizon Cloud services, then the workflow would be smoother.

Even without recommendation, can at least point to somewhere where we can flash standard images on the eMMC without using easyinstaller?

Well you’d probably need some low level tool like the NXP tools you already referenced: GitHub - nxp-imx/mfgtools: Freescale/NXP I.MX Chip image deploy tools.

That said there’s not much guidance we can provide you regarding this alternative method.

Best Regards,
Jeremias

Hello @jeremias.tx ,

We dont have many changes to be truth, but basically we have some services running, that run some scripts that we want that to run outside docker containers using systemd.
We also have docker containers with some specific apps.
So basically it is just the services and scripts outside the docker container, that I’m not sure how to include them with Torizon-Builder.

We dont have many changes to be truth, but basically we have some services running, that run some scripts that we want that to run outside docker containers using systemd.

If that’s the case then this should be doable with TorizonCore Builder. You’ll want to look at this article: Capturing Changes in the Configuration of a Board on Torizon OS | Toradex Developer Center

This feature of TorizonCore Builder can capture any changes in the /etc directory of the OS. It does this by using a base image as a starting point then seeing what is different on your device. It then captures these changes. Systemd services are already in /etc, then you should be able to move your scripts here as well.

We also have docker containers with some specific apps.

TorizonCore Builder can also package your container such that they get deployed to your device during flashing: Pre-provisioning Docker Containers onto a Torizon OS image | Toradex Developer Center

Custom images produced by TorizonCore Builder should be compatible with Toradex Easy Installer for easy deployment.

If you still have any questions or concerns about TorizonCore Builder I’d be happy to clarify. Or we can even schedule a demonstration of the tool for you if you would prefer that.

Best Regards,
Jeremias

Hello @jeremias.tx ,
I try to use first the changes but from what I can test, it can only reproduce the changes on etc/ which has some changes on services, apps, etc, so far so good.
But most of those services call scripts located in /home/user that the changes cannot capture.
Probably I’m not using changes correctly, is there any way I can capture specific folders or copy them to the changes so it can be applied to the new image?

But most of those services call scripts located in /home/user that the changes cannot capture.
Probably I’m not using changes correctly, is there any way I can capture specific folders or copy them to the changes so it can be applied to the new image?

In short, no. Torizon OS uses OSTree to manage changes to the OS. By design OSTree does not manage anything under /var. This is by design as to have a location that is not affected by updates/changes. The /home directory is symlinked under /var therefore it has this property of not being managed. This means TorizonCore Builder can’t capture/manage any new files or directories in this location on the device.

That said, can’t you just simply copy these scripts to somewhere in /etc instead? Is there a reason they need to be in /home?

Best Regards,
Jeremias