Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initrd-setup-root: Clean duplicate overlayfs entries #54

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Feb 24, 2023

With machines having an old full /etc they would not benefit from future updates of files in /usr/share/flatcar/etc. Clean up duplicate entries to make sure that the lowerdir gets used. While this could be done in a one-time migration it is actually not bad to do this also against unwanted upcopies. The walker helper function introduced should also be used for the selective OS reset feature.

How to use

Testing done

Booted the Alpha image and then ran:

ls -lah /etc
wget https://bincache.flatcar-linux.net/images/amd64/9999.9.9+kai-etc-overlay-cleanup/flatcar_test_update.gz
sudo flatcar-update -V 9999.9.9 -D -P flatcar_test_update.gz
sudo reboot
[… rebooting …]
sudo unshare -m bash -c 'umount /etc && ls -lah /etc'

This showed that most files/symlinks/dirs are gone and only changed files were left, e.g., /etc/hosts, /etc/profile, /etc/iscsi were deleted but the /etc/systemd/system.conf file has a different comment because the default changed and thus this file didn't get deleted.

CI
shellcheck dracut/99setup-root/initrd-setup-root
New Kola test: flatcar/mantle#414

@pothos pothos requested a review from a team February 24, 2023 10:19
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 24, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos force-pushed the kai/etc-overlay-cleanup branch from 345e088 to 3676aaa Compare February 27, 2023 02:13
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 27, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos force-pushed the kai/etc-overlay-cleanup branch 2 times, most recently from 8da7f57 to 85ec998 Compare February 27, 2023 08:52
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 27, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos force-pushed the kai/etc-overlay-cleanup branch from 85ec998 to 90b1b53 Compare February 27, 2023 11:09
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 27, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos force-pushed the kai/etc-overlay-cleanup branch 2 times, most recently from b451800 to 2bd7fc0 Compare February 27, 2023 12:15
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 27, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 27, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos force-pushed the kai/etc-overlay-cleanup branch from 2bd7fc0 to 7c1c3af Compare February 28, 2023 06:20
With machines having an old full /etc they would not benefit from
future updates of files in /usr/share/flatcar/etc.
Clean up duplicate entries to make sure that the lowerdir gets used.
While this could be done in a one-time migration it is actually not bad
to do this also against unwanted upcopies. The walker helper function
introduced should also be used for the selective OS reset feature.
@pothos pothos force-pushed the kai/etc-overlay-cleanup branch from 7c1c3af to 01855b1 Compare February 28, 2023 06:29
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 28, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos requested a review from a team February 28, 2023 13:09
@pothos pothos merged commit 786e45c into flatcar-master Feb 28, 2023
@pothos pothos deleted the kai/etc-overlay-cleanup branch February 28, 2023 14:36
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 28, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
@pothos pothos linked an issue Feb 28, 2023 that may be closed by this pull request
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 17, 2023
This pulls in
flatcar/bootengine#54
to provide a migration path and also ensure that no unwanted /etc/
upperdir files prevent using updated lowerdir files from
/usr/share/flatcar/etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFE] Handle configuration updates in /etc
2 participants