You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a417a15
Browse filesBrowse the repository at this point in the historyBrowse files
ostree-ext: preserve directory metadata from OCI layers
When building a derived image from OCI layers, the ostree `UnionFiles`
checkout preserves directory metadata (mode, uid, gid) from the first
layer that created the directory. This means later layers that only
modify metadata (e.g. `RUN chmod 0555 /usr`) are silently lost.
OCI semantics and composefs-rs require last-layer-wins, but this should
be handled by [3].
For root specifically, copy the mode, uid and gid from /usr (matching
the approach by composefs-rs [1]) since OCI images don't reliably
include root directory metadata, and container runtimes disagree on how
to apply it when present. Unlike composefs-rs, mtime
and xattrs are not copied. ostree dirmeta has no mtime field, and the
SELinux relabelling pass assigns the root its own label.
This should fix systemd-tmpfiles failures on read-only root systems
with systemd v261+. See: [2]
Assisted-by: llm
Signed-off-by: Rolv Apneseth <rolv.apneseth@gmail.com>
[1]: https://docs.rs/composefs/0.9.4/composefs/generic_tree/struct.FileSystem.html#method.copy_root_metadata_from_usr
[2]: coreos/fedora-coreos-tracker#2238
[3]: #2236
0 commit comments