Add files to /var/ during Yocto build (OSTree)

Greetings @TimSiegrist,

If you want to do this with Yocto, you would need to do the following.

You need to append to this variable somewhere in your Yocto build TEZI_ROOT_FILELIST. The entries in this variable are space separated, and each entry should have the following format:

<name of your file>:<location in  filesystem you want Easy Installer to flash it to>

So for example going with your use-case if you want to install a M7 binary to /var it would look something like this:

my_m7_binary.bin:/ostree/deploy/torizon/var/

You mentioned you also have a *.tar file as well. In that case there would be a third parameter based on whether you want this tar to be unpacked or not. So the following:

my_tarball.tar:/ostree/deploy/torizon/var/:true

Would unpack the provided tar archive to /var in the final booted filesystem.

Once you have TEZI_ROOT_FILELIST properly set, you then need to make sure the actual files themselves are available in ${IMGDEPLOYDIR}, before the TEZI related functions get executed in Yocto. So either create some recipe or bbclass that will make these files available in this location. If you want a reference or example of all of this, you can find one in our meta-layer here: meta-toradex-torizon/classes/torizon_base_image_type.inc at scarthgap-7.x.y · torizon/meta-toradex-torizon · GitHub

This basically adds an optional tarball containing some provisioning data for Torizon Cloud to the Yocto build to be installed by TEZI.

Alternatively, if you end up wanting to do this outside of Yocto you would just basically need to do what is described here: Torizon Core Builder deploy permanent data to EasyInstaller Image - #7 by jeremias.tx

Arguably might be easier/simpler to have a post Yocto script that modifies the TEZI image to add your files rather than doing that part in Yocto. But I’ll leave that discretion up to you.

Best Regards,
Jeremias