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

sysroot: Handle ro /boot but rw /sysroot #2261

Merged
merged 3 commits into from
Jan 11, 2021

Conversation

cgwalters
Copy link
Member

The recent change in coreos/fedora-coreos-config#659
broke some of our tests that do mount -o remount,rw /sysroot but
leave /boot read-only.

We had code for having /boot read-only before /sysroot but
in practice we had a file descriptor for /sysroot that we opened
before the remount that would happen later on.

Clean things up here so that in the library, we also remount
/boot at the same time we remount /sysroot if either are readonly.

Second, adapt the client side code to check for either being
readonly to enable the mount namespace. Now honestly we could
almost certainly just set this unconditionally - the original
client code here is just being excessively conservative. But
I'd like to make that cleanup independently of this fix.

I was being very conservative initially here, but I think it's
really safe to just unconditionally set up the mount namespace.

This avoids having to check twice for a read-only `/sysroot`
(once in the binary and once in the library).
Just like we hold a fd for `/sysroot`, also do so for `/boot`
instead of opening and closing it in a few places.

This is a preparatory cleanup for further work.
The recent change in coreos/fedora-coreos-config#659
broke some of our tests that do `mount -o remount,rw /sysroot` but
leave `/boot` read-only.

We had code for having `/boot` read-only before `/sysroot` but
in practice we had a file descriptor for `/sysroot` that we opened
before the remount that would happen later on.

Clean things up here so that in the library, we also remount
`/boot` at the same time we remount `/sysroot` if either are readonly.

Delete the legacy code for remounting `/boot` rw if we're not in
a mount namespace.  I am fairly confident most users are either
using the `ostree` CLI, or they're using the mount namespace.
@lucab
Copy link
Member

lucab commented Jan 11, 2021

/lgtm

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, lucab

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cgwalters
Copy link
Member Author

/override continuous-integration/travis-ci/pr
flakes

@openshift-ci-robot
Copy link
Collaborator

@cgwalters: Overrode contexts on behalf of cgwalters: continuous-integration/travis-ci/pr

In response to this:

/override continuous-integration/travis-ci/pr
flakes

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/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit 0b90f1f into ostreedev:master Jan 11, 2021
@lucab lucab mentioned this pull request Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants