I’m fairly new to ostree, but here are my thoughts.
It should be possible to see the difference between the default config and the current deployment using ostree admin config-diff. It will show which files are modified, new or deleted.
The default configuration can be found inside /usr/etc, so using diff on /etc and /usr/etc should also work.
What you are trying to do here sounds much like this github issue. From what I understand doing something like this should already be possible using ostree admin deploy and --no-merge. No idea what the exact command for that would be though.
Using rsync to copy the default config into the /etc directory should also work. See this comment from cgwalters.
yes, this is the solution. I think adding such a feature to rsync those default settings might be good for usability? Even though it sounds like this is possible without.
so the rsync should be a reliable and perfect solution, as that one is upstream and immutable. I wonder if that could be added to rpm-ostree, or if that would not be possible
I don’t think that rsync is a perfect solution. There are files that shouldn’t be deleted (fstab, crypttab) or the system doesn’t remain bootable. A reset command should probably have a build in list with files to keep. Using rsync will also modify the current deployment which isn’t great, it would be better to create a new one with the restored /etc so it is easy to rollback.
So I think that seeing the difference is possible, but doing a complete reset isn’t yet. It is possible, but you would need to carefully look at the diff and keep the important files. Would probably be interesting to have a full list of files that should be kept. After that we could probably create a script that does the reset.
There is also the very excellent libostree documentation at libostree | ostreedev/ostree and of course the rpm-ostree documentation found at A true hybrid image/package system | rpm-ostree
And libostree would need to “know” what is different in order to perform the three-way merge that creates the local commit.
I really like utils like “cheat” which present an opinionated, small subset of commands.
Is maintaining a page like that in scope of Fedora?
cat >> ~/.config/fish/functions/custom-functions.fish <<EOF
function cheat
curl cheat.sh/$argv[1]
end
EOF
$ cheat rpm-ostree
# rpm-ostree
# A hybrid image/package system.
# Manage ostree deployments, package layers, filesystem overlays, and boot configuration.
# More information: <https://coreos.github.io/rpm-ostree/administrator-handbook/>.
# Show rpm-ostree deployments in the order they will appear in the bootloader:
rpm-ostree status
# Show packages which are outdated and can be updated:
rpm-ostree upgrade --preview
# Prepare a new ostree deployment with upgraded packages and reboot into it:
rpm-ostree upgrade --reboot
# Reboot into the previous ostree deployment:
rpm-ostree rollback --reboot
# Install a package into a new ostree deployment and reboot into it:
rpm-ostree install package --reboot
cheat ostree master â—Ľ
# ostree
# Version control for binary files similar to git but optimized for operating system root filesystems.
# OSTree is the foundation for immutable image-based operating systems such as Fedora Silverblue, Fedora IoT or Fedora CoreOS.
# More information: <https://ostreedev.github.io/ostree>.
# Initialize a repository of the files in `$PWD` with metadata in `$PWD/{{path/to/repo}}`:
ostree init --repo path/to/repo
# Create a commit (snapshot) of the files:
ostree commit --repo path/to/repo --branch branch_name
# Show files in commit:
ostree ls --repo path/to/repo commit_id
# Show metadata of commit:
ostree show --repo path/to/repo commit_id
# Show list of commits:
ostree log --repo path/to/repo branch_name
# Show repo summary:
ostree summary --repo path/to/repo --view
# Show available refs (branches):
ostree refs --repo path/to/repo