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-after-ignition: Ensure /etc/extensions is mergable #78

Closed
wants to merge 1 commit into from

Conversation

pothos
Copy link
Member

@pothos pothos commented Nov 27, 2023

In Beta 3760.1.0 the /etc/extensions/ folder gets created by "mkdir -p" because it does not exist in the lowerdir /usr/share/flatcar/etc/. This causes the opaque marker to be set by overlayfs. The update to Alpha thus does not merge the new /usr/share/flatcar/etc/extensions/ folder with its docker/containerd sysext symlinks. We should have had /etc/extensions/ in the lowerdir in Beta but didn't.

Ensure that the created folders are mergable by removing the overlayfs marker. This is needed for existing installations and folders we expect to exist in the lowerdir but might be missing for whatever reason.

How to use

Backport to Alpha and Beta

Testing done

TODO

  • 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.

pothos added a commit to flatcar/scripts that referenced this pull request Nov 27, 2023
This pulls in
flatcar/bootengine#78
to make the Docker/containerd sysexts show up when updating from Beta
3760.1.0.
# to have it non-opaque.
for DIR in /sysroot/etc/extensions /sysroot/etc/flatcar /sysroot/etc/cni; do
if [ -d "${DIR}" ]; then
usrbin unshare -m sh -c "umount /sysroot/etc && /sysusr/usr/bin/attr -R -r overlay.opaque '${DIR}' || true'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use bash quoting feature and also there seem to be some stray apostrophe at the end:

Suggested change
usrbin unshare -m sh -c "umount /sysroot/etc && /sysusr/usr/bin/attr -R -r overlay.opaque '${DIR}' || true'"
usrbin unshare -m sh -c "umount /sysroot/etc && /sysusr/usr/bin/attr -R -r overlay.opaque ${DIR@Q} || true"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, for the quoting I think it's ok to rely on ' because the paths are defined above and not passed in, so we know that they don't contain ' themselves.

In Beta 3760.1.0 the /etc/extensions/ folder gets created by "mkdir -p"
because it does not exist in the lowerdir /usr/share/flatcar/etc/. This
causes the opaque marker to be set by overlayfs. The update to Alpha
thus does not merge the new /usr/share/flatcar/etc/extensions/ folder
with its docker/containerd sysext symlinks. We should have had
/etc/extensions/ in the lowerdir in Beta but didn't.

Ensure that the created folders are mergable by removing the overlayfs
marker. This is needed for existing installations and folders we expect
to exist in the lowerdir but might be missing for whatever reason.
pothos added a commit to flatcar/scripts that referenced this pull request Nov 27, 2023
This pulls in
flatcar/bootengine#78
to make the Docker/containerd sysexts show up when updating from Beta
3760.1.0.
@pothos
Copy link
Member Author

pothos commented Nov 27, 2023

Oh, this only seems to take effect after the reboot. I guess then it rather makes sense to put this in the update-engine postinstall hook as one-time fix for /etc/extensions only. If we want we could make sure that the cni folder exists in the lowerdir and also do a one time fix for that. (The /etc/flatcar path was not affected and just added to the list as precaution, I think it's not really needed.)

pothos added a commit to flatcar/scripts that referenced this pull request Nov 28, 2023
This pulls in
flatcar/bootengine#78
to make the Docker/containerd sysexts show up when updating from Beta
3760.1.0.
@pothos pothos closed this Nov 28, 2023
@pothos pothos deleted the kai/overlay-opaque-dirs branch November 28, 2023 10:47
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