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

prepare-var: Do not remount stateroot var in-place, and unmount the temporary var mount after real /var is mounted #3363

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ruihe774
Copy link
Contributor

This is split out of some merge-ready commits in #3358.

Currently, in ostree-prepare-root, we create a read-writable bind-mount of /sysroot/ostree/deploy/$stateroot/var in-place, and in a unit generated by ostree-system-generator, it is then bind-mounted to /var. This approach causes some problem:

  • We have to make the mount slave+shared to prevent sub-mounts from being propagated into /sysroot/ostree/deploy/$stateroot/var.
  • We need to write some bootloader-specific code in ostree-system-generator to get the path to stateroot.
  • /sysroot/ostree/deploy/$stateroot/var is not unmounted afterwards, polluting the global mount namespace.

This PR tries to solving these problem by instead of bind-mounting var in-place, bind-monting it to /run/ostree/.private/var in ostree-prepare-root. In this way, ostree-system-generator can bind-mount a fixed path to /var, and the mount is not necessary to be made slave+shared. Also, ostree-system-generator creates a service ostree-unmount-temp-var.service that unmounts the temporary mount of var after real /var is mounted.

Copy link

openshift-ci bot commented Dec 20, 2024

Hi @ruihe774. Thanks for your PR.

I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@github-actions github-actions bot added the area/prepare-root Issue relates to ostree-prepare-root label Dec 20, 2024
@cgwalters
Copy link
Member

/ok-to-test

@cgwalters cgwalters added needs-ok-to-test triaged This issue has been evaluated and is valid and removed ok-to-test labels Jan 2, 2025
@cgwalters cgwalters self-requested a review January 2, 2025 14:44
@cgwalters
Copy link
Member

Thanks for splitting out preparatory patches like this, it's really helpful for review.

At a very high level what you're saying sounds plausible, but there are quite an array of details here.

In the immediate term it looks like this breaks a whole lot of the CoreOS tests (the logs are currently annoying to get at - go to the jenkins instance and download kola.tar.xz from artifacts, then get console.txt).

Anyways the main failure is:

[ 10.003359] ignition-ostree-populate-var[1195]: mkdir: cannot create directory '/sysroot/var/lib': Read-only file system

The ostree initramfs handling is already quite complex on its own, but Ignition is also a huge amount of complexity in the initramfs too, and it's not surprising that a change like this would break the combination of the two.
The relevant code is around https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-var.sh - presumably it needs some adaption?

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Marking as requested-changes because of the CI failure at least and to clear the immediate needs-review flag.

@cgwalters
Copy link
Member

/ok-to-test
Label race condition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prepare-root Issue relates to ostree-prepare-root do-not-merge/work-in-progress ok-to-test triaged This issue has been evaluated and is valid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants