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

build_image_util: Store path list for recreating tmpfiles rules #1442

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Nov 29, 2023

The removal of files in the overlay present in the lowerdir creates
whiteout entries that mask the lowerdir entries. For those files that
have a tmpfile rule for creation, a reboot would cause the file to be
created in the upperdir, meaning this file is not updated from the
lowerdir when it changes. In addition we have filtered out some tmpfile
rules that caused upcopies (symlinks and directories) which meant that
removing the /etc/resolv.conf symlink didn't bring it back after reboot.
To make files from the lowerdir show up if they have a tmpfile rule that
normally would recreate them we keep a list of whiteout entries that we
clean up on boot. This also prevents freezing files because
systemd-tmpfiles does not need to recreate them in the upperdir.

How to use

Backport to Stable

Testing done

see flatcar/bootengine#79

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

Copy link

github-actions bot commented Nov 29, 2023

@pothos
Copy link
Member Author

pothos commented Nov 30, 2023

Tested with flatcar/mantle#488

The removal of files in the overlay present in the lowerdir creates
whiteout entries that mask the lowerdir entries. For those files that
have a tmpfile rule for creation, a reboot would cause the file to be
created in the upperdir, meaning this file is not updated from the
lowerdir when it changes. In addition we have filtered out some tmpfile
rules that caused upcopies (symlinks and directories) which meant that
removing the /etc/resolv.conf symlink didn't bring it back after reboot.
To make files from the lowerdir show up if they have a tmpfile rule that
normally would recreate them we keep a list of whiteout entries that we
clean up on boot. This also prevents freezing files because
systemd-tmpfiles does not need to recreate them in the upperdir.
@pothos pothos force-pushed the kai/overlay-whiteouts branch from 473e661 to 5590da4 Compare November 30, 2023 10:57
@pothos pothos merged commit 73af503 into main Nov 30, 2023
1 check failed
@pothos pothos deleted the kai/overlay-whiteouts branch November 30, 2023 10:58
pothos added a commit that referenced this pull request Nov 30, 2023
build_image_util: Store path list for recreating tmpfiles rules
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.

2 participants