Need to reset OSTree

I’m trying to do a build, and getting an error message.

Deploying OSTree with checksum 593ee8037f1f23fe711c107679094387ca4969b2739f7c04e98c7c8e1424600d
An unexpected Exception occurred. Please provide the following stack trace to
the Toradex TorizonCore support team:

Traceback (most recent call last):File “/builder/torizoncore-builder”, line 231, in mainargs.func(mainargs)File “/builder/tcbuilder/cli/build.py”, line 668, in do_buildbuild(args.config_fname, args.storage_directory,File “/builder/tcbuilder/cli/build.py”, line 654, in buildraise excFile “/builder/tcbuilder/cli/build.py”, line 639, in buildhandle_output_section(File “/builder/tcbuilder/cli/build.py”, line 309, in handle_output_sectionhandle_easy_installer_output(tezi_props, storage_dir, union_params)File “/builder/tcbuilder/cli/build.py”, line 385, in handle_easy_installer_outputdeploy_cli.deploy_tezi_image(**deploy_tezi_image_params)File “/builder/tcbuilder/cli/deploy.py”, line 62, in deploy_tezi_imagedbe.deploy_tezi_image(tezi_dir, src_sysroot_dir, src_ostree_archive_dir,File “/builder/tcbuilder/backend/deploy.py”, line 289, in deploy_tezi_imagedeploy_ostree_local(src_sysroot_dir, src_ostree_archive_dir, dst_sysroot_dir, ref)File “/builder/tcbuilder/backend/deploy.py”, line 271, in deploy_ostree_localdeploy_rootfs(sysroot, src_sysroot_dir, csumdeploy, “torizon”, srckargs)File “/builder/tcbuilder/backend/deploy.py”, line 105, in deploy_rootfsresult, deployment = sysroot.deploy_tree(gi.repository.GLib.GError: g-io-error-quark: Preparing /etc: Tree contains both /etc and /usr/etc (0)

I was using /usr/etc as the path in the customization:filesystem in my tcbuild.yaml. I switched it to just using /etc

How do I “clear out” anything existing from OSTree and start fresh?

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Clearing OSTree and Starting Fresh with TorizonCore Builder

The error you’re encountering indicates a conflict between /etc and /usr/etc in your OSTree deployment(1). This happens when OSTree finds both directories during the deployment process, which creates an ambiguous situation for the 3-way merge mechanism that OSTree uses for /etc(1).

Understanding the Issue

OSTree handles /etc as a special directory that performs a 3-way merge using the old default configuration, the active system’s /etc, and the new default configuration(1). When both /etc and /usr/etc are present, OSTree cannot determine which one to use for this merge process(1).

How to Clear OSTree and Start Fresh

To clear out existing OSTree data and start fresh with TorizonCore Builder, you have several options:

Option 1: Remove Storage Directory

If you’re using a specific storage directory for TorizonCore Builder, you can simply remove it and let the tool recreate it. The storage directory contains all the intermediate OSTree data(2).

Option 2: Use Fresh Working Directory

Create a new working directory for your TorizonCore Builder project and start the build process from there(3).

Option 3: Clean OSTree References

You can use the OSTree commands within TorizonCore Builder to manage references. The tool provides OSTree operational commands for this purpose(2).

Correcting Your Configuration

You’ve already identified the correct solution by switching from /usr/etc to /etc in your customization:filesystem section(4). This is the proper approach because:

  • OSTree expects configuration files to be in /etc(1)
  • The /etc directory is handled specially during OSTree deployments with 3-way merging(1)
  • Using /usr/etc creates conflicts with OSTree’s expected directory structure(1)

Best Practices for Filesystem Customization

When using the customization:filesystem property in your tcbuild.yaml file(3):

  1. Use /etc for configuration files, not /usr/etc(1)
  2. Ensure your directory structure matches OSTree expectations(1)
  3. Remember that /etc will be merged during updates, while /var and /home remain persistent(1)

Your corrected approach of using /etc instead of /usr/etc should resolve the deployment error and allow your build to complete successfully.

Best regards, Toradex AI Assistant.

Greetings @kdubious,

I’m not sure what you did exactly here, but you should almost never touch /usr/etc in an OSTree.

To restart fresh, just simply use TorizonCore Builder to unpack a fresh unmodified OS image this will reset the state.

Best Regards,
Jeremias