composefs backend: support state overlays (writable, image-reconciled subdirectories)

オープン
#2,643 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
linux, rust

調査の方向性

Start by reading the composefs backend implementation and the existing ostree state overlay behavior; the issue links ostreedev/ostree#3691 and bootc-dev/bootc#1190 for context. Check how the composefs root is assembled and where bootc-composefs.7.md documents known issues. Done means unsealed state overlays have the stated persistence, deployment reconciliation, and rollback behavior, with sealed behavior documented if unsupported.

索引モデルが issue の本文から書いたものです。

説明

Summary

State overlays work on the ostree backend and not on the composefs backend. It would be good to support them there, at least in the unsealed configuration, and to add them to the known issues list in bootc-composefs.7.md until then.

When the composefs-native backend was planned, bootc-dev/bootc#1190 listed the state overlay docs among ostree-era features the composefs path would need to keep honoring (https://github.com/bootc-dev/bootc/issues/1190#issuecomment-2714380763). The backend is now stable, but state overlays are not on its parity list, have no tracking issue, and are silently skipped (ostreedev/ostree#3691).

The use case

Many third-party host agents, especially security agents, install into /opt/<vendor> and write there at runtime: binaries, version symlinks, enrollment identity, and vendor-delivered content in one tree the vendor will not restructure. Two patterns:

  1. State and binaries mixed under /opt. A writable directory whose binaries still come from the image. ostreedev/ostree#3120 named this case: software in /opt "often mixes code and state". ostreedev/ostree#3553 was filed by someone doing this for a vulnerability scanner agent.
  2. In-place self-updaters. The agent's management plane pushes new files into its install directory (bootc-dev/bootc#2468 asked for a variant of this). State overlays do not make those updates permanent (the image wins at the next deployment change), but the agent runs and keeps its state.
Why state overlays and not the alternatives
  • The image stays the authority. At every deployment change, upper entries that shadow image content are pruned; only files the image does not ship, such as machine identity, are kept. Rollback gives a coherent pair: binaries roll back, identity stays.
  • Relocating the tree to /var is what people do instead, and it is worse. Image content under /var is applied at install only, so the binaries freeze while the OS moves, and rollback cannot resynchronize them. bootc container lint already flags it. At least one vendor's published bootc recipe does it (https://github.com/CrowdStrike/falcon-bootc).
  • It is also simpler for the user. That recipe has to move the tree into /var/opt, symlink it back, and on RHEL 9 add semanage fcontext rules so the moved binaries and libraries get the labels they would have had under /opt. A state overlay is one systemctl enable line: no relocation, no symlinks, no relabeling of the vendor's files, and the vendor's paths stay where it expects them.
  • Splitting state into /var should stay the first recommendation, but only works when the writable paths can be separated from the binaries.
  • A container is best where the vendor ships one, but most security agents are host installs, and logically bound images are not on this backend either (bootc-dev/bootc#2540).

Without state overlays, the composefs backend leaves these users the /var relocation, the least image-governed option. That matters more over time: upstream plans in-place moves from ostree to this backend, and bootc-dev/bootc#1190 framed it as a step toward phasing out ostree.

Suggested scope
  • Unsealed composefs backend: there is no integrity reason to exclude a writable overlay, so the ask is parity with the ostree backend, with the same semantics users rely on today: state written in the directory persists across reboots, content shipped in the image wins when the deployment changes, and rollback behaves the same way. How to build it is up to maintainers, however best fits the composefs root setup.
  • Sealed (fs-verity) configuration: a writable overlay over measured content may be out of scope by design, as bootc-dev/bootc#2507 proposes for usr-overlay. If so, please say so in bootc-composefs.7.md rather than leaving a silent no-op.
Naming

A composefs-native implementation is a natural point to adopt a backend-neutral unit name: [email protected], or [email protected] if an unprefixed name is a concern. Keep ostree-state-overlay@ as an alias so existing images keep working, and use scoped examples (@opt-myvendor, not @opt) in the docs.

Known rough edges, not blockers

No way to see what the overlay holds or what a prune removed (a notice journal line would help; asked in the ostreedev/ostree#3120 review). The merged directory takes mode 0700 and label var_t from the upper, so non-root services cannot read it, and new files in it are labeled var_t. Docs show only the unscoped @opt.service. No state overlay tests in bootc (ostree has one); see also bootc-dev/bootc#1925.

Related
  • ostreedev/ostree#3691: fail visibly instead of skipping on this backend.
  • bootc-dev/bootc#1190, bootc-dev/bootc#2540, bootc-dev/bootc#2507, bootc-dev/bootc#2468, bootc-dev/bootc#1925, ostreedev/ostree#3120.
主要言語
Rust
スター
2.3k
フォーク
230
平均マージ
2日 11時間
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bootc-dev/bootc のほかの issue

bootc-dev/bootc の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。