Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ship /etc from /usr through an overlay mount
The existing tmpfile logic took care of folders that the ebuild keepdir directive wanted to exist on the OS. However, files and symlinks were not created, causing them to be missing if we didn't explicitly modify the ebuild files in coreos-overlay to use tmpfiles or patching of paths to be in /usr. We need a logic to provide /etc files from the current /usr partition without getting stale. This can be done best with an overlay mount which requires to keep the original /etc files under /usr. Move the final /etc folder of the image build to /usr/share/flatcar/etc to serve as lower layer in the overlay. Also remove any state from the rootfs to make sure that we don't rely on it when testing our images before the release. What we get with an overlay mount is essentially a similar behavior to a 3-way merge because as long as the user didn't change the files, the old version is replaced with the new version and as soon as the user did changes, that file is frozen and wins over the provided old (in case of a rollback) or new versions from /usr. It does not work on file lines but on whole file contents, yet that is also what rpm-ostree does to my knowledge. Also, run tmpfiles once and do the SELinux labeling to prevent files being created in the upperdir because they were missing in the lowerdir, or because they had missing SELinux labels.
- Loading branch information