possible composefs /etc improvements

Open
#2,627 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
linux, rust

Research direction

The issue identifies the composefs backend, /etc deployment handling, and the three-way merge, but names no source files or tests. Start by locating the composefs deployment path and reading how it copies and merges /etc; then assess whether an overlayfs or reflink approach is viable. Done means a chosen approach is implemented and verified to preserve the existing merge behavior while avoiding unnecessary file copies.

Written by the indexing model from the issue text.

Description

Currently with the composefs backend populating /etc for a deployment is basically:

  • mount the erofs for the new image
  • cp -a /etc into /sysroot/state/deploy/*/etc
  • does the 3-way merge in place, and then bind mounts the deployment /etc directly into the final system

At the very least instead of copying all of the files out of the image on each deployment, we should be able to reflink each from the object store and not duplicate the data.

Going a bit further, we could do something like:

  • /sysroot/state/deploy/*/etc instead just becomes an overlayfs upperdir
  • we mount the erofs from the image and use its /etc as a lowerdir with above
  • perform the 3-way merge on the overlay

No copying (except for internal overlay ops), and I think this also allows us to optimize the 3-way merge? Since we can just look at the upperdir on the previous deployment to know exactly which files have been modified and do the copy (reflink?) directly from those files.

Something like that. I haven't looked into proving this out, but wanted to write it down before I forget.

Dominant language
Rust
Stars
2.3k
Forks
230
Avg merge
2d 11h
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bootc-dev/bootc

All issues in bootc-dev/bootc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.